Page 1 of 2

'Servicename': Not found error

Posted: Thu May 17, 2018 7:43 am
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.

Re: 'Servicename': Not found error

Posted: Thu May 17, 2018 9:26 am
by scottwilkerson
does servicename contain any non-alpha chars?

Can you share the config from the CCM for this service?

Re: 'Servicename': Not found error

Posted: Wed May 23, 2018 1:29 am
by RIDS_I2MP
Hello Scott,

I've attached the configs.

Thanks!

Re: 'Servicename': Not found error

Posted: Wed May 23, 2018 7:20 am
by scottwilkerson
The $ is going to need special escaping

See this article
https://support.nagios.com/kb/article/n ... s-580.html

Re: 'Servicename': Not found error

Posted: Tue May 29, 2018 1:31 am
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.

Re: 'Servicename': Not found error

Posted: Tue May 29, 2018 8:05 am
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

Re: 'Servicename': Not found error

Posted: Mon Jun 04, 2018 1:28 am
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.

Re: 'Servicename': Not found error

Posted: Mon Jun 04, 2018 10:12 am
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.

Re: 'Servicename': Not found error

Posted: Mon Jun 04, 2018 10:55 am
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. :)

Re: 'Servicename': Not found error

Posted: Mon Jun 04, 2018 1:54 pm
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.