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.

Related posts

This entry was posted in work and tagged , , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

3 Comments

  1. Jonas
    Posted October 30, 2008 at 4:38 am | Permalink
  2. Jan
    Posted February 8, 2010 at 11:49 am | Permalink

    Thanks!

  3. Gary
    Posted March 8, 2010 at 3:44 pm | Permalink

    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.

3 Trackbacks

  1. By Starting NRPE via launchd on October 12, 2008 at 12:33 pm

    [...] WordPress.org ← Nagios NRPE on OS X Server 10.5 [...]

  2. [...] Installing Nagios NRPE on OS X Server 10.5 [...]

  3. By Checking OS X services using Nagios on November 7, 2008 at 9:30 am

    [...] last two posts, Starting NRPE via launchd and Nagios NRPE on OS X Server 10.5, concerned getting NRPE to run on OS X Server 10.5 and having it startup at system [...]

Post a Comment

Your email is never published nor shared. 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="">