Hi David,
I had the same issue and was able to replicate it.
The issue seems to be in the nrpe daemon . When I use the nrpe daemon to control the nrpe.cfg, the behaviour is the one as reported by you.
But when I use xinetd.d to control the nrpe.cfg file, the output is ok.
Below is the output :
$ sudo systemctl status nrpe.service
● nrpe.service - Nagios Remote Plugin Executor
Loaded: loaded (/usr/lib/systemd/system/nrpe.service; disabled; vendor preset: disabled)
Active: active (running) since Tue 2018-03-20 13:20:19 CET; 4s ago
Docs:
http://www.nagios.org/documentation
Process: 3727 ExecStopPost=/bin/rm -f /var/spool/nagios/nrpe.pid (code=exited, status=0/SUCCESS)
Main PID: 3731 (nrpe)
CGroup: /system.slice/nrpe.service
└─3731 /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -f
Mar 20 13:20:19 localhost systemd[1]: Started Nagios Remote Plugin Executor.
Mar 20 13:20:19 localhost systemd[1]: Starting Nagios Remote Plugin Executor...
Mar 20 13:20:19 localhost nrpe[3731]: Starting up daemon
Mar 20 13:20:19 localhost nrpe[3731]: Server listening on 0.0.0.0 port 5666.
Mar 20 13:20:19 localhost nrpe[3731]: Server listening on :: port 5666.
Mar 20 13:20:19 localhost nrpe[3731]: Listening for connections on port 5666
Mar 20 13:20:19 localhost nrpe[3731]: Allowing connections from: 127.0.0.1,::1
netstat -tnlp |grep 5666
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN 3731/nrpe
tcp6 0 0 :::5666 :::* LISTEN 3731/nrpe
$/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 -c check_disk
DISK OK - free space:
/var/tmp 12363 MB (64% inode=99%);| /var/tmp=6882MB;19166;19156;0;19246
##############################################################################
Now stopping nrpe daemon and configuring nrpe to be served by Xinetd:
##############################################################################
$ sudo systemctl status nrpe.service
● nrpe.service - Nagios Remote Plugin Executor
Loaded: loaded (/usr/lib/systemd/system/nrpe.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Docs:
http://www.nagios.org/documentation
Mar 20 13:20:19 localhost systemd[1]: Started Nagios Remote Plugin Executor.
Mar 20 13:20:19 localhost systemd[1]: Starting Nagios Remote Plugin Executor...
Mar 20 13:20:19 localhost nrpe[3731]: Starting up daemon
Mar 20 13:20:19 localhost nrpe[3731]: Server listening on 0.0.0.0 port 5666.
Mar 20 13:20:19 localhost nrpe[3731]: Server listening on :: port 5666.
Mar 20 13:20:19 localhost nrpe[3731]: Listening for connections on port 5666
Mar 20 13:20:19 localhost nrpe[3731]: Allowing connections from: 127.0.0.1,::1
Mar 20 13:24:12 localhost nrpe[3731]: Caught SIGTERM - shutting down...
Mar 20 13:24:12 localhost systemd[1]: Stopping Nagios Remote Plugin Executor...
Mar 20 13:24:12 localhost systemd[1]: Stopped Nagios Remote Plugin Executor.
$ sudo systemctl status xinetd.service
● xinetd.service - Xinetd A Powerful Replacement For Inetd
Loaded: loaded (/usr/lib/systemd/system/xinetd.service; disabled; vendor preset: enabled)
Active: active (running) since Tue 2018-03-20 13:25:03 CET; 29s ago
Process: 3843 ExecStart=/usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid $EXTRAOPTIONS (code=exited, status=0/SUCCESS)
Main PID: 3844 (xinetd)
CGroup: /system.slice/xinetd.service
└─3844 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid
Mar 20 13:25:03 localhost xinetd[3844]: removing daytime
Mar 20 13:25:03 localhost xinetd[3844]: removing discard
Mar 20 13:25:03 localhost xinetd[3844]: removing discard
Mar 20 13:25:03 localhost xinetd[3844]: removing echo
Mar 20 13:25:03 localhost xinetd[3844]: removing echo
Mar 20 13:25:03 localhost xinetd[3844]: removing tcpmux
Mar 20 13:25:03 localhost xinetd[3844]: removing time
Mar 20 13:25:03 localhost xinetd[3844]: removing time
Mar 20 13:25:03 localhost xinetd[3844]: xinetd Version 2.3.15 started with libwrap loadavg labeled-networking options compiled in.
Mar 20 13:25:03 localhost xinetd[3844]: Started working: 2 available services
$ sudo netstat -tnlp |grep 5666
tcp6 0 0 :::5666 :::* LISTEN 3844/xinetd
$ /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 -c check_disk
DISK OK - free space: / 12363 MB (64% inode=99%);| /=6882MB;19166;19156;0;19246