Page 1 of 1
check_nrpe CheckCounter
Posted: Thu Jun 05, 2014 9:02 am
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)
Re: check_nrpe CheckCounter
Posted: Thu Jun 05, 2014 11:37 am
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
Re: check_nrpe CheckCounter
Posted: Fri Jun 06, 2014 6:27 am
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
Re: check_nrpe CheckCounter
Posted: Fri Jun 06, 2014 9:09 am
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.
Re: check_nrpe CheckCounter
Posted: Fri Jun 06, 2014 10:09 am
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$
Re: check_nrpe CheckCounter
Posted: Fri Jun 06, 2014 10:13 am
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
Re: check_nrpe CheckCounter
Posted: Fri Jun 06, 2014 10:18 am
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
Re: check_nrpe CheckCounter
Posted: Fri Jun 06, 2014 10:33 am
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.
Re: check_nrpe CheckCounter
Posted: Fri Jun 06, 2014 12:23 pm
by hanya.radwan
greate it is Ok after use double qutes
Re: check_nrpe CheckCounter
Posted: Fri Jun 06, 2014 12:37 pm
by sreinhardt
Awesome! I will lock this up then.