Nagios – NRPE and Windows Hosts

I was using check_nt on my Windows monitoring setup but check_nt is actually quite outdated and limited as Mr Medin the creator of NSClient++ told me. He helpfully advised that I could use check_nrpe instead of check_nt. I’ve done some tests now and got the nrpe working. Also updated my nagios3 and nscp Puppet modules to include nrpe configurations.

Here’s and example of a service that monitors physical memory usage on windows host:

define service {
  use                  generic-service
  check_command        check_nrpe!CheckMEM!MaxWarn=80% MaxCrit=90% ShowAll type=physical
  service_description  Memory usage
  host_name            remote-windows-host
}

Testing

So I added the service above to my Nagios configuration.

Then checked the config for errors and restarted the nagios3 service:
sudo nagios3 -v /etc/nagios3/nagios.cfg
sudo service nagios3 restart

I didn’t change anything in my nsclient.ini yet as to see if it works on my current NSClient settings. Apparently my settings weren’t enough. Got this error message on my Nagios GUI:

UNKNOWN – Exception processing request: Request contained arguments (not currently allowed, check the allow arguments option).

So as it clearly states: Arguments are not currently allowed. All I needed to do was add these lines to my nsclient.ini

[/settings/NRPE/server]
allow arguments = true

You can see my updated nsclient.ini here.

There’s more settings that can be defined for NRPE server but I won’t cover them here as those were not needed in these tests.

Then I just restarted the NSClient++ service (nscp) on the Windows host.

If you get this or some other weird error on the Nagios GUI:
ERROR: Could not get value

Run this on your windows host:
lodctr /R

and reboot the machine.

As I said I’ve updated my nscp and nagios3 puppet modules to include configurations defined in this post.

You can find them both from our github:
nscp
nagios3

Sources
http://www.nsclient.org/nscp/wiki/doc/usage/nagios/nrpe
http://www.nsclient.org/nscp/wiki/CheckSystem/checkMem

2 responses to “Nagios – NRPE and Windows Hosts

  1. Cyril K Joy April 28, 2014 at 1:55 pm

    Thanks Henri Siponen,

    Your post was very helpful to me as i was struggling for a way to find out nagios to check for physical memory and i was stuck with this error.
    Now i got it working.

  2. Lowongan Kerja Terbaru Untuk Lulusan SMA October 1, 2014 at 6:33 am

    Hi I am so grateful I found your weblog, I really found you by mistake, while I was researching on Bing for something else,
    Nonetheless I am here now and would just like to say
    kudos for a remarkable post and a all round interesting blog (I also love
    the theme/design), I don’t have time to browse it all at the minute but
    I have saved it and also added your RSS feeds, so when I have time I will be back to read a
    great deal more, Please do keep up the awesome job.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: