Page 3 of 3

Re: how to check server resource using check_nmon.pl

Posted: Thu Feb 25, 2021 2:37 am
by sacom01
hi tgriep,
this is log show on ncpa_listener.log

2021-02-25 14:32:53,299 15206354 INFO ::ffff:192.168.xxx.xxx - - [2021-02-25 14:32:53] "GET /api/plugins/check_nmon.pl/?token=mytoken&check=1&args=-F+%2Fbackup%2Fnmon_log%2Fsrv_210225_0600.nmon&args=-k+%27CPU_ID%27&args=-s+%27User%25%2CSys%25%2CWait%25%2CIdl%27 HTTP/1.1" 200 307 0.650848

The result is OK when run on nagios xi:

[root@-nagiosxi-libexec]# /usr/local/nagios/libexec/check_ncpa.py -H 192.168.xxx.x -P 5693 -t mytoken -M 'plugins/check_nmon.pl' -q "args=-F "/backup/nmon_log/srv_210225_0600.nmon",args=-k 'CPU_ID',args=-s 'User%,Sys%,Wait%,Idl'"
OK - All counters within specified thresholds |

it just do not understand "datetime" (210225) when we specify "datetime" as an argument on web.

Re: how to check server resource using check_nmon.pl

Posted: Thu Feb 25, 2021 4:33 pm
by ssax
This is working on mine:

Code: Select all

$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'"

Code: Select all

define service {
    host_name                TEST
    service_description      TEST_copy_1
    use                      xiwizard_ncpa_service
    check_command            check_nmon_CPU_!5693!mytoken!210201!!!!!
It's pulling $ARG3$ properly and putting that into the filename.

You could also change your command to this to make it use today's date if that's what you're trying to do:
- NOTE: The Run Check Command button will fail on this, apply configuration and force a check and it should work

Code: Select all

$USER1$/check_ncpa.py -H $HOSTADDRESS$ -P $ARG1$ -t $ARG2$ -M 'plugins/check_nmon.pl' -q "args=-F "/backup/mon_log/ho_t24as_06_`date +"%y%m%d"`_0600.nmon",args=-k 'CPU_ID',args=-s 'User%,Sys%,Wait%,Idl'" 
If you are still having issues, please PM me a FRESH copy of your profile.zip so I can see how everything is currently configured, you can download it from Admin > System Profile by clicking the Download Profile button.

Thank you!

Re: how to check server resource using check_nmon.pl

Posted: Sat Feb 27, 2021 11:16 pm
by sacom01
hi ssax, tgriep,
it's work fine now with `date +"%y%m%d"` argument.
Pls close the topic.
Many thanks for your support.

Re: how to check server resource using check_nmon.pl

Posted: Mon Mar 01, 2021 8:14 am
by scottwilkerson
sacom01 wrote:hi ssax, tgriep,
it's work fine now with `date +"%y%m%d"` argument.
Pls close the topic.
Many thanks for your support.
Locking thread