nrpe[xxxxx]: Warning: Could not set effective GID

1.8k Views Asked by At

I could not get reason of Warning messages I am getting in /var/log/messages:

Apr 10 03:41:23 lsv-vm203 nrpe[85287]: Warning: Could not set effective GID=994
Apr 10 03:41:23 lsv-vm203 nrpe[85287]: Warning: Unable to change supplementary groups using initgroups()
Apr 10 03:41:23 lsv-vm203 nrpe[85287]: Warning: Could not set UID=997

Here is config I have:

# grep -E "nagios|nrpe" /etc/passwd
nagios:x:997:994::/var/spool/nagios:/bin/bash
nrpe:x:515:515:NRPE user for the NRPE service:/var/run/nrpe:/sbin/nologin
# grep -E "nagios|nrpe" /etc/group
nagios:x:994:apache,nrpe
nrpe:x:515:
# cat /etc/systemd/system/nrpe.service.d/override.conf
[Service]
User=nrpe
Group=nrpe
# ps auxw | grep -E "^nrpe"
nrpe      37083  0.0  0.0  57776  2920 ?        Ss   Feb23   2:13 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -f

I have no idea why nrpe is trying to set UID:GID to 997:994 (which is UID:GID of nagios user).

I am running Centos 7.9.2009

Although it does not affect anything (at least I could not see any issues), I do not like to keep it like this. Much appreciate for any ideas around it.

2

There are 2 best solutions below

1
On

nrpe had different UID:GUI configuration for systemd and in the nrpe.conf:

#cat nrpe.cfg
log_facility=daemon
pid_file=/var/run/nrpe/nrpe.pid
command_prefix=/usr/bin/time -p 2>&1
server_port=5666
nrpe_user=nagios
nrpe_group=nagios
debug=0
command_timeout=600
connection_timeout=300
include_dir=/etc/nagios/nrpe.d
dont_blame_nrpe=1

So it had collision

0
On

As Maxim self-answered, the issue can be caused by a mismatch in the nrpe_user or nrpe_group set in systemd and the NRPE config.

Systemd config:

  • /etc/systemd/system/multi-user.target.wants/nagios-nrpe-server.service

NRPE config in both:

  • /etc/nagios/nrpe_local.cfg
  • /etc/nagios/nrpe.cfg