Page 1 of 2
Unable to install nrpe-agent on server joined to ad domain
Posted: Mon Aug 17, 2015 7:50 am
by WillemDH
hello,
I seem to have issues installing the nrpe-agent on a CentOS 7 system which has been joined to our ad domain with realmd / SSSD.
Code: Select all
Prerequisites installed OK
RESULT=0
Running './2-usersgroups'...
Adding users and groups...
useradd: user 'nagios' already exists
useradd: user 'nagios' already exists
ERROR: User 'nagios' was not created - exiting.
RESULT=1
===================
INSTALLATION ERROR!
===================
Installation step failed - exiting.
Check for error messages in the install log (install.log).
If you require assistance in resolving the issue, please include install.log
in your communications with Nagios XI technical support.
The script that failed was: './2-usersgroups'
[root@srvdockerqa01 linux-nrpe-agent]# updatedb
[root@srvdockerqa01 linux-nrpe-agent]# ./fullinstall
============================
Nagios Linux Agent Installer
============================
This script will install the Nagios Linux Agent by executing all necessary
sub-scripts.
IMPORTANT: This script should only be used on a clean installed system:
RedHat Enterprise, CentOS, Fedora, or Oracle
OpenSUSE or SUSE Enterprise
Ubuntu or Debian
Do NOT use this on a system running any other distro or that
does not allow additional package installation.
Do you want to continue? [Y/n] Y
Proceeding with installation...
Running './0-repos'...
Repos already configured - exiting.
RESULT=0
Running './1-prereqs'...
Prereqs already installed - skipping...
RESULT=0
Running './2-usersgroups'...
Adding users and groups...
useradd: user 'nagios' already exists
groupadd: group 'nagios' already exists
useradd: user 'nagios' already exists
groupadd: group 'nagcmd' already exists
ERROR: User 'nagios' was not created - exiting.
RESULT=1
===================
INSTALLATION ERROR!
===================
Installation step failed - exiting.
it somehow complains a nagios user already exists, but in fact it doesn't. It is not in /etc/passwd
When I try to
Code: Select all
userdel nagios
userdel: cannot remove entry 'nagios' from /etc/passwd
Any hint how to get the nrpe-agent installed on this system? This is the procedure I used to add the CentOS 7 server to the domain:
http://outsideit.net/realmd-and-sssd-ad-authentication/
There is no user 'nagios' in our ad domain, so I'm not sure what's going wrong.
Grtz
Re: Unable to install nrpe-agent on server joined to ad doma
Posted: Mon Aug 17, 2015 12:08 pm
by hsmith
WillemDH wrote:hello,
I seem to have issues installing the nrpe-agent on a CentOS 7 system which has been joined to our ad domain with realmd / SSSD.
Code: Select all
Prerequisites installed OK
RESULT=0
Running './2-usersgroups'...
Adding users and groups...
useradd: user 'nagios' already exists
useradd: user 'nagios' already exists
ERROR: User 'nagios' was not created - exiting.
RESULT=1
===================
INSTALLATION ERROR!
===================
Installation step failed - exiting.
Check for error messages in the install log (install.log).
If you require assistance in resolving the issue, please include install.log
in your communications with Nagios XI technical support.
The script that failed was: './2-usersgroups'
[root@srvdockerqa01 linux-nrpe-agent]# updatedb
[root@srvdockerqa01 linux-nrpe-agent]# ./fullinstall
============================
Nagios Linux Agent Installer
============================
This script will install the Nagios Linux Agent by executing all necessary
sub-scripts.
IMPORTANT: This script should only be used on a clean installed system:
RedHat Enterprise, CentOS, Fedora, or Oracle
OpenSUSE or SUSE Enterprise
Ubuntu or Debian
Do NOT use this on a system running any other distro or that
does not allow additional package installation.
Do you want to continue? [Y/n] Y
Proceeding with installation...
Running './0-repos'...
Repos already configured - exiting.
RESULT=0
Running './1-prereqs'...
Prereqs already installed - skipping...
RESULT=0
Running './2-usersgroups'...
Adding users and groups...
useradd: user 'nagios' already exists
groupadd: group 'nagios' already exists
useradd: user 'nagios' already exists
groupadd: group 'nagcmd' already exists
ERROR: User 'nagios' was not created - exiting.
RESULT=1
===================
INSTALLATION ERROR!
===================
Installation step failed - exiting.
it somehow complains a nagios user already exists, but in fact it doesn't. It is not in /etc/passwd
When I try to
Code: Select all
userdel nagios
userdel: cannot remove entry 'nagios' from /etc/passwd
Any hint how to get the nrpe-agent installed on this system? This is the procedure I used to add the CentOS 7 server to the domain:
http://outsideit.net/realmd-and-sssd-ad-authentication/
There is no user 'nagios' in our ad domain, so I'm not sure what's going wrong.
Grtz
Hi Willem,
I just installed this on a fresh CentOS 7 machine following your instructions ( nice guide, btw

)
It chimed at me that the user and group already existed, however it did not abort the script.
It in fact made the user and groups just fine...
You checked the actual files themselves to see if they are in there?
What happens if you edit out the './2-usersgroups' from the ./fullinstall file?
Re: Unable to install nrpe-agent on server joined to ad doma
Posted: Mon Aug 17, 2015 1:30 pm
by WillemDH
Hey,
This machine I was trying to install the nrep agent on is actually also a very new system. It has been used for about three weeks to test Docker containers on. In my case it did abort the script. I check and could not find any nagios user. (didn't check groups) What do you mean with
You checked the actual files themselves to see if they are in there?
I will try to edit out the './2-usersgroups' from the ./fullinstall file tomorrow, but I fear, as the user does not exist, the rest of the script will fail too somehow. I'll let you know how it goes.
Grtz
Willem
Re: Unable to install nrpe-agent on server joined to ad doma
Posted: Mon Aug 17, 2015 1:53 pm
by ssax
Just for good measure, please post the output of these commands:
Code: Select all
grep nag /etc/group
grep nag /etc/passwd
I was unable to replicate it as well, what does your /etc/nsswitch.conf say for passwd and group?
Code: Select all
grep "passwd\|group" /etc/nsswitch.conf
You could always manually add the /etc/passwd and /etc/group entries and then you can just run this command in the linux-nrpe-agent install directory to skip user/group creation:
Re: Unable to install nrpe-agent on server joined to ad doma
Posted: Fri Sep 04, 2015 8:54 am
by WillemDH
Before using installed.usersgroups:
Code: Select all
grep nag /etc/group
nagios:x:1002:nagios
nagcmd:x:1003:nagios
Code: Select all
grep "passwd\|group" /etc/nsswitch.conf
#passwd: db files nisplus nis
#group: db files nisplus nis
passwd: files sss
group: files sss
#initgroups: files
netgroup: files sss
After creating installed.usersgroups I was able to continue the installation.
I seem to have one more issue, I would think it has something to do with systemctl, as I cloned the services from a CentOS 6 server.
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H server -t 120 -c check_init_service -a 'sshd'
OUTPUT: NRPE: Unable to read output
Thanks.
Re: Unable to install nrpe-agent on server joined to ad doma
Posted: Fri Sep 04, 2015 10:46 am
by tgriep
Can you run the check_init_service command on the remote system and get a valid output?
The check_nrpe plugin returns "NRPE: Unable to read output"
This error indicates that the command that was run by the NRPE daemon did not return any character output.
This could be an indication of the following problems:
– An incorrectly defined command line in the command definition. Verify that the command definition in your
NRPE configuration file is correct.
– The plugin that is specified in the command line is malfunctioning. Run the command line manually to make
sure the plugin returns some kind of text output.
Re: Unable to install nrpe-agent on server joined to ad doma
Posted: Mon Sep 07, 2015 8:13 am
by WillemDH
Tom,
This is the result of the check on this particular CentOS 7 system
Code: Select all
/usr/local/nagios/libexec/check_init_service sshd
Redirecting to /bin/systemctl status sshd.service
sshd.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled)
Active: active (running) since Tue 2015-08-04 11:09:01 CEST; 1 months 3 days ago
Main PID: 1269 (sshd)
CGroup: /system.slice/sshd.service
└─1269 /usr/sbin/sshd -D
The same check on a CentOS 6 system:
Code: Select all
/usr/local/nagios/libexec/check_init_service sshd
openssh-daemon (pid 1415) is running...
Grtz
Willem
Re: Unable to install nrpe-agent on server joined to ad doma
Posted: Tue Sep 08, 2015 9:29 am
by tgriep
The output for Centos7 isn't compatible for that check. I found this replacement if you would like to try this instead.
https://exchange.nagios.org/directory/P ... ce/details
Re: Unable to install nrpe-agent on server joined to ad doma
Posted: Tue Sep 08, 2015 9:43 am
by tgriep
Actually, you can make the old command work if you remove the sudo from the check_init_service test.
Edit /usr/local/nagios/etc/nrpe.cfg file and change this from
Code: Select all
command[check_init_service]=sudo /usr/local/nagios/libexec/check_init_service $ARG1$
to
Code: Select all
command[check_init_service]=/usr/local/nagios/libexec/check_init_service $ARG1$
Save the file and restart xinetd and see if that works for you.
Re: Unable to install nrpe-agent on server joined to ad doma
Posted: Wed Sep 09, 2015 3:50 am
by WillemDH
Tom,
That did the trick. Please close this thread.
Grtz and tx.
Willem