Page 2 of 3

Re: Nagios XI database was not setup properly error

Posted: Mon Aug 03, 2015 10:13 am
by lmiltchev
Creating role and database...
Sorry, user root is not allowed to execute...
Have you modified the sudoers file in any way? Can you show us the output of the command below?

Code: Select all

grep root /etc/sudoers | grep -v '^#'

Re: Nagios XI database was not setup properly error

Posted: Mon Aug 03, 2015 12:02 pm
by Berto
Here is the requested output.

[root@lnsvr0615 nagiosxi]# grep root /etc/sudoers | grep -v '^#'
root ALL=(ALL) ALL

Re: Nagios XI database was not setup properly error

Posted: Mon Aug 03, 2015 4:51 pm
by ssax
Please attach a full sanitized copy of your /etc/sudoers file.

Re: Nagios XI database was not setup properly error

Posted: Mon Aug 03, 2015 5:37 pm
by Berto
Here is the requested file. Also, our environment uses LDAP for sudo so if your needing any of those files please let me know.

I had to add a .txt to the end of the file as uploading errors about the extension.

--Berto

Re: Nagios XI database was not setup properly error

Posted: Tue Aug 04, 2015 9:28 am
by lmiltchev
Also, our environment uses LDAP for sudo so if your needing any of those files please let me know.
This may be the reason why the installer script fails. It seems like the script chokes on "/tmp/nagiosxi/nagiosxi/create_postgres_db.sh" script, which runs:

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;
Can you run the following commands and show the output?

Code: Select all

grep postgres /etc/passwd
grep postgres /etc/group

Re: Nagios XI database was not setup properly error

Posted: Tue Aug 04, 2015 9:53 am
by Berto
Here is the requested output.

[root@lnsvr0615 ~]# grep postgres /etc/passwd
postgres:x:26:26:PostgreSQL Server:/var/lib/pgsql:/bin/bash
[root@lnsvr0615 ~]# grep postgres /etc/group
postgres:x:26:

Re: Nagios XI database was not setup properly error

Posted: Tue Aug 04, 2015 10:51 am
by jdalrymple
Berto,

A couple of suggestions...

1) Can you just `sudo su - postgres` to get a shell as the postgres user then run the 2 commands:

Code: Select all

psql -c "create user nagiosxi with password 'n@gweb';"
psql -c "create database nagiosxi owner nagiosxi;
Then edit /tmp/nagiosxi/nagiosxi/create_postgres_db.sh to comment out those bits:

Code: Select all

#!/bin/sh

# sudo -u postgres psql -c "create user nagiosxi with password 'n@gweb';"
# sudo -u postgres psql -c "create database nagiosxi owner nagiosxi;"
Then try to run fullinstall again.

2) Can you show us your /etc/nsswitch.conf?

Re: Nagios XI database was not setup properly error

Posted: Tue Aug 04, 2015 11:37 am
by Berto
I have uploaded the request file. I sudo to postgres and did as requested but not being to familiar with postgres, on the second command I get the following prompt back;

-bash-4.1$ psql -c "create database nagiosxi owner nagiosxi;
>

Thinking of just needing to quit I did \q but I still get the same prompt, is there something I else I should be doing?

--Berto

Re: Nagios XI database was not setup properly error

Posted: Tue Aug 04, 2015 11:40 am
by Berto
Running the fullinstall script again, I now get this error.

Checking PostgresQL status...
PostgresQL running - continuing...
Creating role and database...
User 'nagiosxi' created successfully.
ERROR: PostgresQL 'nagiosxi' database was not created - exiting.
ERROR: Nagios XI database was not setup properly - exiting.

--Berto

Re: Nagios XI database was not setup properly error

Posted: Tue Aug 04, 2015 12:11 pm
by jdalrymple
Berto wrote:psql -c "create database nagiosxi owner nagiosxi;
You forgot the close quote (")