1

I'm trying to monitor mssql service in OMD nagios, but with no success so far.
Communication port: 1433
instance name is like: MSSQL$instance

Here's my check:

check_command check_nt!SERVICESTATE!-l 'MSSQL$$instance' (like you've suggested here http://serverfault.com/questions/517291/monitor-services-with-in-the-service-name-in-icinga-nagios, nagios said: Failed to open service: MSSQL)

I've tried some other combinations:
MSSQL\$$instance (Failed to open service: MSSQL\$SQL2012)
MSSQL"$$"instance (Failed to open service: MSSQL"$"SQL2012)
"MSSQL"$$"instance" (Failed to open service: "MSSQL"$"SQL2012")

Any suggestions very appreciated.
Don't know what causes the problem.
Thanks in advance.

gaspar
  • 133
  • 1
  • 10
  • Have you tried doublequotes and the literal string?check_snmp_win!!"MSSQL$KNXDB52"!$USER2$!1 is a working check on my server, although I am checking via SNMP directly. – TheFiddlerWins Oct 07 '14 at 13:00
  • Try just MSSQL$$instance, no quotes – Keith Oct 07 '14 at 14:25
  • @Keith: unfortunately MSSQL$$instance gives: Failed to open service: MSSQL$instance. Maybe I just try to use check via SNMP as TheFiddlerWins suggested. However I'd like to check it via servicestate - there must be some way ;) – gaspar Oct 08 '14 at 06:14

2 Answers2

1

I had to trial and error this one. What works for me is

MSSQL\\$Instance

as in

check_command           check_nt!SERVICESTATE!-d SHOWALL -l MSSQL\\$Instance
Katherine Villyard
  • 18,510
  • 4
  • 36
  • 59
  • MSSQL\\$Instance gives another monit: Failed to open service: MSSQL\$SQL2012$. There must be a way to do it via check_nt!SERVICESTATE! - still searching for the answear. Thanks to all for sugestions! – gaspar Oct 08 '14 at 06:27
0

When I add -d SHOWALL to my check command, so it's like:

check_command check_nt!SERVICESTATE!-d SHOWALL -l MSSQL\\$$instance

then nagios (in check_mk) shows: No service/process specified

Do you know what can cause this problem?

Solution

Finally I've found the soultion. It turns out the problem was in check_nt command definition.
Oryginally I've used it like this:

define command {
    command_name    check_nt
    command_line    /usr/lib/nagios/plugins/check_nt -H '$HOSTADDRESS$' -v '$ARG1$' -p 12489 '$ARG2$'
}

And that causes above problems with "No service/process specified" and "failed to open service" .

When I change my check_nt definition to:

define command {
    command_name    check_nt
    command_line    /usr/lib/nagios/plugins/check_nt -H $HOSTADDRESS$ -v $ARG1$ -p 12489 $ARG2$
}

it works like a charm :) with:

check_command       check_nt!SERVICESTATE!-d SHOWALL -l MSSQL"$$"instance

So the problem finally resolved :)
Kind regards

gaspar
  • 133
  • 1
  • 10