Nagios illegal Characters in cfg file

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Nagios illegal Characters in cfg file

Post by kwhogster »

no


define service{
use generic-service
host_name SERV010
service_description MSSQL SHAREPOINT
check_command check_nt!SERVICESTATE!-d SHOWALL -l 'MSSQL$SHAREPOINT'
}


MSSQL SHAREPOINT CRITICAL 10-26-2015 04:13:11 0d 0h 0m 7s 1/3 MSSQL$SHAREPOINT$: Not found


adds a dollar $ sign to it

strange that a dollar sign causing a problem here

Thoughts
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Nagios illegal Characters in cfg file

Post by Box293 »

Try $$ in the check_command line:

Code: Select all

check_command check_nt!SERVICESTATE!-d SHOWALL -l 'MSSQL$$SHAREPOINT'
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Nagios illegal Characters in cfg file

Post by kwhogster »

No does not work

It adds a Dollar sign $ to the end of the service comes up NOT FOOUND



define service{
use generic-service
host_name SERV010
service_description MSSQL SHAREPOINT
check_command check_nt!SERVICESTATE!-d SHOWALL -l 'MSSQL$SHAREPOINT'
}


Thoughts

MSSQL SHAREPOINT CRITICAL 10-26-2015 12:47:49 0d 0h 0m 19s 1/3 MSSQL$SHAREPOINT$: Not found
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Nagios illegal Characters in cfg file

Post by kwhogster »

Sorry for the double post I forgot this went to page 2 late night lol

check_command check_nt!SERVICESTATE!-d SHOWALL -l 'MSSQL$$SHAREPOINT'

That worked

looks like the no backslash seemed to do the trick

I will change my other services and post results

Thanks
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Nagios illegal Characters in cfg file

Post by kwhogster »

Using second Dollar Sign $$ and placing in single quotes does work.


define service{
use generic-service
host_name SERV010
service_description SQLAgent Sharepoint
check_command check_nt!SERVICESTATE!-d SHOWALL -l 'SQLAgent$$Sharepoint'
}


Thanks for your help

Problem solved

Note this should be somewhere in the documentation in the define services section would be very helpful
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios illegal Characters in cfg file

Post by tmcdonald »

Already been in the documentation, just maybe not obvious:

https://assets.nagios.com/downloads/nag ... ml#command
Also, if you want to pass a dollar sign ($) on the command line, you have to escape it with another dollar sign.
I'll be closing this thread now, but feel free to open another if you need anything in the future!
Former Nagios employee
Locked