Installing NRPE on FreeBSD 9.0
Server - Nagios

 

Normally, we would recommend using the source code file from the Nagios site to install NRPE. However, with FreeBSD, there are at least two advantages to installing NRPE from the official FreeBSD ports.

First, the source code file in FreeBSD ports is already modified to work with FreeBSD. Second, FreeBSD ports contains many FreeBSD-specific plugins that can be used with the FreeBSD version of NRPE.

 

Installation

To begin, log into the FreeBSD server as the root user. (We normally advocate the use of "sudo", but sudo isn't installed on FreeBSD by default.) Then, cd into the "/usr/ports/net-mgmt/nrpe2" directory.

Installing NRPE on FreeBSD 9.0

 

Enter the command:

make install clean

 

You'll be presented with a screen that will allow you to choose compilation options for NRPE.

Installing NRPE on FreeBSD 9.0

 

For now, we'll leave both options disabled, and hit the Enter key to start the compilation process. In only a couple of moments, you'll be presented with a screenful of option choices for the NRPE plugins.

Installing NRPE on FreeBSD 9.0

 

We picked all choices, except for the jail option.

Installing NRPE on FreeBSD 9.0

 

Next, the "net-smnp" installation screen will come up, asking you to choose the appropriate options for it. (The options you see chosen here are already chosen by default.)

Installing NRPE on FreeBSD 9.0

 

Since we're doing this on a 64-bit version of FreeBSD, we also chose the option to build with 64-bit Interface Counters. You'll want to have patience with this part; it takes a while.

The next screen that comes up will ask you to choose options for the mysql client. Here, we left it with the default choices.

Installing NRPE on FreeBSD 9.0

 

Next, you'll be asked to choose the desired options for the postgre-sql client. We also left this with the default choices.

Installing NRPE on FreeBSD 9.0

 

After this, you'll be asked if you want to create the "nagios" user and "nagios" group. Hit the Enter key twice to say "YES" for each one.

Installing NRPE on FreeBSD 9.0

 

And now, NRPE and its plugins should be successfully compiled. Set the proper ownerships for the Nagios plugins directory.

Installing NRPE on FreeBSD 9.0

 

 

Configuration

In the "/usr/local/etc" directory, copy the "nrpe.cfg-sample" file to a file named "nrpe.cfg". Use the "chmod u+x nrpe.cfg" command to add write permissions for the root user.

Installing NRPE on FreeBSD 9.0

 

Open the file in a text editor, and look for the "allowed_hosts=127.0.0.1" line. Comment that line out, and add another line below it that points to the address of your Nagios server.

Installing NRPE on FreeBSD 9.0

 

In the "/etc/rc.conf" file, add a line to enable the nrpe2 daemon.

Installing NRPE on FreeBSD 9.0

 

Start the NRPE daemon.

Installing NRPE on FreeBSD 9.0

 

Be sure to open port 5666 tcp on the firewall. You've now completed the basic configuration of NRPE on the FreeBSD server. To test it, go back to your Nagios server and log in as the Nagios user. Enter the Nagios plugins directory, and try out some of the checks that are pre-defined in the FreeBSD "nrpe.cfg" file.

Installing NRPE on FreeBSD 9.0

Because we compiled the FreeBSD NRPE with SSL support, we'll have to create an NRPE command definition to specify that we don't want to use SSL. We'll do that by inserting the "-n" option switch.

Installing NRPE on FreeBSD 9.0

 

Configure the host and service definitions the same as you would with any other nrpe-type checks, and then restart the Nagios daemon.

Installing NRPE on FreeBSD 9.0

 

Installing NRPE on FreeBSD 9.0