check_nrpe CheckCounter

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
hanya.radwan
Posts: 194
Joined: Tue Feb 25, 2014 6:12 am
Location: palestine

check_nrpe CheckCounter

Post by hanya.radwan »

hi,

at Nagios 2014 R 1.0, paging file service is failed as the following:-

COMMAND: /usr/local/nagios/libexec/check_nrpe -H 10.100.20.194 -t 120 -c CheckCounter -a 'Counter=\\\\Paging File\(_Total\)\\\\% Usage' MaxWarn=85 MaxCrit=95 ShowAll
OUTPUT: CRIT: Counter not found: \\\\Paging File\(_Total\)\\\\% Usage: Unable to connect to specified machine or machine is off line. (800007D0)
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_nrpe CheckCounter

Post by scottwilkerson »

The "Test Command" feature in the CCM will not work in all cases (especially extreme escaping required with performance counters), it is there for simple testing. Also, you should have " instead of ' around the arguments

Can you run the following from the XI command line?

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 10.100.20.194 -t 120 -c CheckCounter -a "Counter=\\Paging File(_Total)\\% Usage" MaxWarn=85 MaxCrit=95 ShowAll
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
hanya.radwan
Posts: 194
Joined: Tue Feb 25, 2014 6:12 am
Location: palestine

Re: check_nrpe CheckCounter

Post by hanya.radwan »

it gives the following error from nagiosxi:

CRIT: Counter not found: \\Paging File(_Total)\\% Usage: Unable to connect to specified machine or machine is off line. (800007D0)

and when run command from nagios server, gives the following result:
[root@nms ~]# /usr/local/nagios/libexec/check_nrpe -H 10.100.20.194 -t 120 -c CheckCounter -a "Counter=\\Paging File(_Total)\\% Usage" MaxWarn=85 MaxCrit=95 ShowAll
OK: \Paging File(_Total)\% Usage: 16.1407|'\Paging File(_Total)\% Usage'=16.140747;85;95
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_nrpe CheckCounter

Post by scottwilkerson »

So from the command line it is working correctly.

Can you show us the command definition as well as what you have in $ARGn$ for the service.

This should allow us to help you adjust it down to the correct settings.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
hanya.radwan
Posts: 194
Joined: Tue Feb 25, 2014 6:12 am
Location: palestine

Re: check_nrpe CheckCounter

Post by hanya.radwan »

define service {
service_description Page File Usage
use xiwizard_nrpe_service
hostgroup_name RBT
servicegroups ALL
check_command check_nrpe!CheckCounter!-a 'Counter=\\Paging File(_Total)\\% Usage' MaxWarn=85 MaxCrit=95 ShowAll!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
first_notification_delay 0
notification_period xi_timeperiod_24x7
notification_options w,c,u,r,f,s,
notifications_enabled 1
contact_groups RBT
_xiwizard windowsserver
register 1
}

and this the command :$USER1$/check_nrpe -H $HOSTADDRESS$ -t 120 -c $ARG1$ $ARG2$
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: check_nrpe CheckCounter

Post by sreinhardt »

The only real difference I see between your commands is the use of double quotes in your cli execution, and single quotes in the command definition. While I don't feel it should make a difference, let's try running it from command line the other way as well. Please return the output of these two commands:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 10.100.20.194 -t 120 -c CheckCounter -a "Counter=\\Paging File(_Total)\\% Usage" MaxWarn=85 MaxCrit=95 ShowAll
/usr/local/nagios/libexec/check_nrpe -H 10.100.20.194 -t 120 -c CheckCounter -a 'Counter=\\Paging File(_Total)\\% Usage' MaxWarn=85 MaxCrit=95 ShowAll
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
hanya.radwan
Posts: 194
Joined: Tue Feb 25, 2014 6:12 am
Location: palestine

Re: check_nrpe CheckCounter

Post by hanya.radwan »

[root@nms ~]# /usr/local/nagios/libexec/check_nrpe -H 10.100.20.194 -t 120 -c CheckCounter -a 'Counter=\\Paging File(_Total)\\% Usage' MaxWarn=85 MaxCrit=95 ShowAll]
CRIT: Counter not found: \\Paging File(_Total)\\% Usage: Unable to connect to specified machine or machine is off line. (800007D0)

[root@nms ~]# /usr/local/nagios/libexec/check_nrpe -H 10.100.20.194 -t 120 -c CheckCounter -a "Counter=\\Paging File(_Total)\\% Usage" MaxWarn=85 MaxCrit=95 ShowAll
OK: \Paging File(_Total)\% Usage: 16.2727|'\Paging File(_Total)\% Usage'=16.272736;85;95
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: check_nrpe CheckCounter

Post by sreinhardt »

Is your machine having network issues or something? I would have expected to see an error relating to not finding the performance counter, not that your machine is offline. If the top command repeatedly fails, and the bottom one repeatedly works, let us know, but I would suggest trying them both a few times and making sure that the offline error is not specific to single quotes.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
hanya.radwan
Posts: 194
Joined: Tue Feb 25, 2014 6:12 am
Location: palestine

Re: check_nrpe CheckCounter

Post by hanya.radwan »

greate it is Ok after use double qutes
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: check_nrpe CheckCounter

Post by sreinhardt »

Awesome! I will lock this up then.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked