Using NRPE for windows server
-
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Using NRPE for windows server
Can you provide the service config for the DHCP service? Monitoring the service is how you would know it is back.
That said, I would suggest opening different threads for each service where you are having issues. We are going to have to look at service configs and the services on the Windows side and it's going to be very confusing to try to do all of that in one thread.
That said, I would suggest opening different threads for each service where you are having issues. We are going to have to look at service configs and the services on the Windows side and it's going to be very confusing to try to do all of that in one thread.
Re: Using NRPE for windows server
Could you direct me on a simple service restart that you know would work something common and explain step by step sorry for the trouble. I am trying this of service as a test for now just to see the results
service_description DHCP Client
check_command check_nrpe!check_process!process=Dhcp!show-all
service_description DHCP Client
check_command check_nrpe!check_process!process=Dhcp!show-all
dwhitfield wrote:Can you provide the service config for the DHCP service? Monitoring the service is how you would know it is back.
That said, I would suggest opening different threads for each service where you are having issues. We are going to have to look at service configs and the services on the Windows side and it's going to be very confusing to try to do all of that in one thread.
Re: Using NRPE for windows server
Another thing i forgot to mention is that i would stop the service and it would still show up in nagios that it is ok.
skypete wrote:Could you direct me on a simple service restart that you know would work something common and explain step by step sorry for the trouble. I am trying this of service as a test for now just to see the results
service_description DHCP Client
check_command check_nrpe!check_process!process=Dhcp!show-all
dwhitfield wrote:Can you provide the service config for the DHCP service? Monitoring the service is how you would know it is back.
That said, I would suggest opening different threads for each service where you are having issues. We are going to have to look at service configs and the services on the Windows side and it's going to be very confusing to try to do all of that in one thread.
Re: Using NRPE for windows server
Let me know if you run into any troubles.Could you direct me on a simple service restart that you know would work something common and explain step by step sorry for the trouble
1. To test simply stop the Print Spooler service on the Windows machine.
2. Open the Services console under "Administrative Tools."
3. Right-click the Print Spooler service and select "Stop." 4. Wait for the service to go to a "critical state" or "force the next check" in the Nagios Core interface.
5. Once the Nagios Core Print Spooler service is in a "critical state" the event handler will be executed and the Windows Print Spooler service will be restarted.
The next time Nagios Core checks the Print Spooler service.
It should to an OK state as the Windows Print Spooler service will now be running.
Or look back in Windows and check if the Printer Spooler service is turned back on by right-clicking it.
6. If the event handler does not appear to be working as expected, check the /usr/local/nagios/var/nagios.log file for any errors.
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Using NRPE for windows server
Can you test this command from the Nagios server:
Replace the windows server IP with the actual IP, and service_name with the windows service that you want to restart. Does it successfully restart the service for you or do you get "unknown command"?
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H windows_server_ip_address -p 5666 -c restart_service -a service_name
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Using NRPE for windows server
Hi i readded this command and rename it as the following in my cfg file it is not working nagios wont restart the service.
define service {
host_name HostName
service_description Print Spooler
check_command check_nrpe!check_process!process=spoolsv.exe!show-all
max_check_attempts 5
event_handler restart-service
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
}
define service {
host_name HostName
service_description Print Spooler
check_command check_nrpe!check_process!process=spoolsv.exe!show-all
max_check_attempts 5
event_handler restart-service
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
}
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Using NRPE for windows server
Please run this command and share the output in your next post:Hi i readded this command and rename it as the following in my cfg file it is not working nagios wont restart the service.
Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H windows_server_ip_address -p 5666 -c restart_service -a service_name
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Using NRPE for windows server
When i stop the services from windows it does not automatically restart. but when i ran that command it works.Still having trouble with auto restart. can we try another service command?
npolovenko wrote:Can you test this command from the Nagios server:Replace the windows server IP with the actual IP, and service_name with the windows service that you want to restart. Does it successfully restart the service for you or do you get "unknown command"?Code: Select all
/usr/local/nagios/libexec/check_nrpe -H windows_server_ip_address -p 5666 -c restart_service -a service_name
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Using NRPE for windows server
@skypete, Well, we need to figure out what's wrong with the old service command. Please run these two commands:
And show me the output of both commands please, without this information I will not be able to figure out what's going on.
Code: Select all
service nagios restart
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.