Few server monitoring commands:
Note: You may need to install some commands on server.
============================================================
top
top -u username
============================================================
mpstat
mpstat -P ALL
============================================================
sar
sar -u 2 5
Output (for each 2 seconds. 5 lines are displayed):
============================================================
Displays the top 10 CPU users on the Linux system.
ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10
OR
ps -eo pcpu,pid,user,args | sort -r -k1 | less
============================================================
System's average CPU utilization since the last reboot.
iostat
three outputs every 5 seconds
iostat -xtc 5 3
============================================================
vmstat by default will display the memory usage (including swap) as shown below.
vmstat
============================================================
displays the memory map of the current bash shell. In this example, 5732 is the PID of the bash shell.
pmap 5732
============================================================
IPTraf is a IP Network Monitoring Software.
iptraf
============================================================
strace displays all system calls for the given executable. The following example shows the output of strace for the Linux ls command.
strace ls
strace -e open ls
============================================================
Lsof stands for ls open files
lsof | more
lsof -u ramesh
lsof /bin/vi
============================================================
Ntop is just like top, but for network traffic. ntop is a network traffic monitor that displays the network usage.
ntop
============================================================
w
uptime
============================================================
Use “vnstat -t” or “vnstat –top10? to display all time top 10 traffic days.
vnstat --top10
vnstat
============================================================
htop is a ncurses-based process viewer.
htop
============================================================
ss stands for socket statistics. This displays information that are similar to netstat command.
ss -l
The following displays only the established connection.
ss -o state established
The following displays socket summary statistics.
ss -s
============================================================
iftop
============================================================
Good URLs:
http://www.thegeekstuff.com/2011/12/linux-performance-monitoring-tools/
http://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages
http://www.tecmint.com/command-line-tools-to-monitor-linux-performance/
Note: You may need to install some commands on server.
============================================================
top
top -u username
============================================================
mpstat
mpstat -P ALL
============================================================
sar
sar -u 2 5
Output (for each 2 seconds. 5 lines are displayed):
============================================================
Displays the top 10 CPU users on the Linux system.
ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10
OR
ps -eo pcpu,pid,user,args | sort -r -k1 | less
============================================================
System's average CPU utilization since the last reboot.
iostat
three outputs every 5 seconds
iostat -xtc 5 3
============================================================
vmstat by default will display the memory usage (including swap) as shown below.
vmstat
============================================================
displays the memory map of the current bash shell. In this example, 5732 is the PID of the bash shell.
pmap 5732
============================================================
IPTraf is a IP Network Monitoring Software.
iptraf
============================================================
strace displays all system calls for the given executable. The following example shows the output of strace for the Linux ls command.
strace ls
strace -e open ls
============================================================
Lsof stands for ls open files
lsof | more
lsof -u ramesh
lsof /bin/vi
============================================================
Ntop is just like top, but for network traffic. ntop is a network traffic monitor that displays the network usage.
ntop
============================================================
w
uptime
============================================================
Use “vnstat -t” or “vnstat –top10? to display all time top 10 traffic days.
vnstat --top10
vnstat
============================================================
htop is a ncurses-based process viewer.
htop
============================================================
ss stands for socket statistics. This displays information that are similar to netstat command.
ss -l
The following displays only the established connection.
ss -o state established
The following displays socket summary statistics.
ss -s
============================================================
iftop
============================================================
Good URLs:
http://www.thegeekstuff.com/2011/12/linux-performance-monitoring-tools/
http://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages
http://www.tecmint.com/command-line-tools-to-monitor-linux-performance/
No comments:
Post a Comment