how to check server resource using check_nmon.pl
Re: how to check server resource using check_nmon.pl
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.
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.
You do not have the required permissions to view the files attached to this post.
Re: how to check server resource using check_nmon.pl
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.
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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: how to check server resource using check_nmon.pl
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'"
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'"
You do not have the required permissions to view the files attached to this post.
Re: how to check server resource using check_nmon.pl
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.
Login to the nagios server as root, run the following commands and post the output here.
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.logCode: Select all
grep -i nmon /usr/local/nagios/etc/commands.cfg
/usr/local/nagios/libexec/check_ncpa.py -VBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: how to check server resource using check_nmon.pl
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]#
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]#
You do not have the required permissions to view the files attached to this post.
Re: how to check server resource using check_nmon.pl
The following is an entry from the ncpa_listener.log file and it does show the fill path and filename in the command.
See this.
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.
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.115436Code: Select all
%2Fbackup%2Fmon_log%2Fho_t24as_06_210205_0600.nmonEverything 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
Code: Select all
loglevel = infoCode: Select all
loglevel = debugRun the check again from the nagios server and see what the command line is being sent to the plugin.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: how to check server resource using check_nmon.pl
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
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
When debug was enabled for the listener, do you see a line similar to the following in the ncpa_listener log file?
If so, post it so I can see it or post the full file after it is ziped up.
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`Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: how to check server resource using check_nmon.pl
hi tgriep,
dont see any DEBUG log, just INFO like i posted.
dont see any DEBUG log, just INFO like i posted.
Re: how to check server resource using check_nmon.pl
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'"