Page 2 of 3
Re: how to check server resource using check_nmon.pl
Posted: Thu Feb 04, 2021 9:19 pm
by sacom01
hi tgriep,
First thing, because of the quotes, escaping, etc that the plugin is setup to use, sometimes it causes the Run Check Command button to fail as it adds extra escaping to the check. --> it work fine with exact path bro.
i have tried as your suggest, filled 210205 to $ARG3$ and facing UNKNOWN - NMON file 210205 does not exist.
$USER1$/check_ncpa.py -H $HOSTADDRESS$ -P $ARG1$ -t $ARG2$ -M 'plugins/check_nmon.pl' -q "args=-F "/backup/mon_log/$ARG3$",args=-k 'CPU_ID',args=-s 'User%,Sys%,Wait%,Idl'"
bash-4.3# cd /backup/nmon_log/
bash-4.3# ls -l | grep 210205
-rwxr-xr-x 1 root system 1088427 Feb 05 09:18 svr_210205_0600.nmon
I think due to the file name not only 210205, but name svr_210205_0600.nmon.
Do we have anyway to fix "srv_" and "_0600.nmon" character, just argument with "210205"?
Note : i tried filled exact file name svr_210205_0600.nmon on $ARG3$ but getting this "UNKNOWN - NMON file /backup/mon_log/srv_210205_0600.nmon does not exist." --> seem the command is wrong, pls review the command.
Re: how to check server resource using check_nmon.pl
Posted: Fri Feb 05, 2021 2:13 pm
by tgriep
Login to the XI GUI and go to the Core Config Manager > Services menu.
Click on the View Config icon (On the right side of the menu) copy the config data for the nmon service in to a text document and post that here so I can view the settings.
Also, copy the full command line settings for the NCPA command that was created in the Core Config Manager > Commands menu and post it here.
It looks like there may be parts of filename missing.
Re: how to check server resource using check_nmon.pl
Posted: Sun Feb 07, 2021 10:36 pm
by sacom01
hi bro,
very sure about nmon file exist in /backup/mon_log/ folder.
Command line :
$USER1$/check_ncpa.py -H $HOSTADDRESS$ -P $ARG1$ -t $ARG2$ -M 'plugins/check_nmon.pl' -q "args=-F "/backup/mon_log/svr_$ARG3$_0600.nmon",args=-k 'CPU_ID',args=-s 'User%,Sys%,Wait%,Idl'"
Re: how to check server resource using check_nmon.pl
Posted: Mon Feb 08, 2021 10:07 am
by tgriep
What version of Nagios XI is the server running?
What version of NCPA are you running on the remote server?
What OS and release is the remove server running?
Login as root on the remote server, get the ncpa_listener log file from the following location and post it here.
Code: Select all
/usr/local/ncpa/var/log/ncpa_listener.log
Login to the nagios server as root, run the following commands and post the output here.
Code: Select all
grep -i nmon /usr/local/nagios/etc/commands.cfg
/usr/local/nagios/libexec/check_ncpa.py -V
Re: how to check server resource using check_nmon.pl
Posted: Wed Feb 17, 2021 8:29 pm
by sacom01
hi tgriep,
Output :
[root@nagiosxi libexec]# cat /usr/local/nagiosxi/var/xiversion|grep full
full=5.7.3
[root@nagiosxi libexec]# /usr/local/nagios/libexec/check_ncpa.py -H 192.168.xxx.x -t 'mytoken' -P 5693 -M system/agent_version
OK: Agent_version was ['2.2.1']
bash-4.3$ oslevel -s
AIX 7200-00-01-1543
[root@nagiosxi libexec]# grep -i nmon /usr/local/nagios/etc/commands.cfg
command_name check-nmon_cpu
command_line $USER1$/check_ncpa.py -H $HOSTADDRESS$ -P $ARG1$ -t $ARG2$ -M 'plugins/check_nmon.pl' -q "args=-F "/backup/mon_log/ho_t24as_06_$ARG3$_0600.nmon",args=-k 'CPU_ID',args=-s 'User%,Sys%,Wait%,Idl'"
command_name check_nmon_CPU_
command_line $USER1$/check_ncpa.py -H $HOSTADDRESS$ -P $ARG1$ -t $ARG2$ -M 'plugins/check_nmon.pl' -q "args=-F "/backup/mon_log/ho_t24as_06_$ARG3$_0600.nmon",args=-k 'CPU_ID',args=-s 'User%,Sys%,Wait%,Idl'"
[root@nagiosxi libexec]#
[root@nagiosxi libexec]#
[root@nagiosxi libexec]# /usr/local/nagios/libexec/check_ncpa.py -V
check_ncpa.py, Version 1.2.3
[root@nagiosxi libexec]#
Re: how to check server resource using check_nmon.pl
Posted: Thu Feb 18, 2021 11:25 am
by tgriep
The following is an entry from the ncpa_listener.log file and it does show the fill path and filename in the command.
Code: Select all
2021-02-18 08:25:09,713 15206352 INFO ::ffff:192.168.xxx.xxx - - [2021-02-18 08:25:09] "GET /api/plugins/check_nmon.pl/?token=mytoken&check=1&args=-F+%2Fbackup%2Fmon_log%2Fho_t24as_06_210205_0600.nmon&args=-k+%27CPU_ID%27&args=-s+%27User%25%2CSys%25%2CWait%25%2CIdl%27 HTTP/1.1" 200 341 0.115436
See this.
Code: Select all
%2Fbackup%2Fmon_log%2Fho_t24as_06_210205_0600.nmon
Because it is an API call, some characters have to be replaced like the forward slash / with %2F which is normal.
Everything looks correct.
I don't have access to an AIX server to test this out but is looks like the arguments are not getting passed to the plugin.
Do this, edit the napa.cfg file and under the [listener] section, change the loglevel from
to
Save the change and restart the ncpa_listener.
Run the check again from the nagios server and see what the command line is being sent to the plugin.
Re: how to check server resource using check_nmon.pl
Posted: Thu Feb 18, 2021 9:20 pm
by sacom01
hi tgriep,
the command show like below and the service status is UNKNOWN as well.
2021-02-19 09:18:11,851 15206354 INFO ::ffff:192.168.xxx.xxx - - [2021-02-19 09:18:11] "GET /api/plugins/check_nmon.pl/?token=mytoke
n&check=1&args=-F+%2Fbackup%2Fmon_log%2Fho_t24as_06_210219_0600.nmon&args=-k+%27CPU_ID%27&args=-s+%27User%25%2CSys%25%2CWait%25%2CId
l%27 HTTP/1.1" 200 341 0.085304
Re: how to check server resource using check_nmon.pl
Posted: Fri Feb 19, 2021 11:30 am
by tgriep
When debug was enabled for the listener, do you see a line similar to the following in the ncpa_listener log file?
Code: Select all
2021-02-19 10:20:17,648 1340 DEBUG Running process with command line: `/usr/local/ncpa/plugins/check_nmon.pl -F /var/log/test -k CPU_ID -s User%,Sys%,Wait%,Idl`
If so, post it so I can see it or post the full file after it is ziped up.
Re: how to check server resource using check_nmon.pl
Posted: Mon Feb 22, 2021 10:35 pm
by sacom01
hi tgriep,
dont see any DEBUG log, just INFO like i posted.
Re: how to check server resource using check_nmon.pl
Posted: Wed Feb 24, 2021 11:57 am
by ssax
Please try this instead:
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H X.X.X.X -P 5693 -t 'mytoken' -M 'plugins/check_nmon.pl' -a "-F '/backup/nmon_log/srv_210201_0600.nmon' -k CPU_ID -s 'User%,Sys%,Wait%,Idl'"