Problems Monitoring MsSql2000 db instances


#1

Hi All,

It seems like I’m unable to monitor sql 2000 db instances that contain a dollar sign in their name.
I’ve installed nsclient++ (or better known as nscp thesedays)

My service def looks somewhat like this:

define service{
use windows-service ; Name of service template to use
host_name hermes.ism
service_description Service: MSSQL$SQL2
check_command check_nt_win_srv!MSSQL$SQL2
}

command def:

‘check_nt_win_srv’ command definition

define command{
command_name check_nt_win_srv
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v SERVICESTATE -l $ARG1$
}

Alright… so i know it fails right here: check_nt_win_srv!MSSQL$SQL2

I’ve tried the following combo’s:
check_nt_win_srv!'MSSQL$SQL2’
check_nt_win_srv!"MSSQL$SQL2"
check_nt_win_srv!'MSSQL$$SQL2’
check_nt_win_srv!MSSQL$$SQL2

None of these seem to work.

Anyone got an idea?


#2

perhaps try escaping the $ character with a \ or a /. I think nagios will escape with a /…
eg:
check_command check_nt_win_srv!MSSQL/$SQL2

otherwise you may have to craft a new nsclient entry with the $ in there rather than having nagios try to handle it.


#3

Thanks for the response, I’ll try this tomorrow and post an update.


#4

I have the same problem. The curious of this problem is that if I check the service state throught monarch or command line it works perfectly, but nagios put a $ char at the end of the name of the service and nsclient can


#5

NagiosUser,

As MP pointed out it is a problem with nagios interpreting your $ as a variable where it is just supposed to be a character.

Try using MSSQL/$SQL instead of MSSQL$SQL.