Page 1 of 1

CheckNRPE CheckServiceState with Exclusions including Spaces

Posted: Wed May 16, 2012 11:55 pm
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.

Re: CheckNRPE CheckServiceState with Exclusions including Sp

Posted: Thu May 17, 2012 6:25 pm
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

Re: CheckNRPE CheckServiceState with Exclusions including Sp

Posted: Thu May 17, 2012 9:43 pm
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"

Re: CheckNRPE CheckServiceState with Exclusions including Sp

Posted: Thu May 17, 2012 10:00 pm
by jsmurphy
Re-read my reply, very carefully ;) you missed a very important part of it.

Re: CheckNRPE CheckServiceState with Exclusions including Sp

Posted: Thu May 17, 2012 10:51 pm
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.