check_nrpe CheckServiceState with spaces in service name

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
mwalpole
Posts: 7
Joined: Wed May 16, 2012 11:30 pm

check_nrpe CheckServiceState with spaces in service name

Post 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
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: check_nrpe CheckServiceState with spaces in service name

Post 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.
mwalpole
Posts: 7
Joined: Wed May 16, 2012 11:30 pm

Re: check_nrpe CheckServiceState with spaces in service name

Post by mwalpole »

Hi

I have also tried that and it also doesnt work.
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: check_nrpe CheckServiceState with spaces in service name

Post 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)
mwalpole
Posts: 7
Joined: Wed May 16, 2012 11:30 pm

Re: check_nrpe CheckServiceState with spaces in service name

Post by mwalpole »

I was running 3.40, Just upgraded to 3.41 and it fixed my issue.

Thanks so much for your help
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: check_nrpe CheckServiceState with spaces in service name

Post 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
mwalpole
Posts: 7
Joined: Wed May 16, 2012 11:30 pm

Re: check_nrpe CheckServiceState with spaces in service name

Post by mwalpole »

Yes all good now.

thanks
Locked