How to Monitoring Linux server with NMON

how to monitoring linux server with nmon

nmon is short for Nigel’s Monitor performance for Linux. why should nmon for monitoring server linux? because nmon is very easy to use. nmon for linux runs in the background, you will not be able to see the process being run by nmon. the output of the nmon process is a spreadsheet. i am currently using nmon for rhel 6 or rhel 7 operating system, you can download it nmon for linux or you can visit this page (github).

following command to install nmon.

rpm -Uvh nmon-rhel6-1.0-1.x86_64.rpm

install nmon on rhel6

please type nmon you will see a view like this.

how to monitoring linux server with nmon

If you need nmon to collect server performance data, you can run it in the background. nmon runs in the background at intervals per second with option –s and –f for output spreadsheet. if you need nmon to run for 5 minutes then command like this.

$  nmon -s 300 -c 12 -f -t -m /home/hard/test_nmon

-s 300= you want to capture data every 300 second or 5 minutes

-c 12 = you want 12 points or snap shots

-f = for output spreadsheet

-t= spreadsheet includestop processes

-m= path for output (/home/hard/test_nmon)

If you want a report to run every 15 minutes for 1 day, you get the 1 day value in seconds

1 day =24 hours x 60 mins x 60 second = 86400 seconds

15 mins = 60 seconds x 15 mins = 900 seconds

now you know your interval is 900 seconds,so value for you -s 900 and how do you get snapshot value?

86400/900=96 snapshots

so -c is 96

-s 900 -c 96

$  nmon -s 900 -c 96 -f -t -m /home

for another example, suppose i need nmon to collect data for 6 days with 30 minute interval like this.

6 days = 6 days x 24 hours x 60 mins x 60 seconds =518400

30 mins = 30 mins x 60 seconds=1800

-s =1800

-c =518400/1800= 288 snapshots

so the command looks like this

$ nmon -s 1800 -c 288 -r “test nmon” -f -t-m /home

-r = for output file names

script nmon can we run automatically at certain hours as needed, we can enter the script nmon on crontab.

*/5 * * * * /usr/bin/nmon -s 300 -r “” -c 12 -f -t -m /home/nmonlog

in the above crontab script, will run for a 300 second or 5 minute interval and run automatically every 5 minutes, the nmon script will generate a log of extension .nmon and to analyze the result of nmon we need 1 more tools that is nmon analyzer. download nmon analiser here. following screenshot of nmon analyzer, click analyze nmon data and browse your nmon log.

monitoring linux server

this is the result of a nmon log analysis.

nmon analyze

so this article I hope to help you.

Facebook Comments