در این سری مقاله سعی من بر این است تا ابزارهای مونیتورینگ که در این قسمت (1) بیشتر کنسولی هستند را معرفی کنم و همچنین سیستم عامل رو من debian در نظر گرفتم که شما میتونید با نیازهای خودتون تغییراتی بدین.ابزارهای این شماره بنظر ساده میان ولی بسیار کاربردی هستند,در ضمن من ابزارهای متفاوتی معرفی میکنم که شما باید بهترین اونو انتخاب کنید.
در این شماره تمرکزمون رو روی مونیتورینگ cpu , ram , swap , mount points , network interfaces از طریق کنسول و یصورت لوکال نه ریموت یعنی منابع از روی کامیپوتر دیگه گرفته نمیشه هر چند که شما میتونید از طریق putty نتایج رو از هر جای دیگه هم ببینید.
در شماره های آینده به معرفی و نصب برنامه های پیشرفته تری میپردازیم.
بعضی از لغات اگرترجمه بشن معنی خودشون رو از دست میدن پس من از این کار خودداری میکنم,همچنین از مشخصه های یک مدیر شبکه آشنایی با زبان انگلیسی در حد لازم برای برطرف کردن نیازهاش میباشد.
مقدمه :
امروزه نظارت برسیستم و منابع سیستم یکی از اساسی ترین نیازهای هر شبکه و مدیر شبکه ای برای بررسی میزان کارایی اون شبکه و سیستم میباشد.اگر منابع سیستم کم باشد یا به مرور مشکلاتی برای سیستم به وجود آمده باشد عدم آگاهی از این رخددادها عواقب وخیمی درآینده در پی خواهد داشت.
منابع سیستم هم بوسیله کاربر می تواند مصرف شود هم بواسطه سرویس هایی که بر روی سرور قرار دارنداز قبیل وب یا میل .توانایی در جهت شناخت اتفاقاتی که در معرض روی دادن است می تواند به تشخیص اینکه سیستم احتیاج به بروزرسانی دارد یا نه کمک شایانی کند یا حتی اگر سیستم نیاز دارد تا یک سرویس به سرور دیگری منتقل شود.
1-free
نمایش دهنده میزانmemory آزاد و مصرف شده
free [-b|-k|-m|-g] [-l] [-o] [-t] [-s delay ] [-c count ]
top [-] [d delay] [p pid] [q] [c] [C] [S] [s] [i] [n iter] [b]
3-htop
htop تو مایه های top هستش ولی خیلی بهتر و interactive تر هست.همونطور که از عکسش معلومه براحتی میتونید پروسه ها رو Kill کنید و…من توصیه میکنم ازبجای top از این استفاده کنید منتها برای استفاده از htop باید نصبش کنید روی سیستمتون
htop is a very competent interactive process viewer for the shell, providing all the functionality - and more - that the top utility does, in an easier and more intuitive way. htop provides easy-to-use menus for most operations and also has support for using a mouse.
htop is an easier to use and friendlier version of top. While it hasn’t as much time behind it and therefore is less tested, it seems to work very well both locally and over SSH, and it’s well worth taking it for a spin. It’s just one of those small utilities that makes life a bit easier.
نصب :
#apt-get install htop
Comparison between htop and top
In ‘htop’ you can scroll the list vertically and horizontally to see all processes and complete command lines.
In ‘top’ you are subject to a delay for each unassigned key you press (especially annoying when multi-key escape sequences are triggered by accident).
‘htop’ starts faster (’top’ seems to collect data for a while before displaying anything).
In ‘htop’ you don’t need to type the process number to kill a process, in ‘top’ you do.
In ‘htop’ you don’t need to type the process number or the priority value to renice a process, in ‘top’ you do.
‘htop’ supports mouse operation, ‘top’ doesn’t
‘top’ is older, hence, more used and tested.
***************************************
4-slmon
Slmon هم برنامه جالبیه که میزان مصرف cpu ,ram همچین مقدار فضای خالی یا مصرفی mount ها ازقبیل هارد, فلش و… رو نشون میده.برای دیدن پروسه هایی که در حال انجام هستن باید روی p کیک کنید تا پروسه های لیست بشه براتون…
SLmon is a tool for monitoring a system's performance. It displays results using a nice and easilyreadable text-based UI. It has the ability to monitor CPU load (SMP is supported), memory/filesystems usage, network interfaces, uptime, date and time, and the number of logged in users.
نصب :
#apt-get install slmon
***************************************
5-sysstat
sysstat حاوی sar,mpstat,iostat هستش که هر کدوم کاری انجام میدن.(منکه اصلا باهاش حال نکردم)
نصب :
#apt-get install sysstat
sar command
The sar command collects and reports system activity information. The statistics reported by sar concern I/O transfer rates, paging activity, process-related activities, interrupts, network activity, memory and swap space utilization, CPU utilization, kernel activities and TTY statistics, among others. Both UP and SMP machines are fully supported.
The mpstat command reports global and per-processor statistics
iostat command
The iostat will display the current CPU load average and disk I/O information. This is a great command to monitor your disk I/O usage.
For 2.4 kernels the devices is names using the device's major and minor number. In this case the device listed is SCSI. To have iostat print this out for you, use the -x.
***************************************
6-ps
ps لیستی از پروسه هایی که الان در حال اجراست را نشان میده
The ps will provide you a list of processes currently running. There is a wide variety of options that this command gives you.
ps [-a] [-A] [-c] [-d] [-e] [-f] [-j] [-l] [-L] [-P] [-y] [ -g grplist ] [ -n namelist ] [-o format ] [ -p proclist ] [ -s sidlist ] [ -t term] [ -u uidlist ] [ -U uidlist ] [ -G gidlist ]
برای اینکه لیست تمام پروسه هایی که در حال انجام هست رو ببینیم از دستور زیر استفاده میکنیم
#ps -ef
برای اینکه پروسه های یک کاربر خاص رو ببینیم از دستور زیر استفاده میکنیم
#ps -u(defualt is current user)
#ps -u zabbix
از kill میتونیم بهمراه ps برای پابان دادن به یک پروسه استفاده کنیم..مثلا pid یه پروسه در عکس آخر ۱۱۳۸ هستش..ما برای اینکه فاتحه!! این پروسه رو بخونیم به این طریق عمل میکنیم
#kill -۹ ۱۱۳۸
۹ هم برای اطمینان از اجرا شدن مینویسیم
***************************************
7-pstree
pstree لیست پروسه هایی که الان در حال انجام هستند رو نشون میده
pstree - display a tree of processes
pstree [ -a ] [ -c ] [ -h | -H pid ] [ -l ] [ -n ] [ -p ] [ -u ][ -A | -G | -U ] [ pid | user]
برای نمایش پروسه ها بدین طریق عمل میکنیم
#pstree
#pstree -p(show PIDs; implies -c)
#pstree -n(sort output by PID)
#pstree pid(start at pid, default 1 (init))#pstree user(show only trees rooted at processes of that user)
***************************************
8-jmon
jmon درصد استفاده cpu, memory , swap رو بهمون نشون میده
The jmon tool monitors selected resources (memory, cpu, I/O) used by a running batch job on a particular machine, as well as overall machine activities.
jmon [ -interval
] [ -count ] [ -outfile ] [ -path ] [ -(no)fg ] [ -version ] [ -help|? ]
#jmon
dstat [-afv] [-cdgilmnpsty] [-D..] [-I..] [-N..] [delay [count]]
#dstat
***************************************
10-vmstat
اطلاعاتی در مورد پروسه ها , memory, cpu,swap, io ,procs در اختیارمون میزاره
vmstat reports information about processes, memory, paging, block IO, traps, and cpu activity.
vmstat [-V] [-n] [delay [count]]
FIELD DESCRIPTIONS
Procs
r: The number of processes waiting for run time.
b: The number of processes in uninterruptable sleep.
w: The number of processes swapped out but otherwise runnable. This
field is calculated, but Linux never desperation swaps.
Memory
swpd: the amount of virtual memory used (kB).
free: the amount of idle memory (kB).
buff: the amount of memory used as buffers (kB). Swap
si: Amount of memory swapped in from disk (kB/s).
so: Amount of memory swapped to disk (kB/s).
IO
bi: Blocks sent to a block device (blocks/s).
bo: Blocks received from a block device (blocks/s).
System
in: The number of interrupts per second, including the clock.
cs: The number of context switches per second.
These are percentages of total CPU time.
us: user time
sy: system time
id: idle time
نصب :
# apt-get install vnstat
# vnstat -u -i eth0
u مجبور میکنه که دیتابیس آپدیت بشه یا اگه دیتابیسی وجود نداره اونو میسازه
vnstat شروع به جمع آوری دیتا از طریق cronjob میکنه که موقع نصب بصورت خودکار اصافه میشه
0-55/5 * * * * root /usr/bin/vnstat -u
برای دیدن اطلاعات بدیدن طریق عمل میکنیم
#vnstat#vnstat -h(Show traffic for the last 24 hours)#vnstat -d(Show traffic for days)#vnstat -w(Show traffic for 7 days, current and previous week)#vnstat -m(Show traffic for months)#vnstat -t (Show all time top10 traffic days)#vnstat –help
12-bwm
bwm یک برنامه کوچولی مونیتورینگ پهنای باند هست که تا 16 تا کارت شبکه رو همزمان میتونه پشتیبانی کنه
نصب :
#apt-get install bwm
برای اینکه خروجی رو ببینید بدین طریق عمل کنبد
#bwm
***************************************
13-ethstats
ethstats خروجی کارت شبکه ها رو براساس مگابیت بر ثانیه و پکت بر ثانیه نشان میده..البته همچین با حال نیست!!
نصب :
#apt-get install ethstats
برای مشاهده خروجی این طور عمل میکنیم
#ethstats
***************************************
14-ethstatus
نصب :
#apt-get install ethstatus
برای مشاهده خروجی این طور عمل میکنیم
#ethstatus
***************************************
15-ifstat
نصب:
#apt-get install ifstat
#ifstat
نصب :
#apt-get install iftop
برای مشاهده خروجی بدین طریق عمل میکنیم
#iftop -h | [-nNpbBP] [-i interface] [-f filter code] [-F net/mask]
#iftop
#apt-get install iog
#iog
http://serverip/iog
18-phpsyinfo
phpsysinfo اسکریپت php هست که اطلاعاتی در مورد سیستم از قبیل cpu,memory,uptime,network usage,.. در اختیارمون میزاره
phpSysInfo is a customizable PHP script that parses various files in /proc and displays them. It will display information about system facts like Uptime, CPU, Memory, SCSI, IDE, PCI, Ethernet, Floppy, and Video. It now has full internationalization support along with customizable templates.
نصب :
این برنامه چون تحت وب هست میباست apache همراه با php رو قبلا نصب کرده باشیم, ولی در حال بدین صورت قابل انجامه
#apt-get install apache php4
#apt-get install phpsysinfo
موقع نصب 4 تا سوال ازتون میپرسه که هر جور که دوست دارین باید جواب بدید این عکس های 2 تا از سوالات مهمش هست
بعد از نصب یه دایکتوری بنام phpsysinfo در /var/www/ ساخته میشه
برای دیدن کافیه این آدرس رو در مرورگرتون بزنید
http://serveripaddress/phpsysinfo/
***************************************
19-df
df به شما میگه که چه مقدار فضای آزاد و اشغال شده در هر کدام از mount های خودتون دارید از قبیل هارددیسک , فلش , ….
The df command is used to show the amount of disk space that is free on file systems.
df [ -F FSType ] [-a [-b] [-e] [-g] [-k] [-l] [-n] [-t] [-V ] [ -o FSTypespecific_options ] [block_device | directory | file | resource … ] [-P]
برای دیدن اطلاعات بدیدن طریق عمل میکنیم
#df
#df -m(type size in mega)#df -a(all-includinf file system having 0 block)#df - h(human-readable)#df –help
#df -i
#apt-get install discus
#discus#discus -m#discus -p number(number of digits to right of decimal place)#discus –help
Tells you how much space a file occupies.
du [-a] [-k] [-s] [-d] [-L] [-o] [-r] [-x] directories
#du#du -s *.conf (Would report the size of each conf file in the current directory)#du -h *.conf(Display the size of the conf files in a friendly size format listing)#du-c(see total capacity of all the files combined)
#du -ch reza.zip
هیچ نظری موجود نیست:
پست کردن نظر