Fail to initialize PostgresQL during Nagios XI installation

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
xlin125
Posts: 172
Joined: Mon Jan 19, 2015 6:01 pm

Fail to initialize PostgresQL during Nagios XI installation

Post by xlin125 »

We tried to install Nagios XI server 2014R2.7 on a Redhat 6.7 system. Due to the company policy, any non-individual accounts have to be created in /home directory with shell set to /sbin/nologin before running "fullinstall" to install the Nagios XI server. This is a clean system. So the following groups and accounts were created before running "fullinstall" and installing all prereqs:
These accounts for Nagios XI are shown in /etc/passwd:
nagios:x:80410:100:,SHELL=/bin/bash:/home/nagios:/sbin/nologin
apache:x:33910:1800:,SHELL=/bin/bash:/home/apache:/sbin/nologin
postgres:x:76473:91:,SHELL=/bin/bash:/home/postgres:/sbin/nologin
mysql:x:32270:8592:,SHELL=/bin/bash:/home/mysql:/sbin/nologin
ajaxterm:x:357870:490:,SHELL=/bin/bash:/home/ajaxterm:/sbin/nologin

in /etc/group:
nagios:x:32966:nagios,apache
nagcmd:x:32965:nagios,apache
apache:x:1800:
postgres:x:91:
mysql:x:8592:
ajaxterm:x:490:

Then, we ran the "fullinstall". The installation failed when initializing PostgresQL. The following is the install.log:
Nagios XI Installation Log
==========================
DATE: Mon Jan 18 18:27:12 EST 2016

DISTRO INFO:
RedHatEnterpriseServer
6.7
x86_64

THIS IS A NEW INSTALL!

INSTALLING:
full=2014R2.6
major=2014
minor=R2.7
releasedate=2015-04-23
release=416

Repos already configured - exiting.
Prereqs already installed - skipping...
Note: If you want to update the RPMs installed on this system, run your package manager's update command
Adding users and groups...
useradd: user 'nagios' already exists
groupadd: group 'nagios' already exists
groupadd: group 'nagcmd' already exists
Users and groups added OK
PostgresQL installed OK - continuing...
Initializing PostgresQL...
Starting PostgresQL...

/var/lib/pgsql/data is missing. Use "service postgresql initdb" to initialize the cluster first.
[FAILED]
ERROR: Could not start PostgresQL - exiting.
--------------

Previously, I installed Nagios XI 2014R2.7 on the systems that do not require these accounts be created first before running "fullinstall". In all these cases, Nagios XI 2014R2.7 was installed on these systems successfully. This is the first time we were asked to create these accounts and groups first before installing the Nagios XI, and the installation failed when setting up the PostgreSQL (Initializing PostgresQL).

Can you help look into this problem and provide a solution for this problem? It is very urgent to get this problem resolved. Thanks!
xlin125
Posts: 172
Joined: Mon Jan 19, 2015 6:01 pm

Re: Fail to initialize PostgresQL during Nagios XI installat

Post by xlin125 »

I found out when initializing PostgreSQL, it requires su -l postgres. So once I changed the shell from /bin/nologin to /bin/bash for postgres account, the setup for PostgreSQl went well. I changed the shell to /bin/bash for mysql and ajaxterm too. So with these changes, I was able to install the Nagios XI on this system.
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Fail to initialize PostgresQL during Nagios XI installat

Post by bwallace »

Thanks for sharing the solution, we'll go ahead and lock this thread now --
Be sure to check out the Knowledgebase for helpful articles and solutions!
Locked