Professional Documents
Culture Documents
1/13
Table Of Contents
Table Of Contents ............................................................................................................................... 1
#1: top - Process Activity Command ................................................................................................... 2
Commonly Used Hot Keys ................................................................................................................................................ 2
#3: w - Find Out Who Is Logged on And What They Are Doing .......................................................... 3
#4: uptime - Tell How Long The System Has Been Running ............................................................................................ 3
2/13
Need to monitor Linux server performance? Try these built-in command and a few add-on
tools. Most Linux distributions are equipped with tons of monitoring. These tools provide
metrics which can be used to get information about system activities. You can use these
tools to find the possible causes of a performance problem. The commands discussed
below are some of the most basic commands when it comes to system analysis and
debugging server issues such as:
1.
2.
3.
4.
[1]
[2]
Usage
A
f
r
k
#3: w - Find Out Who Is Logged on And What They Are Doing
w command displays information about the users currently on the machine, and their processes.
# w username
# w vivek
Sample Outputs:
17:58:47 up 5 days, 20:28, 2 users, load average: 0.36, 0.26, 0.24
USER
TTY
FROM
LOGIN@
IDLE
JCPU
PCPU WHAT
root
pts/0
10.1.3.145
14:55
5.00s 0.04s 0.02s vim /etc/resolv.conf
root
pts/1
10.1.3.145
17:43
0.00s 0.03s 0.00s w
#4: uptime - Tell How Long The System Has Been Running
The uptime command can be used to see how long the server has been running. The current time, how long the
system has been running, how many users are currently logged on, and the system load averages for the past 1, 5,
and 15 minutes.
# uptime
Output:
18:02:41 up 41 days, 23:42,
1 user,
3/13
4/13
1 can be considered as optimal load value. The load can change from system to system. For a single CPU system 1 - 3
and SMP systems 6-10 load value might be acceptable.
TTY
?
?
?
?
?
?
TIME
00:00:02
00:00:02
00:00:01
00:00:00
00:00:00
00:00:15
CMD
init
migration/0
ksoftirqd/0
watchdog/0
migration/1
ksoftirqd/1
?
tty1
tty2
tty3
tty4
tty5
tty6
ttyS1
?
?
?
?
pts/0
?
?
pts/1
00:53:28
00:00:00
00:00:00
00:00:00
00:00:00
00:00:00
00:00:00
00:00:00
00:00:00
00:00:00
00:10:34
00:00:00
00:00:00
00:00:00
00:00:00
00:00:00
java
mingetty
mingetty
mingetty
mingetty
mingetty
mingetty
agetty
cifsoplockd
cifsdnotifyd
lighttpd
php-cgi
vim
php-cgi
bind9-snmp-stat
ps
5/13
# ps -ejH
# ps axjf
# pstree
used
9739664
4061800
0
free
2563232
8241096
1052248
shared
0
buffers
523124
cached
5154740
6/13
=> Related: :
1. Linux Find Out Virtual Memory PAGESIZE [5]
2. Linux Limit CPU Usage Per Process [6]
3. How much RAM does my Ubuntu / Fedora Linux desktop PC have? [7]
%user
3.50
Device:
sda
sda1
sda2
sda3
Blk_read/s
31.88
0.00
31.87
0.00
06/26/2009
%steal
0.00
%idle
95.86
Blk_wrtn/s
512.03
0.00
512.03
0.00
Blk_read
16193351
2166
16189010
1615
Blk_wrtn
260102868
180
260102688
0
=> Related: : Linux Track NFS Directory / Disk I/O Stats [8]
PM
PM
PM
PM
PM
PM
CPU
all
all
all
all
all
all
%user
2.00
2.07
0.94
1.56
3.53
2.02
%nice
0.00
0.00
0.00
0.00
0.00
0.00
06/26/2009
%system
0.22
0.38
0.28
0.22
0.25
0.27
%iowait
0.00
0.03
0.00
0.00
0.03
0.01
%steal
0.00
0.00
0.00
0.00
0.00
0.00
%idle
97.78
97.52
98.78
98.22
96.19
97.70
=> Related: : How to collect Linux system utilization data into a file [9]
7/13
PM
PM
PM
PM
PM
PM
PM
PM
PM
PM
CPU
all
0
1
2
3
4
5
6
7
%user
3.50
3.44
3.10
4.16
3.77
2.96
3.26
4.00
3.30
%nice
0.09
0.08
0.08
0.11
0.11
0.07
0.08
0.10
0.11
06/26/2009
%sys %iowait
0.34
0.03
0.31
0.02
0.32
0.09
0.36
0.02
0.38
0.03
0.29
0.04
0.28
0.03
0.34
0.01
0.39
0.03
%irq
0.01
0.00
0.02
0.00
0.01
0.02
0.01
0.00
0.01
%soft
0.17
0.12
0.11
0.11
0.24
0.10
0.10
0.13
0.46
%steal
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
%idle
95.86
96.04
96.28
95.25
95.46
96.52
96.23
95.42
95.69
intr/s
1218.04
1000.31
34.93
0.00
44.80
25.91
14.98
3.75
76.89
=> Related: : Linux display each multiple SMP CPU processors utilization individually [10].
Get Detailed Information About Particular IP address Connections Using netstat Command [13]
[14]
8/13
[15]
9/13
cat
cat
cat
cat
10/13
/proc/cpuinfo
/proc/meminfo
/proc/zoneinfo
/proc/mounts
[22]
11/13
[24]
12/13
for processes i.e. it is network traffic monitoring software. You can see network status, protocol wise distribution
of traffic for UDP, TCP, DNS, HTTP and other protocols.
Conky [28] - Another good monitoring tool for the X Window System. It is highly configurable and is able to
monitor many system variables including the status of the CPU, memory, swap space, disk storage,
temperatures, processes, network interfaces, battery power, system messages, e-mail inboxes etc.
GKrellM [29] - It can be used to monitor the status of CPUs, main memory, hard disks, network interfaces, local
and remote mailboxes, and many other things.
vnstat [30] - vnStat is a console-based network traffic monitor. It keeps a log of hourly, daily and monthly
network traffic for the selected interface(s).
htop [31] - htop is an enhanced version of top, the interactive process viewer, which can display the list of
processes in a tree form.
mtr [32] - mtr combines the functionality of the traceroute and ping programs in a single network diagnostic tool.
Did I miss something? Please add your favorite system motoring tool in the comments.
4000+ howtos and counting! Want to read more Linux / UNIX howtos, tips and
tricks? Subscribe to our free daily email newsletter or weekly newsletter to make
sure you don't miss a single tip/tricks. Alternatively, subscribe via RSS/XML feed.
Article printed from nixCraft: http://www.cyberciti.biz/
URL to article: http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html
URLs in this post:
[1] Image: http://www.cyberciti.biz/tips/category/linux
[2] Image: http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html/top-output
[3] How do I Find Out Linux CPU Utilization?: http://www.cyberciti.biz/tips/how-do-i-find-out-linux-cpu-utilization.html
[4] How do I find out Linux Resource utilization to detect system bottlenecks?: http://www.cyberciti.biz/tips/linuxresource-utilization-to-detect-system-bottlenecks.html
[5] Linux Find Out Virtual Memory PAGESIZE: http://www.cyberciti.biz/faq/linux-check-the-size-of-pagesize/
[6] Linux Limit CPU Usage Per Process: http://www.cyberciti.biz/faq/cpu-usage-limiter-for-linux/
[7] How much RAM does my Ubuntu / Fedora Linux desktop PC have?: http://www.cyberciti.biz/tips/how-much-ramdoes-my-linux-system.html
[8] Linux Track NFS Directory / Disk I/O Stats: http://www.cyberciti.biz/faq/howto-linux-track-nfs-client-disk-metrics/
[9] How to collect Linux system utilization data into a file: http://www.cyberciti.biz/tips/howto-write-system-utilizationdata-to-file.html
[10] Linux display each multiple SMP CPU processors utilization individually: http://www.cyberciti.biz/faq/linux-mpstatcommand-report-processors-related-statistics/
[11] Linux find the memory used by a program / process using pmap command: http://www.cyberciti.biz/tips/howto-findmemory-used-by-program.html
[12] ss: Display Linux TCP / UDP Network and Socket Information: http://www.cyberciti.biz/tips/linux-investigatesockets-network-connections.html
[13] Get Detailed Information About Particular IP address Connections Using netstat Command:
http://www.cyberciti.biz/tips/netstat-command-tutorial-examples.html
[14] Image: http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html/iptraf3
[15] Image: http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html/iptraf2
[16] wireshark to view detailed: http://www.cyberciti.biz/faq/linux-unix-bsd-apache-tcpdump-http-packets-sniffing/
[17] trace the process and: http://www.cyberciti.biz/tips/linux-strace-command-examples.html
[18] Linux kernel /proc: http://www.cyberciti.biz/files/linux-kernel/Documentation/filesystems/proc.txt
[19] Nagios: http://www.nagios.org/
[20] FAN is: http://fannagioscd.sourceforge.net/drupal/
[21] to install and configure Cacti network graphing: http://www.cyberciti.biz/faq/fedora-rhel-install-cacti-monitoring-rrdsoftware/
[22] Image: http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html/kde-systemguard-screenshot
[23] the KSysguard handbook: http://docs.kde.org/stable/en/kdebase-workspace/ksysguard/index.html
[24] Image: http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html/gnome-system-monitor
[25] nmap: http://www.cyberciti.biz/tips/linux-scanning-network-for-open-ports.html
13/13
Copyright 2004-2010 nixCraft. All rights reserved. This print / pdf version is for personal non-commercial use only. More
details - http://www.cyberciti.biz/tips/copyright