nrpe systemd socket activation

If you’re using nrpe socket activation and don’t have a template file, try this in /etc/systemd/system/nrpe@.service :

[Unit]
Description=nrpe socket service
Requires=nrpe.socket

[Service]
User=nrpe
ExecStart=-/usr/bin/nrpe -c /etc/nrpe/nrpe.cfg --inetd
StandardInput=socket
StandardOutput=inherit
StandardError=journal

[Install]
WantedBy=multi-user.target

You’ll also need /etc/systemd/system/nrpe.socket :

[Unit]
Description=Nagios Remote Plugin Executor
Documentation=http://www.nagios.org/documentation
Before=nrpe.service
Conflicts=nrpe.service

[Socket]
ListenStream=5666
Accept=yes

[Install]
WantedBy=sockets.target

Then

systemctl start nrpe.socket

Leave a Reply

Your email address will not be published. Required fields are marked *