'Servicename': Not found error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

'Servicename': Not found error

Post by RIDS_I2MP »

Hello,

We are getting 'Servicename': Not found error in one of our servers.
We did test check command in service, it is working fine.
Also we crosschecked it using putty where also it is working fine(PFB output)-
[nagios@nagiosserver libexec]$ ./check_nt -H remoteserver -s "password" -p 12489 -v SERVICESTATE -l 'Servicename' -d SHOWALL
Servicename: Started

Please let us know why we are getting 'Servicename': Not found error in Nagios GUI.
Thanks & Regards,
I2MP Team.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: 'Servicename': Not found error

Post by scottwilkerson »

does servicename contain any non-alpha chars?

Can you share the config from the CCM for this service?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Re: 'Servicename': Not found error

Post by RIDS_I2MP »

Hello Scott,

I've attached the configs.

Thanks!
You do not have the required permissions to view the files attached to this post.
Thanks & Regards,
I2MP Team.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: 'Servicename': Not found error

Post by scottwilkerson »

The $ is going to need special escaping

See this article
https://support.nagios.com/kb/article/n ... s-580.html
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Re: 'Servicename': Not found error

Post by RIDS_I2MP »

I referred the KB, but the backslash did not help. I noticed when I run the 'Test Check Command' it takes the backslash on it's own, you can find it in the snapshot attached.
You do not have the required permissions to view the files attached to this post.
Thanks & Regards,
I2MP Team.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: 'Servicename': Not found error

Post by scottwilkerson »

That looks like you got a proper response.

In this post the backslash wasn't present
https://support.nagios.com/forum/viewto ... 35#p252147
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Re: 'Servicename': Not found error

Post by RIDS_I2MP »

Although I am getting a proper response in the Test Check Command, the error is not resolved yet. The service still shows critical. I am attaching the Service config from CCM, the result of Test Check Command and the Error I get on the service.
You do not have the required permissions to view the files attached to this post.
Thanks & Regards,
I2MP Team.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: 'Servicename': Not found error

Post by scottwilkerson »

In $ARG3$ change

Code: Select all

$
to

Code: Select all

\$
the test command performs some escaping that may not allow the "real" command to run. this is required to prevent command injection form apache although the command may run correct once nagios is executing it.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
sac1472
Posts: 66
Joined: Thu May 25, 2017 5:06 am

Re: 'Servicename': Not found error

Post by sac1472 »

Hey,

You should use single quotation for SQL service names.

In your case ARG3 would be -
-l 'SQLAgent$REMEA_LANDESK' or -l 'SQLAgent$REMEA_LANDESK' -d SHOWALL

Try both and let us know the result. :)
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: 'Servicename': Not found error

Post by scottwilkerson »

sac1472 wrote:In your case ARG3 would be -
-l 'SQLAgent$REMEA_LANDESK' or -l 'SQLAgent$REMEA_LANDESK' -d SHOWALL
Yes this can work also, but it all depends on how the command is configured.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked