Page 2 of 2

Re: Nagios illegal Characters in cfg file

Posted: Sun Oct 25, 2015 11:16 pm
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

Re: Nagios illegal Characters in cfg file

Posted: Sun Oct 25, 2015 11:22 pm
by Box293
Try $$ in the check_command line:

Code: Select all

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

Re: Nagios illegal Characters in cfg file

Posted: Mon Oct 26, 2015 7:51 am
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

Re: Nagios illegal Characters in cfg file

Posted: Mon Oct 26, 2015 7:59 am
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

Re: Nagios illegal Characters in cfg file

Posted: Mon Oct 26, 2015 8:23 am
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

Re: Nagios illegal Characters in cfg file

Posted: Mon Oct 26, 2015 9:30 am
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!