Nagios NRPE on OS X Server 10.5

Recently I was tasked to install the Nagios add-on NRPE on two OS X 10.5 servers.

I read a little on the ‘net about it, but no one actually had much in the way of a walkthrough, so I thought I would fill the void.

The basic steps involve compiling the NRPE source, but doing so involves altering some of the code.

Prerequisites
  1. Mac OS X Developer Tools
Requirements
  1. NRPE source code
  2. Nagios Plugin source code
Setup the environment
  1. Install OS X Developer Tools
  2. Create the nagios user using Workgroup Manager
  3. Create the nagios group using Workgroup Manager
  4. Change the primary group for the nagios user to be nagios
Compile and Install the Nagios Plugins
  1. Open Terminal (/Applications/Utilities/Terminal.app)
  2. cd ~/Downloads/ - see note 1
  3. Extract the Nagios plugins source code tarball
    • tar xvf nagios-plugins-1.4.13.tar.gz
    • cd nagios-plugins-1.4.13
  4. Compile and install the plugins
    • ./configure
    • make
    • sudo make install
  5. Update the permissions on the directories
    • sudo chown nagios:nagios /usr/local/nagios
    • sudo chown -R nagios:nagios /usr/local/nagios/libexec
Compile and Install the NRPE daemon
  1. cd ~/Downloads/ - see note 1
  2. Extract the NRPE source code tarball
    • tar xvf nrpe-2.12.tar.gz
    • cd nrpe-2.12
  3. Update the configure file for Mac OS X compatibility
    • vim ./configure
    • on line 6673 change the text to read
      • if test -f “$dir/libssl.dylib”; then
  4. Compile the NRPE daemon
    • ./configure
    • make all
  5. Install the NRPE plugin, dameon and example config file
    • sudo make install-plugin
    • sudo make install-daemon
    • sudo make install-daemon-config

At this point you will have the NRPE daemon itself correctly installed.  To run it just execute the following in a terminal:

/usr/local/nagios/bin/nrpe -c path/to/config -d

This will start the daemon using your config file in daemon mode, instead of xinetd mode.

In order to get the daemon to startup at system boot you will need to create a launchd plist.  I will be writing this up for post later today.

8 thoughts on “Nagios NRPE on OS X Server 10.5

  1. Pingback: Starting NRPE via launchd

  2. Pingback: Links 001 - Nagios, Links, Linktipps, NRPE, Configuration, Tips, Monarch, Ethernetbox - NETWAYS Blog

  3. Pingback: Checking OS X services using Nagios

  4. Great Tutorial.

    One thing – you might want to note is that people may need to use the –with-nagios-user= and –with-nrpe-user= with their ./configure command if the nagios user they created isn’t named “nagios”. The same is true for the group.

  5. This is awesome – thank you for posting this article – I didn’t think that it would be this easy to OSX to properly listen with NRPE, though I guess looking back, it makes sense =)

    Surprised to see that it was only one line…

    One thing you might want to consider including – even though this isn’t mac specific – is that you need to add the “allowed hosts” bit. I thought of that as I was editing the config file… Most people would probably remember to do it – but if the first computer they tried to use NRPE with was a mac server, they’d be awful confused when they started getting SSL errors (or time outs, I can’t remember which is that one)

  6. Pingback: Tools for Monitoring Multiple Unix Based Systems - Admins Goodies

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">