[SOLVED] Enabling nrpe

Started by whitwye, August 08, 2017, 10:02:30 PM

Previous topic - Next topic
August 08, 2017, 10:02:30 PM Last Edit: August 10, 2017, 04:11:19 PM by franco
SInce we use Nagios extensively to track system health, I'm getting nrpe going. It's a fine thing to see so many packages available, especially after trying pfSense, which has cut itself off from standard FreeBSD packages! (Yes, pfSense has nrpe as part of it, but the interface page for it is crude.)

The pkg installation presents this message:
Quote
**********************************************************************

Enable NRPE in /etc/rc.conf with the following line:

   nrpe2_enable="YES"

A sample configuration is available in /usr/local/etc/nrpe.cfg.sample.
Copy to nrpe.cfg where required and edit to suit your needs.

**********************************************************************

What's the equivalent thing to do on OPNsense, which lacks the /etc/rc.conf file? Create /etc/rc.conf? Add that to /etc/defaults/rc.conf? It looks from this like maybe /etc/rc.conf is required:

Quoteroot@OPNsense:/usr/local/etc/rc.d # more nrpe2
#!/bin/sh

# $FreeBSD$
#
# PROVIDE: nrpe2
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable nrpe2:
# nrpe2_enable (bool):    Set to "NO" by default.
#                         Set it to "YES" to enable nrpe2.
# nrpe2_flags (str):      Not set by default.
# nrpe2_configfile (str): Set to "/usr/local/etc/nrpe.cfg" by default.
...

Is there a doc page somewhere that covers running available FreeBSD packages on OPNsense?

We've written a bit of glue that makes it possible to use the packages like FreeBSD mandates.

Create /etc/rc.conf and/or /etc/rc.conf.local to add your variables for services from packages. They should auto-start on the next boot.


Cheers,
Franco

Lovely. Thanks!

Is there syntax that works for starting and stopping such services without rebooting? For nrpe, for instance, I guess I can "kill -HUP" it when I add to its config, but there must be a more "friendly" command. I wouldn't want to have to bounce the whole system. I'm sure the FreeBSD docs can give me the standard commands to start, stop and reload services. Should those just work, or require rephrasing?

Ah ha! Once in /etc/rc.conf, "service nrpe2 start" works! Perfect.