Special charector in Cluster resouce
Special charector in Cluster resouce
Hi,
We are trying to monitor cluster service which is having special character & in the service PNOM Submission (Elexon & National Grid).
We are able to run the service from command line, but getting the below error when running from console.
The command (check_mscs_resource) returned an invalid return code: 255
From command Line
[root@XXXX ~]# /usr/local/nagios/libexec/check_nrpe -H XXXX -p 5666 -t 30 -c check_mscs_resource -a '"TESTPNOMMO TESTSubmission (ElexonWQ & Nationall Grid)" "XXXX"'
TESTPNOMMO TESTSubmission (ElexonWQ & Nationall Grid) is Online, Owner is XXXX - PNOM Submissionkk Elexonnh, ResoureType is Generic Service
[root@XXXX ~]#
Kindly advice if we can escape & symbol ?
We are trying to monitor cluster service which is having special character & in the service PNOM Submission (Elexon & National Grid).
We are able to run the service from command line, but getting the below error when running from console.
The command (check_mscs_resource) returned an invalid return code: 255
From command Line
[root@XXXX ~]# /usr/local/nagios/libexec/check_nrpe -H XXXX -p 5666 -t 30 -c check_mscs_resource -a '"TESTPNOMMO TESTSubmission (ElexonWQ & Nationall Grid)" "XXXX"'
TESTPNOMMO TESTSubmission (ElexonWQ & Nationall Grid) is Online, Owner is XXXX - PNOM Submissionkk Elexonnh, ResoureType is Generic Service
[root@XXXX ~]#
Kindly advice if we can escape & symbol ?
Re: Special charector in Cluster resouce
Have you tested the script on a resource that doesn't contain a & ?
The results seen on the command line are not the return code. To see the return code you should run "echo $?" right after running the check. I would also recommend running the command as nagios:
The results seen on the command line are not the return code. To see the return code you should run "echo $?" right after running the check. I would also recommend running the command as nagios:
Code: Select all
su - naiogs
/usr/local/nagios/libexec/check_nrpe -H XXXX -p 5666 -t 30 -c check_mscs_resource -a '"TESTPNOMMO TESTSubmission (ElexonWQ & Nationall Grid)" "XXXX"'
echo $?As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
SteveBeauchemin
- Posts: 524
- Joined: Mon Oct 14, 2013 7:19 pm
Re: Special charector in Cluster resouce
Maybe this post will help. The ! character is special too.
https://support.nagios.com/forum/viewto ... 16&t=53995
Steve B
https://support.nagios.com/forum/viewto ... 16&t=53995
Steve B
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
Re: Special charector in Cluster resouce
@bsivavani, let us know once you've had a chance to test the suggested options.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Special charector in Cluster resouce
@cdienger - The script is working fine with the other services which doesn't have & symbol.
I tried running the service from command line with nagios user and it is working. The result of echo $? output is 0.
Issue is when we run from Nagios console.
@SteveBeauchemin - We have added & symbol in resource.cfg, but still & symbol is not resolving.
Kindly advice ?
I tried running the service from command line with nagios user and it is working. The result of echo $? output is 0.
Issue is when we run from Nagios console.
@SteveBeauchemin - We have added & symbol in resource.cfg, but still & symbol is not resolving.
Kindly advice ?
Re: Special charector in Cluster resouce
I'm not able to reproduce - can you provide a copy of the check_mscs_resource plugin as well as a copy of the nsclient.log after reproducing the problem?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Special charector in Cluster resouce
Please find attached requested files.
You do not have the required permissions to view the files attached to this post.
Re: Special charector in Cluster resouce
Let's also get the nsclient.ini and a screenshot of the plugin's settings as seen in the CCM.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Special charector in Cluster resouce
Please close the request.
I am able to fix the issue after hard coding the resource name directly in script.
I am able to fix the issue after hard coding the resource name directly in script.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Special charector in Cluster resouce
great!bsivavani wrote:Please close the request.
I am able to fix the issue after hard coding the resource name directly in script.
Locking