Page 1 of 1

How to configure services with a $

Posted: Thu Aug 24, 2017 2:34 pm
by anoopjeev
I am having trouble configuring check command for sql serivce. It has $ sign in it.
something like these:

define serivce{
use generic -service
host_name host23
service_description sql server
check_command check_nt!SERVICESTATE! -d SHOWALL -l MSSQL$SQLEXP
}

it gives errors.please suggest.

Re: How to configure services with a $

Posted: Thu Aug 24, 2017 2:57 pm
by mcapra
Some documentation with various solutions:
https://support.nagios.com/kb/article/n ... mmand.html
https://support.nagios.com/kb/article/n ... cters.html

I realize it says Nagios XI in the title, but much of the same solutions also apply to Nagios Core.

Re: How to configure services with a $

Posted: Thu Aug 24, 2017 3:44 pm
by dwhitfield
Thanks @mcapra!

OP, let us know if that does not resolve your issue. Also, please give the exact error if you continue to have problems, as well as the updated config.

Re: How to configure services with a $

Posted: Fri Aug 25, 2017 10:53 am
by anoopjeev
Thank you mcapra for sharing the links. Adding a backslash \ and two dollars worked for most of the services except for the below.

please check the attachment for the error in nagios console and also the service to be monitored:

Code: Select all

define service {
use         generic-service
host_name                IA0CW005
service_description         SQL ServerRTCLOCAL
check_command   check_nt !SERVICEST! -d SHOWALL -l MSSQL\$$RTCLOCAL
}

Re: How to configure services with a $

Posted: Fri Aug 25, 2017 11:01 am
by scottwilkerson
your command somehow got chopped and should be SERVICESTATE not SERVICEST
this

Code: Select all

define service {
use         generic-service
host_name                IA0CW005
service_description         SQL ServerRTCLOCAL
check_command   check_nt !SERVICEST! -d SHOWALL -l MSSQL\$$RTCLOCAL
}
should be this

define service {
use generic-service
host_name IA0CW005
service_description SQL ServerRTCLOCAL
check_command check_nt !SERVICESTATE! -d SHOWALL -l MSSQL\$$RTCLOCAL
}

Re: How to configure services with a $

Posted: Fri Aug 25, 2017 11:28 am
by anoopjeev
i feel stupid for not checking the command twice. thank you.
Thank you mcapra for sharing the links and scott for pointing my mistake.
This topic can be closed now.