Page 1 of 1

nrpe systemd service showing started but not listening 5666

Posted: Tue Jul 21, 2020 4:57 pm
by praveenreddy544
Hello,

I am seeing nrpe systemd service having issue. I have nrpe.cfg and systemd nrpe service installed, but when trying to start service its not listening on port 5666. Below is my nrpe.cfg

###### nrpe.cfg ####

cat /usr/local/nagios/etc/nrpe.cfg

log_facility=daemon
log_file=/usr/local/nagios/var/nrpe.log
debug=0
pid_file=/usr/local/nagios/var/nrpe.pid
server_port=5666
nrpe_user=nagios
nrpe_group=nagiosg
allowed_hosts=127.0.0.1
dont_blame_nrpe=1
allow_bash_command_substitution=0
command_timeout=60
connection_timeout=300

command[check_load]=/usr/lib64/nagios/plugins/check_load -r -w 2.15,2.10,2.05 -c 3.30,3.25,3.20
command[check_root]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /
command[check_usr]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /usr
command[check_tmp]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /tmp
command[check_home]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /home
command[check_var]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /var
command[check_opt]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /opt
command[check_varlog]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /var/log
command[check_varcrash]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /var/crash
command[check_vartmp]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /var/tmp
command[check_varlogaudit]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /var/log/audit
command[check_server_mem]=/usr/lib64/nagios/plugins/customized_check_mem.sh
command[check_swap]=/usr/lib64/nagios/plugins/check_swap -w 20% -c 10%
command[check_opt_nagios]=/usr/lib64/nagios/plugins/check_disk -w 30% -c 20% -p /opt/nagios

2) content of systemd nrpe service

[root@prvabatt5210 var]# egrep -v '#' /usr/lib/systemd/system/nrpe.service
[Unit]
Description=Nagios Remote Plugin Executor
Documentation=http://www.nagios.org/documentation
After=var-run.mount nss-lookup.target network.target local-fs.target time-sync.target
Before=[email protected] plymouth-quit.service xdm.service
Conflicts=nrpe.socket

[Install]
WantedBy=multi-user.target

[Service]
Type=simple
Restart=on-abort
PIDFile=/usr/local/nagios/var/nrpe.pid
RuntimeDirectory=nrpe
RuntimeDirectoryMode=0755
ExecStart=/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -f
ExecReload=/bin/kill -HUP $MAINPID
ExecStopPost=/bin/rm -f /usr/local/nagios/var/nrpe.pid
TimeoutStopSec=60
User=nagios
Group=nagiosg
PrivateTmp=true
OOMScoreAdjust=-500

I am using nagios, nagiosg group which are present and same setup is working fine in other servers, but there are some servers having this issue.

3) [root@prvabatt5210 var]# systemctl status -l nrpe
● nrpe.service - Nagios Remote Plugin Executor
Loaded: loaded (/usr/lib/systemd/system/nrpe.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2020-07-21 21:39:21 UTC; 17min ago
Docs: http://www.nagios.org/documentation
Main PID: 1202 (nrpe)
CGroup: /system.slice/nrpe.service
└─1202 /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -f

Jul 21 21:39:21 prvabatt5210 systemd[1]: Started Nagios Remote Plugin Executor.
Jul 23 17:58:29 prvabatt5210 nrpe[1202]: Starting up daemon

4) [root@prvabatt5210 var]# netstat -tulpan |grep 5666

I am running rhel 7.8 version

Re: nrpe systemd service showing started but not listening 5

Posted: Fri Jul 24, 2020 10:48 am
by praveenreddy544
Appreciate if someone can look into this issue.

For some reason, nrpe shows starting daemon but it never starts listening on default port and there is no process being started although systemd nrpe service is started.

Re: nrpe systemd service showing started but not listening 5

Posted: Fri Jul 24, 2020 12:25 pm
by praveenreddy544
Closing this issue and we found that other time travel pkg was causing issue for nrpe service to be starting.