Fixing Nagios NRPE server startup.

Users of the Nagios NRPE plugin will soon be finding that even when properly configured, it consistently fails to start on boot – even though it can be manually started later, and everything looks good.

The problem is that Nagios need to update their systemd startup unit files with the proper dependencies – to ensure the NRPE server isn’t started before the network is available.

Currently, the best solution is a systemd drop-in:

Create directory: /etc/systemd/system/nrpe.service.d
Create a new drop-in file, at /etc/systemd/system/nrpe.service.d/nrpe.conf

[Unit]
Requires=network-online.target
After=network-online.target

systemctl daemon-reload
systemctl restart nrpe

Now check the NRPE server status and you’ll see the service should be starting successfully, with the drop-in showing:


[root@voltaire 01-02 22:32:50 ~]# systemctl status nrpe
- nrpe.service - Nagios Remote Program Executor
Loaded: loaded (/usr/lib/systemd/system/nrpe.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/nrpe.service.d
|-nrpe.conf
Active: active (running) since Tue 2018-01-02 22:32:43 ACDT; 13s ago
Docs: http://www.nagios.org/documentation
Main PID: 1392 (nrpe)
CGroup: /system.slice/nrpe.service
|-1392 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
.
Jan 02 22:32:43 voltaire.ovirt.vorpal systemd[1]: Starting Nagios Remote Program Executor...
Jan 02 22:32:43 voltaire.ovirt.vorpal systemd[1]: Started Nagios Remote Program Executor.

You can see the drop-in has successfully loaded in the 3rd/4th lines of output above.

This should ensure the NRPE service starts successfully every time you reboot.