Windows Service Monitoring Error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
dsilvero
Posts: 10
Joined: Tue Sep 01, 2015 9:40 am

Windows Service Monitoring Error

Post by dsilvero »

cap1.jpg
Hi guys, I lookng for a solution for this issue with windows service monitoring, I have Nagios XI and I monitoring many windows services of this server, with this command: $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$ and everything work ok.

But, when I try to monitor the windows services names: PISqlDas.RTQP
Give me this error: (Return code of 127 is out of bounds. Check if plugin exists)

I capture the config screen and paste the $ARG2$ content:
-d SHOWALL -l "$SERVICEDESC$" ;PISqlDas.RTQP=started

The problem is the dot in service name ? , how I can bypass this error ?

Thanks very much in advance

Diego
You do not have the required permissions to view the files attached to this post.
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Windows Service Monitoring Error

Post by vtrac »

Hi Diego,
After doing some research and testing, looks like the error you were getting might be related to not having NSClient installed on your remote Windows server.

Here are example of my tests, checking if services are running (Started or Stopped) on my remote windows which have NSClient service (nscp) running:

Code: Select all

# ./check_nt -H 192.168.254.80 -p 12489 -s 'myPASS' -v SERVICESTATE -d SHOWALL  -l http
 http: Started

# ./check_nt -H 192.168.254.80 -p 12489 -s 'myPASS' -v SERVICESTATE -d SHOWALL  -l nscp
 nscp: Started

# ./check_nt -H 192.168.254.80 -p 12489 -s 'myPASS' -v SERVICESTATE -d SHOWALL  -l captureservice
 captureservice: Stopped
However, when I checked for service "PISqlDas.RTQP", which I don't have .... my error is "service not exist":

Code: Select all

# ./check_nt -H 192.168.254.80 -p 12489 -s 'myPASS' -v SERVICESTATE -d SHOWALL  -l PISqlDas.RTQP
 Failed to open service PISqlDas.RTQP: 424: The specified service does not exist as an installed service.
So, looks like you need to install NSClient on your remote Windows for "check_nt" to works.

Here are instructions on how to install and configure NSClient agent:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
https://assets.nagios.com/downloads/nag ... ios-XI.pdf


Best Regards,
Vinh
dsilvero
Posts: 10
Joined: Tue Sep 01, 2015 9:40 am

Re: Windows Service Monitoring Error

Post by dsilvero »

Thank you Vinh for you help, in this server the nsclient was installed and working fine, I put here an capture of this server monitoring services to see that the only service monitoring that not working is PISqlDas.RTQP(in this case you can see the service description), and all anothers services monitoring are working fine

Thank you very much !!!
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Windows Service Monitoring Error

Post by ssax »

Please edit the failing service and change the $ARG1$ from this:

Code: Select all

-d SHOWALL -l "$SERVICEDESC$" ;PISqlDas.RTQP=started
To this:

Code: Select all

-d SHOWALL -l "$SERVICEDESC$"
Then save, apply configuration, and force a check.
dsilvero
Posts: 10
Joined: Tue Sep 01, 2015 9:40 am

Re: Windows Service Monitoring Error

Post by dsilvero »

Thank you Ssax for you reply, I modified the $ARG02$ (not $ARG01$), but the services name contain illegal characters like:

PI SQL Data Access Server (RTQP Engine)

and give me error, how can I bypass this error ?

Thank you for you patience

Diego
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Windows Service Monitoring Error

Post by cdienger »

Can you provide a screenshot of the error?

Also, what version of XI is this? Some versions the "Run check command" button will produce an error, but if you look at the status of the service in the dashboard it will show up correctly. Please check this.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Windows Service Monitoring Error

Post by ssax »

Are you referring to the XI CCM service description containing special chars or the $ARG2$ value?

If the service description, I'd recommend you remove the parens () from the service description but given the way you have it setup to use the own services $SERVICEDESC$ you'll likely need to do this:

Edit /usr/local/nagios/etc/nagios.cfg and change this:

Code: Select all

illegal_object_name_chars=`~!$%^&*|'"<>?,()=
To this:

Code: Select all

illegal_object_name_chars=`~!$%^&*|'"<>?,=
Then restart the nagios service.

Code: Select all

systemctl restart nagios
Then apply configuration.
dsilvero
Posts: 10
Joined: Tue Sep 01, 2015 9:40 am

Re: Windows Service Monitoring Error

Post by dsilvero »

Hi Ssax, I delete () from /usr/local/nagios/etc/nagios.cfg in
illegal_object_name_chars=`~!$%^&*|'"<>?,()=
and restart Nagios Service

But, when I put () in service description, still show me an error, any idea ?

Thank you very much !!!
You do not have the required permissions to view the files attached to this post.
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Windows Service Monitoring Error

Post by vtrac »

Hi Diego,
Could you please show me the "Service Name" and "Display Name" of this running service?

Open "Task Manager" > Services > "PI SQL Data Access Server" > right click "Open Services" > right click "Properties" of "PI SQL Data Access Server"

Here's an example of "AppRediness":
AppReadiness.png
I have tested and you can use either "Server Name" or "Display Name" with the "-l" option (example):

Code: Select all

[root@vt-nagiosxi-62 libexec]# ./check_nt -H 192.168.254.102 -p 12489 -s 'VT9900' -v SERVICESTATE -d SHOWALL  -l AppReadiness
AppReadiness: Stopped

Code: Select all

[root@vt-nagiosxi-62 libexec]# ./check_nt -H 192.168.254.102 -p 12489 -s 'VT9900' -v SERVICESTATE -d SHOWALL  -l "App Readiness"
App Readiness: Stopped
I am thinking we can "rename" the PI SQL service name, if needed to.

Regards,
Vinh
You do not have the required permissions to view the files attached to this post.
dsilvero
Posts: 10
Joined: Tue Sep 01, 2015 9:40 am

Re: Windows Service Monitoring Error

Post by dsilvero »

Hi Vtrac, I send you the capture with detail of the service

I run the command:
[xxxxxx libexec]$ ./check_nt -H PARCCVWPIEDA01 -p 12489 -s 'VT9900' -v SERVICESTATE -d SHOWALL -l PI SQL Data Access Server (RTQP Engine)
bash: syntax error near unexpected token `('

Here I put with " " in the service description and give me this error, my nsclient don´t have an password:
[xxxxxx libexec]$ ./check_nt -H PARCCVWPIEDA01 -p 12489 -s 'VT9900' -v SERVICESTATE -d SHOWALL -l "PI SQL Data Access Server (RTQP Engine)"
NSClient - ERROR: Invalid password.

Thank you very much !!!!
You do not have the required permissions to view the files attached to this post.
Locked