CheckNRPE CheckServiceState with Exclusions including Spaces

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

CheckNRPE CheckServiceState with Exclusions including Spaces

Post by mwalpole »

Hi

I am having issue excluding services including spaces using check_nrpe.

If I use, everything works ok:

define command{
command_name check_service
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckServiceState -a CheckAll exclude=$ARG1$
}
check_command check_disk!LanmanServer

But as soon as I change to:

define command{
command_name check_service
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckServiceState -a CheckAll "exclude=$ARG1$"
}
check_command check_disk!ManageEngine AssetExplorer Agent

I get this error:

Could not construct return packet in NRPE handler check client side (nsclient.log) logs...

Could someone please help I have read all the documentations, and I am sure I have the right syntax.

Thanks in advance.
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: CheckNRPE CheckServiceState with Exclusions including Sp

Post by jsmurphy »

The exclude statement only accepts one service per exclude declaration. So this is probably better:

define command{
command_name check_service
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckServiceState -a CheckAll $ARG1$
}
check_command check_disk!exclude=ManageEngine exclude=AssetExplorer exclude=Agent
mwalpole
Posts: 7
Joined: Wed May 16, 2012 11:30 pm

Re: CheckNRPE CheckServiceState with Exclusions including Sp

Post by mwalpole »

Thanks for The Reply:

I changed to:

define command{
command_name check_service
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckServiceState -a CheckAll $ARG1$
}
check_command check_disk!exclude="ManageEngine AssetExplorer Agent"

The problem is now that its slitting the service same into words, instead of just sending whole string.

This is what it's doing.

2012-05-18 12:38:54: debug:NSClient++.cpp:1144: Injecting: CheckServiceState: CheckAll, exclude="ManageEngine, AssetExplorer , Agent"
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: CheckNRPE CheckServiceState with Exclusions including Sp

Post by jsmurphy »

Re-read my reply, very carefully ;) you missed a very important part of it.
mwalpole
Posts: 7
Joined: Wed May 16, 2012 11:30 pm

Re: CheckNRPE CheckServiceState with Exclusions including Sp

Post by mwalpole »

I understand that you can only use one exclude statement.

In this exable the actual service name is "ManageEngine AssetExplorer Agent"

Not three different services.
Locked