check_nt service state check not working

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Re: check_nt service state check not working

Postby lmiltchev » Wed Nov 20, 2019 10:24 am

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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
QA Manager
 
Posts: 12754
Joined: Mon May 23, 2011 12:15 pm

Re: check_nt service state check not working

Postby tgriep » Wed Nov 20, 2019 10:44 am

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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 8429
Joined: Thu Oct 30, 2014 9:02 am

Re: check_nt service state check not working

Postby kmartin2007 » Wed Nov 20, 2019 12:31 pm

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
Attachments
iis02 nagios host page.png
services nani MN.png
sc command.png
sc command.png (10.18 KiB) Viewed 111 times
kmartin2007
 
Posts: 62
Joined: Thu Nov 14, 2019 3:31 pm

Re: check_nt service state check not working

Postby tgriep » Wed Nov 20, 2019 12:56 pm

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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 8429
Joined: Thu Oct 30, 2014 9:02 am

Re: check_nt service state check not working

Postby kmartin2007 » Wed Nov 20, 2019 1:09 pm

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.
Attachments
commands.cfg
(6.98 KiB) Downloaded 4 times
services_nagios2.cfg
(36.29 KiB) Downloaded 7 times
nt.cfg
nt config file
(509 Bytes) Downloaded 5 times
kmartin2007
 
Posts: 62
Joined: Thu Nov 14, 2019 3:31 pm

Re: check_nt service state check not working

Postby kmartin2007 » Wed Nov 20, 2019 1:24 pm

Here is the execution of the command you sent
Attachments
service.txt
(115.8 KiB) Downloaded 5 times
kmartin2007
 
Posts: 62
Joined: Thu Nov 14, 2019 3:31 pm

Re: check_nt service state check not working

Postby tgriep » Wed Nov 20, 2019 1:58 pm

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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 8429
Joined: Thu Oct 30, 2014 9:02 am

Re: check_nt service state check not working

Postby kmartin2007 » Wed Nov 20, 2019 2:06 pm

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
Attachments
nagios.cfg
(44.61 KiB) Downloaded 3 times
kmartin2007
 
Posts: 62
Joined: Thu Nov 14, 2019 3:31 pm

Re: check_nt service state check not working

Postby tgriep » Wed Nov 20, 2019 3:13 pm

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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 8429
Joined: Thu Oct 30, 2014 9:02 am

Re: check_nt service state check not working

Postby kmartin2007 » Wed Nov 20, 2019 4:07 pm

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
kmartin2007
 
Posts: 62
Joined: Thu Nov 14, 2019 3:31 pm

PreviousNext

Return to Nagios Core

Who is online

Users browsing this forum: Google [Bot] and 29 guests