check_nt service state check not working

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check_nt service state check not working

Post by tgriep »

Edit the nsclient.ini and change this line from

Code: Select all

CheckSystem = disabled
to

Code: Select all

CheckSystem = enabled
Save the change and restart NSClient++.

Run this in a shell to see if the check is fixed.

Code: Select all

./check_nt -H DALSRVPRDIIS02 -v SERVICESTATE -d SHOWALL -l eSPNaniConnector\$MN -p 12489
If so, change the command to the following.

Code: Select all

check_command         check_nt!SERVICESTATE!-d SHOWALL -l eSPNaniConnector\$MN
Be sure to check out our Knowledgebase for helpful articles and solutions!
vho
Posts: 11
Joined: Thu Nov 14, 2019 4:13 pm

Re: check_nt service state check not working

Post by vho »

We modified the nsclient.ini and ran the command in the shell and that started. The command in the config file was already the same. The issue is still there.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check_nt service state check not working

Post by tgriep »

Out of all of the combinations for escaping a $ in the service name is to do the following.

Code: Select all

-l "eSPNaniConnector$"$"MN"
All of the other examples failed.

Make sure the name of the service in the Windows server is exactly like the following.

Code: Select all

eSPNaniConnector$MN
Make the change, reboot the server so we know that the processes have been restarted.

Last thing to try is to install the latest version of Core 4.x.x.
https://support.nagios.com/kb/article/n ... ce-96.html
Be sure to check out our Knowledgebase for helpful articles and solutions!
kmartin2007
Posts: 66
Joined: Thu Nov 14, 2019 3:31 pm

Re: check_nt service state check not working

Post by kmartin2007 »

tgriep wrote:Out of all of the combinations for escaping a $ in the service name is to do the following.

Code: Select all

-l "eSPNaniConnector$"$"MN"
All of the other examples failed.

Make sure the name of the service in the Windows server is exactly like the following.

Code: Select all

eSPNaniConnector$MN
Make the change, reboot the server so we know that the processes have been restarted.

Last thing to try is to install the latest version of Core 4.x.x.
https://support.nagios.com/kb/article/n ... ce-96.html
I made the change. validated the service. Did you want me to reboot the nagios server?

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"
Attachments
MN nani.png
MN nani.png (1.58 KiB) Viewed 2392 times
kmartin2007
Posts: 66
Joined: Thu Nov 14, 2019 3:31 pm

Re: check_nt service state check not working

Post by kmartin2007 »

kmartin2007 wrote:
tgriep wrote:Out of all of the combinations for escaping a $ in the service name is to do the following.

Code: Select all

-l "eSPNaniConnector$"$"MN"
All of the other examples failed.

Make sure the name of the service in the Windows server is exactly like the following.

Code: Select all

eSPNaniConnector$MN
Make the change, reboot the server so we know that the processes have been restarted.

Last thing to try is to install the latest version of Core 4.x.x.
https://support.nagios.com/kb/article/n ... ce-96.html
I made the change. validated the service. Did you want me to reboot the nagios server?

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"



I restarted Nagios Service on the nagios server

now getting this.

MN_Connector_NANI2.0
Perform Extra Service Actions
UNKNOWN 2019-11-25 21:05:59 9d 23h 30m 55s 2/2 Failed to open service eSPNaniConnector$$MN: 1060: The specified service does not exist as an installed service.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check_nt service state check not working

Post by tgriep »

Now is seems to be adding both $ to the check.
Try this

Code: Select all

-l "eSPNaniConnector$MN"
or this

Code: Select all

-l "eSPNaniConnector"$"MN"
Be sure to check out our Knowledgebase for helpful articles and solutions!
kmartin2007
Posts: 66
Joined: Thu Nov 14, 2019 3:31 pm

Re: check_nt service state check not working

Post by kmartin2007 »

tgriep wrote:Now is seems to be adding both $ to the check.
Try this

Code: Select all

-l "eSPNaniConnector$MN"
or this

Code: Select all

-l "eSPNaniConnector"$"MN"


both yeild same result


MN_Connector_NANI2.0
Perform Extra Service Actions
UNKNOWN 2019-11-25 21:32:30 9d 23h 57m 47s 2/2 Failed to open service eSPNaniConnector$$MN: 1060: The specified service does not exist as an installed service.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check_nt service state check not working

Post by tgriep »

That's weird, you put in one $ and it shows up as 2. Never seen that before.
Be sure to check out our Knowledgebase for helpful articles and solutions!
kmartin2007
Posts: 66
Joined: Thu Nov 14, 2019 3:31 pm

Re: check_nt service state check not working

Post by kmartin2007 »

tgriep wrote:That's weird, you put in one $ and it shows up as 2. Never seen that before.

Yeah im at a loss here, and really frustrated. We also started observing socket timeout afer 10 second error messages on some of the servers on things that WERE working before.


CRITICAL - Socket timeout after 10 seconds


Please let us know what next steps are.
kmartin2007
Posts: 66
Joined: Thu Nov 14, 2019 3:31 pm

Re: check_nt service state check not working

Post by kmartin2007 »

Please let us know what the next steps are.
Locked