Using NRPE for windows server
Re: Using NRPE for windows server
Here you go also wanted to let you know it did not go into a critical state in nagios UI.
Last edited by skypete on Thu Feb 22, 2018 2:22 pm, edited 1 time in total.
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Using NRPE for windows server
@skypete, If the service on the windows server has been stopped and you waited 20 minutes but Nagios still shows that the process is running, then either your Nagios config is pointing to a wrong server or the process is still actually running. These are two scenarios I can think of.
So, on the windows server please open the command line and run:
And take a screenshot.
Then, run:
net stop spooler
Then open the services menu and take a screenshot of the PrintSpooler process so that we can make sure that it stopped. Then wait 10 minutes and check the Nagios web interface to see if the service check is red.
Also, run these commands:
So, on the windows server please open the command line and run:
Code: Select all
ipconfig
Then, run:
net stop spooler
Then open the services menu and take a screenshot of the PrintSpooler process so that we can make sure that it stopped. Then wait 10 minutes and check the Nagios web interface to see if the service check is red.
Also, run these commands:
Code: Select all
service nagios status
service httpd status
Code: Select all
service nagios restart
service httpd restart
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
ahh ok so when I ran service httpd restart i get a failed to restart httpd.service:unit httpd.service not found. When i try to start httpd service, i get this error Failed to start httpd.service: Unit httpd.service not found. Is there something else that needs to be installed in the nagios core server using Ubuntu 16.04 was there something i missed? and is this a crucial part of getting the service to automatically restart?
I followed this article by the way and thank you.
https://support.nagios.com/kb/article/n ... tml#Ubuntu
I followed this article by the way and thank you.
https://support.nagios.com/kb/article/n ... tml#Ubuntu
Re: Using NRPE for windows server
On Ubuntu and Debian that command should be:
Code: Select all
sudo systemctl restart apache2.service
Re: Using NRPE for windows server
Hi for sure it pointing to the correct server. i ran all the commands and still same issue. The service is completely stopped.
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Using NRPE for windows server
@skypete, Please stop the service one more time, then open the task manager in windows and make sure that there are no duplicate spooler processes running. After you made sure that the process is stopped go to the Nagios Core Web Interface, find the service check and click on Re-schedule the next check of this service. Wait a couple minutes and take a screenshot of the service state information page.
Also, you did not upload two screenshots that I asked for in the previous post.
Also, you did not upload two screenshots that I asked for in the previous post.
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
I waited 30 min and restart the service from the nagios UI same result. Here are the screenshots you asked for thanks for your help.
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Using NRPE for windows server
@skypete, I think I finally understand what's going on! Please open the /usr/local/nagios/etc/commands.cfg file and replace your current check_nrpe command definition with the following one:
You can also remove all testing lines from the event handler, including:
Restart nagios with:
Stop the spooler process and force check the process in Nagios GUI.
Code: Select all
# 'check_nrpe' command definition
define command {
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ -a $ARG2$ $ARG3$
}
Code: Select all
echo "/usr/local/nagios/libexec/check_nrpe -H \"$2\" -p 5666 -c restart_service -a \"$3\"" > testing.txt
and
echo "Event handler works!" > testing.txt
Code: Select all
service nagios restart
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 the good news the spooler finally showed up as critical but no restart as of yet. All the other services are not working such as cpu load etc the are showing up as unknown here is a screen shot.
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Using NRPE for windows server
Hello, @skypete. Please change the nrpe command back to:
And change the service command to:
Then restart nagios:
That should fix all the other service checks and get the spooler one to work as well.
Code: Select all
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
}
Code: Select all
define service {
host_name TESTSERVER1,TESTSERVER2
service_description Print Spooler
check_command check_nrpe!check_process!-a process=spoolsv.exe show-all
max_check_attempts 1
event_handler restart-service
check_interval 3
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
_SERVICE "spoolsv.exe"
}
Code: Select all
service nagios restart
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.