Nagios NRPE on OS X Server 10.5 | arfore dot com

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

%d bloggers like this: