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 skypete » Wed Feb 21, 2018 5:49 pm

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

Re: Using NRPE for windows server

Postby npolovenko » Thu Feb 22, 2018 1:36 pm

@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:
Code: Select all
ipconfig

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.
Untitled.png


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.
npolovenko
Support Tech
 
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Using NRPE for windows server

Postby skypete » Thu Feb 22, 2018 2:21 pm

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

Re: Using NRPE for windows server

Postby bolson » Thu Feb 22, 2018 3:55 pm

On Ubuntu and Debian that command should be:

Code: Select all
sudo systemctl restart apache2.service
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Brian Olson
Nagios Support Team
---
Nagios Enterprises, LLC
Email: customersupport@nagios.com
Web: https://www.nagios.com/
bolson
The Closer
 
Posts: 777
Joined: Tue Jul 11, 2017 10:34 am

Re: Using NRPE for windows server

Postby skypete » Fri Feb 23, 2018 9:08 am

Hi for sure it pointing to the correct server. i ran all the commands and still same issue. The service is completely stopped.
skypete
 
Posts: 98
Joined: Sat Dec 02, 2017 11:44 pm

Re: Using NRPE for windows server

Postby npolovenko » Fri Feb 23, 2018 1:56 pm

@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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
npolovenko
Support Tech
 
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Using NRPE for windows server

Postby skypete » Fri Feb 23, 2018 3:03 pm

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.
Attachments
Services Stopped.PNG
Service Status.PNG
skypete
 
Posts: 98
Joined: Sat Dec 02, 2017 11:44 pm

Re: Using NRPE for windows server

Postby npolovenko » Fri Feb 23, 2018 3:59 pm

@skypete, I think I finally understand what's going on! :D Please open the /usr/local/nagios/etc/commands.cfg file and replace your current check_nrpe command definition with the following one:

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$
    }


You can also remove all testing lines from the event handler, including:
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


Restart nagios with:
Code: Select all
service nagios restart


Stop the spooler process and force check the process in Nagios GUI.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
npolovenko
Support Tech
 
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Using NRPE for windows server

Postby skypete » Fri Feb 23, 2018 4:57 pm

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.
Attachments
Unkown errors.PNG
skypete
 
Posts: 98
Joined: Sat Dec 02, 2017 11:44 pm

Re: Using NRPE for windows server

Postby npolovenko » Mon Feb 26, 2018 2:12 pm

Hello, @skypete. Please change the nrpe command back to:

Code: Select all
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
}


And change the service command to:

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"
    }


Then restart nagios:
Code: Select all
service nagios restart


That should fix all the other service checks and get the spooler one to work as well.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
npolovenko
Support Tech
 
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

PreviousNext

Return to Nagios Core

Who is online

Users browsing this forum: benjaminsmith, hpzaramk and 33 guests