Monitoring Windows Services
Monitoring Windows Services
Hey Gents, I need some help monitoring some Windows Services. The concept is easy I just cannot understand the syntax correctly . I have searched all over and while I find many people have the issue I have not found any clear language on how this should be working. I am comfortable with the CLI however, I use the GUI to modify hosts and services. I am trying to generate an alert when this service is 'stopped' or 'not running', and an 'OK' when service is up. What am I missing?
No matter what I do I either get:
[[email protected] ~]$ /usr/local/nagios/libexec/check_nt -H 10.10.108.5 -s "" -p 12489 -v SERVICESTATE -l Oracleagent12c1Agent
OK: All services are in their appropriate state.
or
[[email protected] ~]$ /usr/local/nagios/libexec/check_nt -H 10.10.108.5 -s "" -p 12489 -v SERVICESTATE -l Oracleagent12c1Agent -d SHOWALL
Oracleagent12c1Agent: Started
Nagios XI 5.4.4
CentoOS 6.8
VMware
No matter what I do I either get:
[[email protected] ~]$ /usr/local/nagios/libexec/check_nt -H 10.10.108.5 -s "" -p 12489 -v SERVICESTATE -l Oracleagent12c1Agent
OK: All services are in their appropriate state.
or
[[email protected] ~]$ /usr/local/nagios/libexec/check_nt -H 10.10.108.5 -s "" -p 12489 -v SERVICESTATE -l Oracleagent12c1Agent -d SHOWALL
Oracleagent12c1Agent: Started
Nagios XI 5.4.4
CentoOS 6.8
VMware
-
dwasswa
Re: Monitoring Windows Services
Hi @ahoward12,
To configure services from GUI follow:Using The Core Config Manager For Service Management
To configure notifications or alerts follow: How to Configure Email And Text Notifications
For information on how to use commands /plugins and syntax please follow: Nagios Plugins
Please let me know if you have any questions.
To configure services from GUI follow:Using The Core Config Manager For Service Management
To configure notifications or alerts follow: How to Configure Email And Text Notifications
For information on how to use commands /plugins and syntax please follow: Nagios Plugins
Please let me know if you have any questions.
Re: Monitoring Windows Services
Thanks for links but I fully understand how to do all of that. I have had Nagios XI in production for quite sometime. I am having an issue with the syntax of the specific service below.
-
kyang
Re: Monitoring Windows Services
I think what you have is sufficient? When the service is not running it will return critical.
Here's something I spun up, so you can visualize it.
This is when I turned off my nxlog service.
Here's something I spun up, so you can visualize it.
Code: Select all
/usr/local/nagios/libexec/check_nt -H 192.168.3.46 -s "welcome" -p 12489 -v SERVICESTATE -l nxlog
OK: All 1 service(s) are ok.
Code: Select all
[root@localhost libexec]# /usr/local/nagios/libexec/check_nt -H 192.168.3.46 -s "welcome" -p 12489 -v SERVICESTATE -l nxlog
CRITICAL: nxlog: Stopped, delayed ()Is this what you wanted to see? I get alerts when my nxlog service is not running or "Stopped" and alerts when my service is running or "ok"I am trying to generate an alert when this service is 'stopped' or 'not running', and an 'OK' when service is up. What am I missing?
You do not have the required permissions to view the files attached to this post.
Re: Monitoring Windows Services
Yes, that was exactly what I was looking for, thank you. However that doesn't work for me for several reasons... While I am creating the command and I use the "Run Check Command" button I get this while the service is running on the server:
[[email protected] ~]$ /usr/local/nagios/libexec/check_nt -H 10.10.99.42 -s "" -p 12489 -v SERVICESTATE -l dnscache
OK: All services are in their appropriate state.
If I stop the service and run that exact same command I get this:
[[email protected] ~]$ /usr/local/nagios/libexec/check_nt -H 10.10.99.42 -s "" -p 12489 -v SERVICESTATE -l dnscache
dnscache: Stopped
It would like this is working..But it's not. It doesn't work when I save and apply the configuration. The service in Nagios always comes up as "Unknown" no matter if the Windows Service on the Server is running or not.
"View Attached Screenshot"
It appears it is looking for critical and warning defined, but I have tried every way I can think of with no luck.
[[email protected] ~]$ /usr/local/nagios/libexec/check_nt -H 10.10.99.42 -s "" -p 12489 -v SERVICESTATE -l dnscache
OK: All services are in their appropriate state.
If I stop the service and run that exact same command I get this:
[[email protected] ~]$ /usr/local/nagios/libexec/check_nt -H 10.10.99.42 -s "" -p 12489 -v SERVICESTATE -l dnscache
dnscache: Stopped
It would like this is working..But it's not. It doesn't work when I save and apply the configuration. The service in Nagios always comes up as "Unknown" no matter if the Windows Service on the Server is running or not.
"View Attached Screenshot"
It appears it is looking for critical and warning defined, but I have tried every way I can think of with no luck.
You do not have the required permissions to view the files attached to this post.
-
kyang
Re: Monitoring Windows Services
I think I know what happened, but we can double check.
Can you show me how you check_nt command is defined?
And how you defined this service in XI?
Can you show me how you check_nt command is defined?
And how you defined this service in XI?
Re: Monitoring Windows Services
Here is my check_nt
Here is the check_xi_service_nsclient that is referencing the check_nt
Here is the template applied to the service
Here is the check_xi_service_nsclient that is referencing the check_nt
Here is the template applied to the service
You do not have the required permissions to view the files attached to this post.
-
kyang
Re: Monitoring Windows Services
This is how mine looks like, and it works just fine. I do have one less $ARG$, see if it works with it, but if not try deleting it and test it.
Next, I notice you don't have a password in your -s "". Did you delete this before taking a snapshot or was it not in there?
I do see that you don't have any hosts assigned or templates? I used the xiwziard_windowsdesktop_nsclient_service as the template
As always, make sure to apply your configuration and then force an immediate recheck on your service to see if it works.
Let me know if this helps.
Next, I notice you don't have a password in your -s "". Did you delete this before taking a snapshot or was it not in there?
I do see that you don't have any hosts assigned or templates? I used the xiwziard_windowsdesktop_nsclient_service as the template
As always, make sure to apply your configuration and then force an immediate recheck on your service to see if it works.
Let me know if this helps.
You do not have the required permissions to view the files attached to this post.
Re: Monitoring Windows Services
So I had everything right from the beginning. It was just a bug, I deleted it and remade it and it works. What a headache...Thanks for help.
-
kyang
Re: Monitoring Windows Services
No problem! Sometimes it takes two haha.
Am I okay to close this thread?
Am I okay to close this thread?