This HOWTO will give you the tools you need to monitor a FreeBSD 12 server using NRPEv3. The following has only been tested on FreeBSD 12, using OP5 Monitor 7.4.1, but it could work on other versions as well.
Using FreeBSD 12, do the following:
- Install net-mgmt/nrpe3 from the ports collection, using your preferred method. We will use the binary package in this example.
- Edit the nrpe configurations file /usr/local/etc/nrpe.cfg and modify the following line:
Add any ip that will be connecting. If you are running a single Monitor node, then use that IP. If you are using a distributed system, make sure to add the IP:s of all nodes that will connect. In my case, it looks like this:
Add a custom configuration file to include:
Create the directory:
Create the configuration file with the following contents:
Create a directory for custom nrpe check commands:
Download a couple of custom open source check plugins and put the in the previously created folder /usr/local/libexec/nagios/custom:
Enable and start the NRPE3 service:
Now you can create your own services in the Monitor GUI using the pre-defined checks above! Use check_nrpe as the check_command, and put the name of the commands as arguments. An example below:
Note that the current configuration will not work with systems where security.bsd.see_other_uids OR security.bsd.see_other_gids is set to 0. This is valid for all tests that includes checking the status of a process.