Special charector in Cluster resouce

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
bsivavani
Posts: 339
Joined: Tue Oct 06, 2015 9:17 am

Special charector in Cluster resouce

Post by bsivavani »

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 ?
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Special charector in Cluster resouce

Post by cdienger »

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:

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

Post by SteveBeauchemin »

Maybe this post will help. The ! character is special too.

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
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Special charector in Cluster resouce

Post by cdienger »

@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.
bsivavani
Posts: 339
Joined: Tue Oct 06, 2015 9:17 am

Re: Special charector in Cluster resouce

Post by bsivavani »

@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 ?
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Special charector in Cluster resouce

Post by cdienger »

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.
bsivavani
Posts: 339
Joined: Tue Oct 06, 2015 9:17 am

Re: Special charector in Cluster resouce

Post by bsivavani »

Please find attached requested files.
You do not have the required permissions to view the files attached to this post.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Special charector in Cluster resouce

Post by cdienger »

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.
bsivavani
Posts: 339
Joined: Tue Oct 06, 2015 9:17 am

Re: Special charector in Cluster resouce

Post by bsivavani »

Please close the request.

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

Post by scottwilkerson »

bsivavani wrote:Please close the request.

I am able to fix the issue after hard coding the resource name directly in script.
great!

Locking
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked