Hello All,
I have been trying to use the NRPE CheckCounter in my Nagios 3.2 setup . What i am trying to do is create a command definition that would accept an Counter parameter as follows:
define command{
command_name check_nrpe_win_counter
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckCounter -a "Counter=$ARG1$" ShowAll MaxWarn=$ARG2$ MaxCrit=$ARG3$
}
then define a service as:
define service{
use generic-service
host MyHost
check_command check_nrpe_win_counter!"\Paging File(_Total)\% Usage"!80%!90%
}
After using this all i get is "CRIT: Counter not found" error.
I am able to use the command from command line.
Also if a create the command definition directly without using the counter parameter (i.e instead of "Counter=$ARG1$" i directly define "Counter=\Paging File(_Total)\% Usage") as argument then it works fine, but then i would have to create n no of command definitions for n no of counter values which i dont want to do.
Please can some one give me the exact syntax.
Thanks in Advance
Ethan
Syntax Needed for NRPE CheckCounter with Service Definition
-
- Posts: 4
- Joined: Thu Apr 07, 2011 8:19 am
-
- Posts: 1128
- Joined: Wed Mar 03, 2010 12:38 pm
- Location: St. Paul, MN, USA
- Contact:
Re: Syntax Needed for NRPE CheckCounter with Service Definit
Try using single quotes in your service definition, eg.
check_command check_nrpe_win_counter!'\Paging File(_Total)\% Usage'!80%!90%
check_command check_nrpe_win_counter!'\Paging File(_Total)\% Usage'!80%!90%
-
- Posts: 4
- Joined: Thu Apr 07, 2011 8:19 am
Re: Syntax Needed for NRPE CheckCounter with Service Definit
I have modified the above command as following, and now they are working fine
define command{
command_name check_nrpe_win_counter
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckCounter -a $ARG1$ ShowAll MaxWarn=$ARG2$ MaxCrit=$ARG3$
}
then define a service as:
define service{
use generic-service
host MyHost
check_command check_nrpe_win_counter!"\\Paging File(_Total)\\% Usage"!80%!90%
}
Note: We need to add double back slashes instead of single, and use double quotes!!
define command{
command_name check_nrpe_win_counter
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckCounter -a $ARG1$ ShowAll MaxWarn=$ARG2$ MaxCrit=$ARG3$
}
then define a service as:
define service{
use generic-service
host MyHost
check_command check_nrpe_win_counter!"\\Paging File(_Total)\\% Usage"!80%!90%
}
Note: We need to add double back slashes instead of single, and use double quotes!!
Re: Syntax Needed for NRPE CheckCounter with Service Definit
Ahhh good to know and thank you for the update, very helpful