Page 1 of 2

Fullinstall script failing

Posted: Thu Oct 30, 2014 10:06 am
by Berto
Hello,

I have a project to evaluate Nagios as a possible replacement of the monitoring tool that is currently in use in our Linux/Solaris environment. I download the source install from here; http://library.nagios.com/library/produ ... loads/main
and read the documentation related to Nagios XI here; http://assets.nagios.com/downloads/nagi ... ctions.pdf. I built a fresh RHEL 6.4 server and all seemed to go good until I got this error;

Sorry, user root is not allowed to execute '/usr/bin/psql -c create user nagiosxi with password 'n@gweb';' as postgres on 'server'.
Sorry, user root is not allowed to execute '/usr/bin/psql -c create database nagiosxi owner nagiosxi;' as postgres on 'server'.

Not sure what to do next since I'm not very familiar with postgres.

Thanks,

Alberto

Re: Fullinstall script failing

Posted: Thu Oct 30, 2014 10:13 am
by lgroschen
Good morning Berto,

Did you run the installer as root? It might not be able to write the useradd and groupadd section as you can see repeated in your install.log:

Code: Select all

Complete!
Fixing php-mcrypt bug...
Prerequisites installed OK
Adding users and groups...
useradd: cannot create directory /home/nagios
groupadd: group 'nagcmd' already exists
usermod: user 'nagios' does not exist
usermod: user 'nagios' does not exist
ERROR: User 'nagios' was not created - exiting.
Nagios XI Installation Log
==========================
DATE: Wed Oct 29 20:43:22 EDT 2014

DISTRO INFO:
RedHatEnterpriseServer
6.4
x86_64

THIS IS A NEW INSTALL!

INSTALLING:
full=2014R1.5
major=2014
minor=R1.5
releasedate=2014-10-01
release=408

Yum already configured - exiting.
Prereqs already installed - skipping...
Note: If you want to update the RPMs installed on this system, run 'yum update'
Adding users and groups...
useradd: cannot create directory /home/nagios
groupadd: group 'nagios' already exists
usermod: user 'nagios' does not exist
usermod: user 'nagios' does not exist
ERROR: User 'nagios' was not created - exiting.
Nagios XI Installation Log
==========================
DATE: Wed Oct 29 20:48:54 EDT 2014

DISTRO INFO:
RedHatEnterpriseServer
6.4
x86_64

THIS IS A NEW INSTALL!

INSTALLING:
full=2014R1.5
major=2014
minor=R1.5
releasedate=2014-10-01
release=408

Yum already configured - exiting.
Prereqs already installed - skipping...
Note: If you want to update the RPMs installed on this system, run 'yum update'
Adding users and groups...
useradd: cannot create directory /home/nagios
groupadd: group 'nagios' already exists
groupadd: group 'nagcmd' already exists
usermod: user 'nagios' does not exist
usermod: user 'nagios' does not exist
ERROR: User 'nagios' was not created - exiting.

Re: Fullinstall script failing

Posted: Thu Oct 30, 2014 10:28 am
by Berto
Hello,

Thank you for the quick response and yes, I'm running the script as root. As you can see in the error it does say "Sorry, user root is not allowed to execute '/usr/bin/psql -c create user nagiosxi with password 'n@gweb';' as postgres on lnsvr0620

Re: Fullinstall script failing

Posted: Thu Oct 30, 2014 10:34 am
by lgroschen
Can you run this and include the command when you respond:

Code: Select all

groups postgres | cut -d':' -f2
It is possible that the CentOS 6.4 install you are using may have already had postgres installed and configured already. Is this install of CentOS an enterprise image with some pre-configured packages?

Re: Fullinstall script failing

Posted: Thu Oct 30, 2014 4:39 pm
by Berto
Hello,

I ran what you requested and this is what I got returned;

[root@lnsvr0620 nagiosxi]# groups postgres | cut -d':' -f2
postgres

This was a fresh build of RHEL 6.4 and it has pretty much the standard packages like sendmail, virt-manager, etc as we don't install all the packages that come with RHEL 6.4, so postgres package wouldn't have even been part of our kickstart. There are no pre-configured packages and i doubled check my kickstart file to make sure that was still valid.

Re: Fullinstall script failing

Posted: Fri Oct 31, 2014 11:37 am
by sreinhardt
The only two lines that would cause this are in nagiosxi/create_postgres.sh. They look like:

Code: Select all

sudo -u postgres psql -c "create user nagiosxi with password 'n@gweb';"
sudo -u postgres psql -c "create database nagiosxi owner nagiosxi;"
Since it is attempting to run as root, we likely have an issue with the postgres user.

Code: Select all

grep -i 'nag' /etc/group
grep -i 'posgres' /etc/group
grep -i 'posgres' /etc/passwd

Re: Fullinstall script failing

Posted: Fri Oct 31, 2014 11:46 am
by lgroschen
Berto,

I would definitely try this again on your system from the beginning. If you run the fullinstall and there errors and you keep running the install and or upgrade script on top of everything that has been done it won't be a dependable installation. Until you can run the fullinstall without any errrors the whole way through these kind of user and group writing problems surface.

Use your install log that you provided and check each stage where you had to make a change to get a section to run successfully. These changes should be done prior to running the install so that the install can run cleanly at one time.

I run a full installation of Nagios XI on CentOS 6.5 at least every other week for testing. The CentOS package I use is the minimal ISO file from the CentOS website and the installer runs cleanly every time on VM workstation. Running a VM to test the your install is very convenient with the ability to snapshot a VM and revert back to it before the installation ran so you can deal with issues.

Once you try this again come back and post your results and we make sure you get it installed and running- then monitor whatever you desire!

Good Luck,
Luke

Re: Fullinstall script failing

Posted: Sat Nov 01, 2014 1:32 pm
by Berto
I will try again the fullinstall on a clean system again and let you guys know what happens.

Re: Fullinstall script failing

Posted: Mon Nov 03, 2014 10:31 am
by cmerchant
Great, keep us posted.

Re: Fullinstall script failing

Posted: Wed Nov 05, 2014 8:21 pm
by Berto
Hello,

Well I was able to successfully run the fullinstall script! I decided to build a new server with RHEL6.5 (in our environment RHEL6.4 is our "standard") and after just getting an error about not being in the proper channel, i placed the server in the proper channel and the script went through with no hitches and was able to see the completion.

Berto