how to check server resource using check_nmon.pl

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
sacom01
Posts: 194
Joined: Wed Dec 23, 2020 10:15 pm

Re: how to check server resource using check_nmon.pl

Post 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.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: how to check server resource using check_nmon.pl

Post 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!
sacom01
Posts: 194
Joined: Wed Dec 23, 2020 10:15 pm

Re: how to check server resource using check_nmon.pl

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: how to check server resource using check_nmon.pl

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked