Core to XI: Change in check command arguments
Posted: Fri Jan 23, 2015 10:54 pm
I am in the process of standing up a XI server to replace a Core server, and think I found a bug.
Our config files are identical between XI and Core, however I am getting a different check command sent to Nsclient.
We have a check to see if the SQL server is available.
The instance is left blank if the SQL server instance is set with the default instance, otherwise it is set in the config file.
Service.cfg
define service {
use mssql_database
service_description SQLServer_Database Availability
servicegroups MSSQL Production Servers,MSSQL Services
host_name SQLserver1
_alias SQLserver1
_instance
notifications_enabled 1
register 1
}
The service has a number of settings, but here is the check command
define command {
command_name check_mssql_database
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c check_mssql_connection -a username password $_SERVICEALIAS$ $_SERVICEINSTANCE$
}
And the external script in nsc.ini
check_mssql_connection=cscript.exe //T:30 //NoLogo scripts\check_mssql.vbs $ARG1$ $ARG2$ $ARG3$ $ARG4$
When Core sends the check, nsclient calls the script with username password SQLserver1
and the script completes.
When XI sends the check, nsclient calls the script with username password SQLserver1 _instance
the script fails as it tries to connect to server\_instance
One fix would be to change the script, however I would like to know why this is happening as it may be causing other issues.
Our config files are identical between XI and Core, however I am getting a different check command sent to Nsclient.
We have a check to see if the SQL server is available.
The instance is left blank if the SQL server instance is set with the default instance, otherwise it is set in the config file.
Service.cfg
define service {
use mssql_database
service_description SQLServer_Database Availability
servicegroups MSSQL Production Servers,MSSQL Services
host_name SQLserver1
_alias SQLserver1
_instance
notifications_enabled 1
register 1
}
The service has a number of settings, but here is the check command
define command {
command_name check_mssql_database
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c check_mssql_connection -a username password $_SERVICEALIAS$ $_SERVICEINSTANCE$
}
And the external script in nsc.ini
check_mssql_connection=cscript.exe //T:30 //NoLogo scripts\check_mssql.vbs $ARG1$ $ARG2$ $ARG3$ $ARG4$
When Core sends the check, nsclient calls the script with username password SQLserver1
and the script completes.
When XI sends the check, nsclient calls the script with username password SQLserver1 _instance
the script fails as it tries to connect to server\_instance
One fix would be to change the script, however I would like to know why this is happening as it may be causing other issues.