tgriep wrote:The second dollar sign in the name is causing the rest of the command to get truncated so it is not adding the -p 12489 on the command to that is why it is generating the "unable to communicate on port 1248" error.
Running things from the command line is different from running them with nagios.
I do not have access to services with the same name but I do have a MSSQL service with a dollar sign in the name.
Here is now the check_nt command is defined
Code: Select all
# 'check_nt' command definition
define command{
command_name check_nt
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
}
Here is how the service is setup.
Code: Select all
check_command check_nt!SERVICESTATE!-d SHOWALL -l "MSSQL$"$"SQLEXPRESS"
And it works just fine.
MSSQL.PNG
The only other thing I can think of is if you are running an older version of NSClient++, that could cause the issue if there is a bug.
this is what you said in a previous post.
The nagios.cfg file looks stock so that is good.
I would edit all of the commands and remove the extra $ as it looks like it is getting truncated.
Change all of then to just \$ where needed and replace the $"$" for that one service.
You want me to change this
define service{
use production-service
host_name DALSRVPRDIIS02, DALSRVPRDIIS07
service_description MN_Connector_NANI2.0
display_name MN_Connector_NANI2.0
check_command check_nt!SERVICESTATE!-d SHOWALL -l "eSPNaniConnector$"$"MN"
}
to this
define service{
use production-service
host_name DALSRVPRDIIS02, DALSRVPRDIIS07
service_description MN_Connector_NANI2.0
display_name MN_Connector_NANI2.0
check_command check_nt!SERVICESTATE!-d SHOWALL -l eSPNaniConnector\$MN
}
Correct?
this is my nt.cfg file
This is my nt.cfg for check_nt.
# 'check_nt' command definition
define command {
command_name check_nt
command_line /usr/lib/nagios/plugins/check_nt -p 12489 -H '$HOSTADDRESS$' -v $ARG1$ $ARG2$
}