Nagios: Monitoring Windows Machines with NRPE

by Mike on March 9, 2009 · 2 comments

in Nagios

The first step in setting up NRPE for Windows is to download a client for the Windows machine.  The best option that is easy to set up is NSClient++.

Download the NSCLient++ from http://sourceforge.net/projects/nscplus

This will provide a .zip file which you can unzip and it will provide the NSClient++-Win32-x.x.x folder.

Edit the NSC.ini file that is in the NSClient directory. Note that the file is divided by keywords placed in brackets.  First go to the [modules] section and  edit the checks that you want to use. Uncomment the lines that you see below.  The FileLogger.dll will log the activities of the NSClient++.  CheckDisk.dll will check for file size and hard disk use. The CheckSystem.dll will check for memory, uptime, service stats and processes.  You will also need to uncomment the NSClientListener.dll and the NRPEListener.dll in order to communicate with Nagios.

nagio2

[modules]
;# NSCLIENT++ MODULES
;# A list with DLLs to load at startup.
;  You will need to enable some of these for NSClient++ to work.
; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
; *                                                               *
; * N O T I C E ! ! ! – Y O U   H A V E   T O   E D I T   T H I S *
; *                                                               *
; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
FileLogger.dll
CheckSystem.dll
CheckDisk.dll
NSClientListener.dll
NRPEListener.dll
;SysTray.dll
CheckEventLog.dll
;CheckHelpers.dll
;CheckWMI.dll

Go to the global section, [Settings], and be sure to limit the access to the Windows server that you are going to monitor. Under the Allowed Hosts section enter the local host and any other connections that you want to enable.  These addresses will be separated by a comma.

allowed_hosts=127.0.0.1/32,192.168.5.50

Finally, under [NRPE] set your port that you will allow access to.

Port=5666

This of course assumes you will open port 5666 on the Windows machine.  If you can limit the access to this port only to the Nagios server for security.  If you see this output in your web interface make sure that port 5666 is open and that you have started the client.

Once you install you will have to make a note of the location of the install directory path.

Here is the contents of the directory.

nsclient2

On the Windows machine browse to the folder that was created for the NSClient++ and place that path in the run command and install the program.

C:\NSClient++-Win32-0.3.5\NSClient++.exe /install

You will see this security warning but continue the install.

nsclient1

Now start the program, note your path may be different.

C:\NSClient++-Win32-0.3.5\NSClient++.exe /start
In order to stop the program use this command.

C:\NSClient++-Win32-0.3.5\NSClient++.exe /stop

Once it is up an running check your connection.

/usr/lib/nagios/plugins/./check_nrpe -H 192.168.5.14
I (0.3.5.1 2008-09-24) seem to be doing fine…

If you errors you will need to correct them, use the log for locating the errors.  Once it is connected check your web interface for information.

win2

{ 2 comments }

Svein September 21, 2009 at 3:59 am

Hi,

I’m trying this out, but after installing Nsclient++ i don’t know how to connect the Nagios files. Also, when I downloaded Nagios and unrared it in to c:\nagios there’s no installastion file. Just a file that’s just a txt file. The directory c:\usr\local\nagios.. and so on, I had to create myself.

What I need help to how I can connect Nagios.cfg and Windows.cfg to Nsclient++.

If you answer I really thank you for your help!

Best regards

Svein

mike September 22, 2009 at 1:41 am

The only thing that you place on the Windows server is the NCClient ++ and edit the config file, open port 5666 and go to the command line and run the install command. Nagios goes on the Linux server and will connect to the Windows machine to monitor.

Previous post:

Next post: