Page 1 of 2

Script to find nmon for AIX

Posted: Sun Aug 23, 2015 12:18 am
by raamardhani7
Hi Team,

Is there any working scripts that someone having for finding the different parameters of nmon on an AIX server.

I have found this one and couldn't find this URL is much convincing, could someone help me here.

https://exchange.nagios.org/directory/P ... on/details.

Output I am getting after running the script.
./check_nmon -F /usr/local/nagios/libexec/check_nmon_cpu.php -k CPU_ID -s User%,Sys%,Wait%,Idl
UNKNOWN - NMON file /usr/local/nagios/libexec/check_nmon_cpu.php older than an hour. NMON is stopped!

If someone is having a script for nmon processes please revert to me. thanks.

Regards,
Ram.

Re: Script to find nmon for AIX

Posted: Mon Aug 24, 2015 9:15 am
by jdalrymple
This script is intended to interpret nmon spreadsheet files generated by the included perl script. Did you get that file going? That will be the first step. Looks like when you get it going it will end with the extension ".nmon" if you don't fiddle with the script.

Re: Script to find nmon for AIX

Posted: Mon Aug 24, 2015 10:28 am
by raamardhani7
jdalrymple wrote:This script is intended to interpret nmon spreadsheet files generated by the included perl script. Did you get that file going? That will be the first step. Looks like when you get it going it will end with the extension ".nmon" if you don't fiddle with the script.
Hi..

Seems like the script had generated files as you mentioned in the directory mentioned in the URL above.

# ls -ltr
total 53288
-rw-r--r-- 1 root system 1255687 Aug 3 23:56 Server_name_150803_0501.nmon
-rw-r--r-- 1 root system 1267875 Aug 4 23:56 Server_name_150804_0501.nmon
-rw-r--r-- 1 root system 1274181 Aug 5 23:56 Server_name_150805_0501.nmon
-rw-r--r-- 1 root system 1267222 Aug 6 23:56 Server_name_150806_0501.nmon
-rw-r--r-- 1 root system 1268208 Aug 7 23:56 Server_name_150807_0501.nmon
-rw-r--r-- 1 root system 1275254 Aug 8 23:56 Server_name_150808_0501.nmon
-rw-r--r-- 1 root system 1272946 Aug 9 23:56 Server_name_150809_0501.nmon
-rw-r--r-- 1 root system 1264565 Aug 10 23:56 Server_name_150810_0501.nmon
-rw-r--r-- 1 root system 1267989 Aug 11 23:56 Server_name_150811_0501.nmon
-rw-r--r-- 1 root system 1270166 Aug 12 23:56 Server_name_150812_0501.nmon
-rw-r--r-- 1 root system 1269076 Aug 13 23:56 Server_name_150813_0501.nmon
-rw-r--r-- 1 root system 1260946 Aug 14 23:56 Server_name_150814_0501.nmon
-rw-r--r-- 1 root system 1274818 Aug 15 23:56 Server_name_150815_0501.nmon
-rw-r--r-- 1 root system 1274343 Aug 16 23:56 Server_name_150816_0501.nmon
-rw-r--r-- 1 root system 1267154 Aug 17 23:56 Server_name_150817_0501.nmon
-rw-r--r-- 1 root system 1261666 Aug 18 23:56 Server_name_150818_0501.nmon
-rw-r--r-- 1 root system 1271660 Aug 19 23:56 Server_name_150819_0501.nmon
-rw-r--r-- 1 root system 1276864 Aug 20 23:56 Server_name_150820_0501.nmon
-rw-r--r-- 1 root system 1252339 Aug 21 23:56 Server_name_150821_0501.nmon
-rw-r--r-- 1 root system 1237846 Aug 22 23:56 Server_name_150822_0501.nmon
-rw-r--r-- 1 root system 1244332 Aug 23 23:56 Server_name_150823_0501.nmon
-rw-r--r-- 1 root system 202 Aug 24 00:01 skip
-rw-r--r-- 1 root system 625060 Aug 24 10:21 Server_name_150824_0501.nmon

But there are old files in the same server too, I have configured this on this Friday.

So, the script will not provide any real time values to us as a display? Is there any script for this?? Please provide your inputs on the same, thanks.

