MONITORING UNIX SYSTEM PERFORMANCE
crontab: This command tells the system to schedule a job at a
particular time and date and execute the job accordingly. There are many
command line options in crontab. In the below example crontab l shows
the list of scheduled jobs and copies the results to an output file.
In the same way, we can schedule a new job by using crontab e
For example, If we want to run a job on every day, every hour
0 * * * * sh/pathofthe_job/jobname.sh
uptime: It tells about the load averages on the system. In the below
example the uptime displays the time the system has been up, and the three
load averages for the system. The load averages are the average number of
process ready to run during the last 1, 5 and 15 minutes.
Process Status (ps): It tells about the processes running in the
systems. There are many command line options in ps which are shown in the
below snapshot.
For example the command ps e shows all the processes running in the
system.Suppose if we want to get the status of only mysql process we have
to give the following command ps ef|grep mysql.
iostat: The iostat will display the current CPU load average and disk I/O
information.
Syntax: iostat interval count
The below snapshot shows average cpu load and disk i/o. In this iostat 1
5 states to update the information of disk i/o and cpu load average for
every one second totally for five times.
sar: It is used to get the information about CPU utilization, system
calls, memory allocation, buffer activity, paging activity, and many
more. There are many command line options in sar which can be
used in combinations. For example the below snapshot shows two
commands sar u 2 5 and sar pd 2 5. The first one sar u
2 5 gives the information on cpu utilization for every two seconds
totally five times. The second one sar pd 2 5 gives the disk i/o
for every two seconds totally five times.
Virtual memory statistics (vmstat): vmstat reports
information about processes, memory, paging, block IO, traps, and cpu
activity. The below snapshot of vmstat shows the memory every 1 second
and for 5 times
vmstat 1 5
Netstat: It is used for networking reports. There are many command
line options in netstat which can used in combinations. For example, to
diagnose a networking problem netstat i could be used in the following
way:
Name
Odrop
eg1
eg0
loop
Mtu
Network
1500 204.89.162
1500 38.254.211
1536 loopback-net
Address
dxi4.dxi.com
dxifour.dxi.com
localhost
Ipkts
2275517
4716968
0
Opkts
3783974
2862227
0
0
0
0
Here Odrop are the number of packets that were dropped or discarded
without reaching destination. The below snapshot shows all the command
line options that are available in netstat.
top: Top produces a list of all the currently running processes
listed in order of CPU usage. The list is continuously updated at five
second intervals by default, and there are options to shorten or
lengthen the update period. There are many command line options
in top. In top by default only some of the fields are displayed. We
can add the required additional fields using shift+o which gives
total field descriptions. We can also sort process ids using shift+<.
The below snapshot shows how the top command works.