Page 2 of 5

Re: check_nt service state check not working

Posted: Wed Nov 20, 2019 10:24 am
by lmiltchev
Now that we removed the single quotes around the argument, try using:

Code: Select all

check_command check_nt!SERVICESTATE!-d SHOWALL -l eSPNaniConnector\$$MN
Let us know if this worked.

Re: check_nt service state check not working

Posted: Wed Nov 20, 2019 10:44 am
by tgriep
In addition to what @lmiltchev asked.

I see that you are running other Service checks on that same server that have $ in the name, are they also failing?

Can you login to the Windows host in question, run the following command as an administrator and post the output here so we can see the service name?

Code: Select all

sc query type= service state= all | findstr eSPNaniConnector

Re: check_nt service state check not working

Posted: Wed Nov 20, 2019 12:31 pm
by kmartin2007
tgriep wrote:In addition to what @lmiltchev asked.

I see that you are running other Service checks on that same server that have $ in the name, are they also failing?

Can you login to the Windows host in question, run the following command as an administrator and post the output here so we can see the service name?

Code: Select all

sc query type= service state= all | findstr eSPNaniConnector

So the memory usage and what not work fine using the check_nt command, which i think is weird.

I have uploaded screenshots

Re: check_nt service state check not working

Posted: Wed Nov 20, 2019 12:56 pm
by tgriep
Did you update the check_nt command and removed the single quotes from around the Arguments and then restart Nagios?

Verify that you did do that and to be complete, restart the nagios process.

Also, post the command definition and the service definition here so we can view them.

The sc command not finding the service is puzzling, can you run this on the windows server and upload the c:\service.txt file so we can view all of the service names on that system?

Code: Select all

sc query type= service state= all >c:\service.txt
Thanks.

Re: check_nt service state check not working

Posted: Wed Nov 20, 2019 1:09 pm
by kmartin2007
tgriep wrote:Did you update the check_nt command and removed the single quotes from around the Arguments and then restart Nagios?

Verify that you did do that and to be complete, restart the nagios process.

Also, post the command definition and the service definition here so we can view them.

The sc command not finding the service is puzzling, can you run this on the windows server and upload the c:\service.txt file so we can view all of the service names on that system?

Code: Select all

sc query type= service state= all >c:\service.txt
Thanks.

Yes i did change it.

The commands.cfg there is a command in there at the bottom that is commented out, because if i uncomment it, it breaks nagios saying there is a duplicate command. I have a previous topic open regarding this as well.

Re: check_nt service state check not working

Posted: Wed Nov 20, 2019 1:24 pm
by kmartin2007
Here is the execution of the command you sent

Re: check_nt service state check not working

Posted: Wed Nov 20, 2019 1:58 pm
by tgriep
Are you running version 3.5.1 of Nagios Core?

I would guess that the nt.cfg file and the commands.cfg files are included in the nagios configurations and if you have a check_nt command in one of the files, you cannot have another one defined.

So, leaving the check_nt command in the commands.cfg file is needed.

The service name is in the txt file so that looks OK.

Can you post the nagios.cfg file here so we can view it's settings?

Re: check_nt service state check not working

Posted: Wed Nov 20, 2019 2:06 pm
by kmartin2007
tgriep wrote:Are you running version 3.5.1 of Nagios Core?

I would guess that the nt.cfg file and the commands.cfg files are included in the nagios configurations and if you have a check_nt command in one of the files, you cannot have another one defined.

So, leaving the check_nt command in the commands.cfg file is needed.

The service name is in the txt file so that looks OK.

Can you post the nagios.cfg file here so we can view it's settings?

correct. I took the old commands.cfg file and copied them into the new one. and nagios3 -v nagios.cfg and found the errors and commented out as needed. The check_nt command is commented out in the commands.cfg file because it's a duplicate when i check the config.

Nagios Core 3.5.1
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-30-2013
License: GPL

Re: check_nt service state check not working

Posted: Wed Nov 20, 2019 3:13 pm
by tgriep
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.

Re: check_nt service state check not working

Posted: Wed Nov 20, 2019 4:07 pm
by kmartin2007
tgriep wrote: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.

I have already done that before and it did not work, however executing it from the terminal like so(below) and it brings back data.

./check_nt -v SERVICESTATE-d SHOWALL -l eSPNaniConnector\$MNeSPConnector -p 12489

but if running it with the $$ and no port it tells me cant be found, and or unable to communicate on port 1248