Page 1 of 1
Special charectors in Cluster Resource
Posted: Fri Dec 08, 2017 5:47 am
by bsivavani
Hi,
We are using cluster-resourcecheck.ps1 script to Monitor the Cluster resources. We were able to monitor all resources except the resource name "PNOM Submission (Elexon & National Grid)". I think because of & symbol in resource name.
We were receiving below error
[nagios@s930lXXXX ~]$ /usr/local/nagios/libexec/check_nrpe -H CLUSTERNODE -p 5666 -t 60 -c check_mscs_resource -a "'PNOM Submission (Elexon & National Grid)'" "CLUSTERNODE"
The command (check_mscs_resource) returned an invalid return code: 255
[nagios@s930lXXXX ~]$
Kindly advice on how to bypass & symbol ?
Re: Special charectors in Cluster Resource
Posted: Fri Dec 08, 2017 11:03 am
by npolovenko
Hello,
@bsivavani. Are you using NSClient? You may enable the following option in nsclient.ini:
allow nasty characters = true.
"|`&><'\\[]{};\r\n" All these characters are not allowed in NRPE, and there's not much that can be done besides hardcoding the part of the argument with a special character inside the command itself. Or creating a separate command with everything hardcoded for this particular cluster resource.
Let me know if you need help with that. I'd need to see your current command definition.
Re: Special charectors in Cluster Resource
Posted: Fri Dec 08, 2017 12:25 pm
by bsivavani
Hi,
I created the command and called from service, but still seeing the error.
Command Definition
$USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -t 60 -c check_mscs_resource -a "PNOM Submission (Elexon & National Grid)" "S988A3000"
Service Definition
/usr/local/nagios/libexec/check_nrpe -H XXXX -p 5666 -t 60 -c check_mscs_resource -a "PNOM Submission (Elexon & National Grid)" "XXXX"
OUTPUT: The command (check_mscs_resource) returned an invalid return code: 255
Re: Special charectors in Cluster Resource
Posted: Fri Dec 08, 2017 1:10 pm
by npolovenko
@bsivavani, You'd need to modify the command on the monitored computer side. Basically, you can't pass any special characters through nrpe but you can hardcode the whole command in nsclint.ini file. In nsclient.ini file please search for "check_mscs_resource". Please post the whole command.
Re: Special charectors in Cluster Resource
Posted: Fri Dec 15, 2017 12:14 pm
by bsivavani
Thank You. I am able to resolve this issue.
Please close the request.
Re: Special charectors in Cluster Resource
Posted: Fri Dec 15, 2017 12:52 pm
by kyang
Sounds good! I'll be closing this thread!
If you have any more questions, feel free to create another thread.
Thanks for using the Nagios Support Forum!