Using NRPE for windows server

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: Using NRPE for windows server

Postby dwhitfield » Thu Feb 08, 2018 5:04 pm

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.
dwhitfield
Former Nagios Staff
 
Posts: 4568
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN

Re: Using NRPE for windows server

Postby skypete » Thu Feb 08, 2018 5:10 pm

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.
skypete
 
Posts: 42
Joined: Sat Dec 02, 2017 11:44 pm

Re: Using NRPE for windows server

Postby skypete » Thu Feb 08, 2018 5:12 pm

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.
skypete
 
Posts: 42
Joined: Sat Dec 02, 2017 11:44 pm

Re: Using NRPE for windows server

Postby kyang » Thu Feb 08, 2018 5:36 pm

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

Let me know if you run into any troubles.

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."
Capture.PNG


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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
kyang
Support Tech
 
Posts: 1510
Joined: Tue Jul 25, 2017 3:35 pm

Re: Using NRPE for windows server

Postby npolovenko » Fri Feb 09, 2018 10:45 am

Can you test this command from the Nagios server:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H windows_server_ip_address -p 5666 -c restart_service -a service_name

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"?
User avatar
npolovenko
Support Tech
 
Posts: 1319
Joined: Mon May 15, 2017 5:00 pm

Re: Using NRPE for windows server

Postby skypete » Fri Feb 09, 2018 1:28 pm

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
}
skypete
 
Posts: 42
Joined: Sat Dec 02, 2017 11:44 pm

Re: Using NRPE for windows server

Postby npolovenko » Fri Feb 09, 2018 2:40 pm

Hi i readded this command and rename it as the following in my cfg file it is not working nagios wont restart the service.

Please run this command and share the output in your next post:
Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg


Please run this command locally, from the command line and let me know if it suceeds:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H windows_server_ip_address -p 5666 -c restart_service -a service_name
User avatar
npolovenko
Support Tech
 
Posts: 1319
Joined: Mon May 15, 2017 5:00 pm

Re: Using NRPE for windows server

Postby skypete » Fri Feb 09, 2018 4:08 pm

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:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H windows_server_ip_address -p 5666 -c restart_service -a service_name

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"?
skypete
 
Posts: 42
Joined: Sat Dec 02, 2017 11:44 pm

Re: Using NRPE for windows server

Postby npolovenko » Mon Feb 12, 2018 12:13 pm

@skypete, Well, we need to figure out what's wrong with the old service command. Please run these two commands:
Code: Select all
service nagios restart

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

And show me the output of both commands please, without this information I will not be able to figure out what's going on.
User avatar
npolovenko
Support Tech
 
Posts: 1319
Joined: Mon May 15, 2017 5:00 pm

Re: Using NRPE for windows server

Postby skypete » Mon Feb 12, 2018 1:47 pm

Here you Go hope this helps.
Attachments
Capture1.PNG
skypete
 
Posts: 42
Joined: Sat Dec 02, 2017 11:44 pm

PreviousNext

Return to Nagios Core

Who is online

Users browsing this forum: skypete and 12 guests

cron