Re: Script to find nmon for AIX

Posted: Mon Aug 24, 2015 10:36 am
by ssax
Taken from the plugin page on the exchange:
A second script, nmond.pl, is included. It is intended to control the execution of nmon being run periodically for example as a cron job.
So it looks like you need to setup cron job to output the nmon files so that the plugin can read them, it's is not real-time.

Re: Script to find nmon for AIX

Posted: Mon Aug 24, 2015 10:40 am
by jdalrymple
The script is intended to run every 5 minutes via cron per the author. Nagios itself is not a realtime monitoring tool, it's a reactive alerting tool. You could certainly run the script from cron every minute, then run the check in Nagios every minute as well, then you would have either seconds old or up to 2 minutes old data depending on your luck.

Back to getting it to work, I'm not sure how the file names there are being generated, but I'd suggest changing it to something static. You can then pass that filename and path into the plugin with the -F argument it looks like.

Make sense?

Re: Script to find nmon for AIX

Posted: Mon Aug 24, 2015 10:42 am
by raamardhani7
to add to the above lines:

I just ran the script and the output is:

Is the script running fine?

./check_nmon -F /usr/local/nagios/libexec/check_nmon_disk.php -k DISKBUSY,DISKREAD,DISKWRITE,DISKXFER -s hdiskx
UNKNOWN - NMON file /usr/local/nagios/libexec/check_nmon_disk.php older than an hour. NMON is stopped!

./check_nmon -F /usr/local/nagios/libexec/check_nmon_cpu.php -k CPU_ID -s User%,Sys%,Wait%,Idl
UNKNOWN - NMON file /usr/local/nagios/libexec/check_nmon_cpu.php older than an hour. NMON is stopped!

./check_nmon -F /usr/local/nagios/libexec/check_nmon_hba.php -k IOADAPT -s fcsx_read-KB/s,fcsx_write-KB/s,fcsx_xfer-tps
UNKNOWN - NMON file /usr/local/nagios/libexec/check_nmon_hba.php older than an hour. NMON is stopped!

# ./check_nmon -F /usr/local/nagios/libexec/check_nmon_pag.php -k PAGE -s pgin,pgout,pgsin,pgsout
UNKNOWN - NMON file /usr/local/nagios/libexec/check_nmon_pag.php older than an hour. NMON is stopped!

nmon service on that server is running fine:

ps -ef | grep -i nmon
root 9699376 1 0 00:01:05 - 0:01 /usr/bin/topas_nmon -fdt -s 300 -A -m /etc/perf/nmon -G -I 0.1 -K -P -M -V -^ -l 150 -w 4 -youtput_dir=/etc/perf/nmon/server_name-ystart_time=00:01:05,Aug24,2015

Could you please advice on this. thanks

Re: Script to find nmon for AIX

Posted: Mon Aug 24, 2015 10:50 am
by jdalrymple
raamardhani7 wrote:./check_nmon -F /usr/local/nagios/libexec/check_nmon_disk.php -k DISKBUSY,DISKREAD,DISKWRITE,DISKXFER -s hdiskx
UNKNOWN - NMON file /usr/local/nagios/libexec/check_nmon_disk.php older than an hour. NMON is stopped!
This reads like you're running check_nmon from the Nagios server - this won't work.

You need to run the perl script nmond.pl on the AIX host. This will create the nmon spreadsheet file that you'll pass into the next script.
You then need to run check_nmon.pl using the -F argument to specify the file created in the prior step. This check_nmon.pl must be run via NRPE on the AIX host.

To my knowledge, nmon has no daemon mode where you can magically extract statistics across the network - I may be wrong however.

Re: Script to find nmon for AIX

Posted: Mon Aug 24, 2015 11:13 am
by raamardhani7
jdalrymple wrote:
raamardhani7 wrote:./check_nmon -F /usr/local/nagios/libexec/check_nmon_disk.php -k DISKBUSY,DISKREAD,DISKWRITE,DISKXFER -s hdiskx
UNKNOWN - NMON file /usr/local/nagios/libexec/check_nmon_disk.php older than an hour. NMON is stopped!
This reads like you're running check_nmon from the Nagios server - this won't work.

