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.
please type nmon you will see a view like this.
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.
-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?
so -c is 96
-s 900 -c 96
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
-c =518400/1800= 288 snapshots
so the command looks like this
-r = for output file names
script nmon can we run automatically at certain hours as needed, we can enter the script nmon on crontab.
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.
this is the result of a nmon log analysis.
so this article I hope to help you.