Page 1 of 1

check_nrpe CheckServiceState with spaces in service name

Posted: Thu May 17, 2012 1:19 am
by mwalpole
Hi

I am trying to monitor all services that are set to automatic, but I need to exclude a few services. These services contain spaces. Below are the command I am using:

define command{
command_name check_service
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckServiceState -a CheckAll "exclude=NetBackup Device Manager"
}

This is sending the command wrong and splitting the service name up:

7 15:57:40: debug:NSClient++.cpp:1144: Injecting: CheckServiceState: CheckAll, exclude=NetBackup, Device, Manager"

Could somebody please help ?

Thanks

Re: check_nrpe CheckServiceState with spaces in service name

Posted: Thu May 17, 2012 6:30 pm
by jsmurphy
There doesn't appear to be anything wrong with what you've defined so it's curious as to why it's behaving like that... as a side note I normally define mine like:

command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckServiceState -a CheckAll exclude="NetBackup Device Manager"

It shouldn't matter but you can see if that helps.

Re: check_nrpe CheckServiceState with spaces in service name

Posted: Thu May 17, 2012 9:06 pm
by mwalpole
Hi

I have also tried that and it also doesnt work.

Re: check_nrpe CheckServiceState with spaces in service name

Posted: Thu May 17, 2012 10:21 pm
by jsmurphy
Which version of Nagios are you running? There's been a few issues kicking around regarding NRPE and Nagios 3.4.0 and the advice so far has been to update to Nagios 3.4.1... which might solve your problem:

3.4.1 - 05/11/2012
FIXES
Double quotes in check_command definition break functionality (#332, reverts #86)

Re: check_nrpe CheckServiceState with spaces in service name

Posted: Thu May 17, 2012 11:17 pm
by mwalpole
I was running 3.40, Just upgraded to 3.41 and it fixed my issue.

Thanks so much for your help

Re: check_nrpe CheckServiceState with spaces in service name

Posted: Thu May 17, 2012 11:32 pm
by jsmurphy
I'm guessing that fixed your issue in the other thread as well? Sorry I misunderstood your question there! Glad that helped :D

Re: check_nrpe CheckServiceState with spaces in service name

Posted: Sun May 20, 2012 6:39 pm
by mwalpole
Yes all good now.

thanks