You need to run the perl script nmond.pl on the AIX host. This will create the nmon spreadsheet file that you'll pass into the next script.
You then need to run check_nmon.pl using the -F argument to specify the file created in the prior step. This check_nmon.pl must be run via NRPE on the AIX host.

To my knowledge, nmon has no daemon mode where you can magically extract statistics across the network - I may be wrong however.

Hi.. Thanks for your inputs..
I am running those commands on Remote server, not on Nagios server.
However I have changed the nmon_directory in that script. and ran the nmond.pl script.
==========================================================================================
Below is the output of nmon processes.

ps -ef | grep nmon | grep -v grep
root 9699376 1 0 00:01:05 - 0:01 /usr/bin/topas_nmon -fdt -s 300 -A -m /etc/perf/nmon -G -I 0.1 -K -P -M -V -^ -l 150 -w 4 -youtput_dir=/etc/perf/nmon/server_name -ystart_time=00:01:05,Aug24,2015
root 10748018 1 0 10:53:08 pts/0 0:00 /usr/bin/topas_nmon -F /etc/perf/nmonserver_name.nmon -t -S -P -V -s 60 -c 1500 -youtput_dir=/etc/perf/nmonserver_name.nmon -ystart_time=10:53:07,Aug24,2015

First pid is earlier one and the second pid is running after I executed the script. Is this going to make any difference, since 2 PID's running for nmon??
============================================================================

I have changed -F to the path where the nmon files are written and seems like the script is working.

# ./check_nmon -F /etc/perf/nmonserver_name.nmon -k CPU_ID -s User%,Sys%,Wait%,Idl
OK - All counters within specified thresholds
# ./check_nmon -F /etc/perf/nmonserver_name.nmon -k CPU_ID -s User%,Sys%,Wait%,Idl
OK - All counters within specified thresholds
# ./check_nmon -F /etc/perf/nmonserver_name.nmon -k PAGE -s pgin,pgout,pgsin,pgsout
OK - All counters within specified thresholds | PAGE[pgin]=0.0 PAGE[pgout]=0.9 PAGE[pgsin]=0.0 PAGE[pgsout]=0.0 root@server_name:/usr/local/nagios/libexec
# ./check_nmon -F /etc/perf/nmonserver_name.nmon -k NET,NETERROR -s en0-read-KB/s,en0-write-KB/s,en0-ierrs,en0-oerrs,en0-collisions
OK - All counters within specified thresholds
# ./check_nmon -F /etc/perf/nmonserver_name.nmon -k IOADAPT -s fcsx_read-KB/s,fcsx_write-KB/s,fcsx_xfer-tps
OK - All counters within specified thresholds
# ./check_nmon -F /etc/perf/nmonserver_name.nmon -k CPU_ID -s User%,Sys%,Wait%,Idl
OK - All counters within specified thresholds
# ./check_nmon -F /etc/perf/nmonserver_name.nmon -k MEM -s Real Free %,Virtual free %
OK - All counters within specified thresholds

Or Can you suggest any other script that I can use for nmon process? That would really help me.

Re: Script to find nmon for AIX

Posted: Mon Aug 24, 2015 11:30 am
by jdalrymple
What metrics exactly are you looking to extrapolate? I may not be able to suggest any better methods, but I might be able to suggest some of our more standardized methods.

Truth be told, it looks like you've got that working mostly now so you're almost all the way to successfully monitoring. The only components left really are the NRPE bits. You might be best serviced just continuing on down your current path.

Re: Script to find nmon for AIX

Posted: Mon Aug 24, 2015 1:25 pm
by raamardhani7
jdalrymple wrote:What metrics exactly are you looking to extrapolate? I may not be able to suggest any better methods, but I might be able to suggest some of our more standardized methods.

Truth be told, it looks like you've got that working mostly now so you're almost all the way to successfully monitoring. The only components left really are the NRPE bits. You might be best serviced just continuing on down your current path.
Hi Jdalrymple,

I need the basic AIX parameters to be monitored, client asked us to monitor performance of the server like nmon. this is the only requirement they shared, nothing in specific.
Please advise me, what best can I do to?

Thanks alot for your help all the while.. :)