check_nt can not find service with $ in name - MSSQL$MSFW
Posted: Fri Aug 28, 2015 9:18 am
Hello all.
I am using Nagios for a few years now and my production machine runs on ubuntu 14.04.3 LTS Server with Nagios 3.5 and Nagios Plugins 2.0.3.
I am working towards moving my production to 4.1.1 with plugins 2.1.1 but I have run into a problem.
I can not correctly check if an MSSQL service for ISA Server 2006 is started with my test installation on Nagios 4.1.1 and plugins 2.1.1
The command used is check_nt in order to check if a service is started. For example in the config you would find:
define service{
use generic-service;
hostgroup_name ProxyServers;
service_description MSSQL Service;
check_command check_nt!SERVICESTATE!-d SHOWALL -l 'MSSQL\$MSFW'
contact_groups proxyservers_admins,admins
notification_period 24x7no45amrestart
}
while the check_nt command is defined as follows:
# 'check_nt' command definition
define command{
command_name check_nt
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
}
(I will not put in the part where the group and hosts for ProxyServers is configured for obvious reasons).
So what happens is that my 3.5/2.0.3 system checks for the MSSQL$MSFW service and responds it is started.
However the 4.1.1/2.1.1 system reports:
Failed to open service MSSQL$MSFW$: 123: The filename, directory name, or volume label syntax is incorrect.
I have also tried with various ways like this:
check_command check_nt!SERVICESTATE!-d SHOWALL -l "MSSQL\\$MSFW"
On the 3.5 system, this workds fine. On the 4.1.1 I get:
Failed to open service MSSQL: 123: The filename, directory name, or volume label syntax is incorrect.
I tried working out the problem as I had done in the past so I tried through the command line this is how it went (I replaced the actual hostname and delete the part where the hostname and path shows in the command line, all checks executed in the libexec dir and on the 4.1.1 machine):
./check_nt -H hostname -p 12489 -v SERVICESTATE -d SHOWALL -l "MSSQL\$MSFW"
MSSQL$MSFW: Started
./check_nt -H hostname -p 12489 -v SERVICESTATE -d SHOWALL -l 'MSSQL$MSFW'
MSSQL$MSFW: Started
./check_nt -H hostname -p 12489 -v SERVICESTATE -d SHOWALL -l MSSQL$MSFW
Failed to open service MSSQL: 1060: The specified service does not exist as an installed service.
./check_nt -H hostname -p 12489 -v SERVICESTATE -d SHOWALL -l MSSQL\$MSFW
MSSQL$MSFW: Started
./check_nt -H hostname -p 12489 -v SERVICESTATE -d SHOWALL -l "MSSQL\\$$MSFW"
Failed to open service MSSQL\1101MSFW: 123: The filename, directory name, or volume label syntax is incorrect.
I know I must be missing something but I have no idea what that is.
If anyone has a clue, I would be grateful.
Thank you and all the best to your admin efforts.
Ioannis Theodoridis
I am using Nagios for a few years now and my production machine runs on ubuntu 14.04.3 LTS Server with Nagios 3.5 and Nagios Plugins 2.0.3.
I am working towards moving my production to 4.1.1 with plugins 2.1.1 but I have run into a problem.
I can not correctly check if an MSSQL service for ISA Server 2006 is started with my test installation on Nagios 4.1.1 and plugins 2.1.1
The command used is check_nt in order to check if a service is started. For example in the config you would find:
define service{
use generic-service;
hostgroup_name ProxyServers;
service_description MSSQL Service;
check_command check_nt!SERVICESTATE!-d SHOWALL -l 'MSSQL\$MSFW'
contact_groups proxyservers_admins,admins
notification_period 24x7no45amrestart
}
while the check_nt command is defined as follows:
# 'check_nt' command definition
define command{
command_name check_nt
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
}
(I will not put in the part where the group and hosts for ProxyServers is configured for obvious reasons).
So what happens is that my 3.5/2.0.3 system checks for the MSSQL$MSFW service and responds it is started.
However the 4.1.1/2.1.1 system reports:
Failed to open service MSSQL$MSFW$: 123: The filename, directory name, or volume label syntax is incorrect.
I have also tried with various ways like this:
check_command check_nt!SERVICESTATE!-d SHOWALL -l "MSSQL\\$MSFW"
On the 3.5 system, this workds fine. On the 4.1.1 I get:
Failed to open service MSSQL: 123: The filename, directory name, or volume label syntax is incorrect.
I tried working out the problem as I had done in the past so I tried through the command line this is how it went (I replaced the actual hostname and delete the part where the hostname and path shows in the command line, all checks executed in the libexec dir and on the 4.1.1 machine):
./check_nt -H hostname -p 12489 -v SERVICESTATE -d SHOWALL -l "MSSQL\$MSFW"
MSSQL$MSFW: Started
./check_nt -H hostname -p 12489 -v SERVICESTATE -d SHOWALL -l 'MSSQL$MSFW'
MSSQL$MSFW: Started
./check_nt -H hostname -p 12489 -v SERVICESTATE -d SHOWALL -l MSSQL$MSFW
Failed to open service MSSQL: 1060: The specified service does not exist as an installed service.
./check_nt -H hostname -p 12489 -v SERVICESTATE -d SHOWALL -l MSSQL\$MSFW
MSSQL$MSFW: Started
./check_nt -H hostname -p 12489 -v SERVICESTATE -d SHOWALL -l "MSSQL\\$$MSFW"
Failed to open service MSSQL\1101MSFW: 123: The filename, directory name, or volume label syntax is incorrect.
I know I must be missing something but I have no idea what that is.
If anyone has a clue, I would be grateful.
Thank you and all the best to your admin efforts.
Ioannis Theodoridis