Nagios XI database was not setup properly error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios XI database was not setup properly error

Post 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 '^#'
Be sure to check out our Knowledgebase for helpful articles and solutions!
Berto
Posts: 162
Joined: Tue Jul 01, 2014 6:12 pm

Re: Nagios XI database was not setup properly error

Post by Berto »

Here is the requested output.

[root@lnsvr0615 nagiosxi]# grep root /etc/sudoers | grep -v '^#'
root ALL=(ALL) ALL
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios XI database was not setup properly error

Post by ssax »

Please attach a full sanitized copy of your /etc/sudoers file.
Berto
Posts: 162
Joined: Tue Jul 01, 2014 6:12 pm

Re: Nagios XI database was not setup properly error

Post 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
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios XI database was not setup properly error

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
Berto
Posts: 162
Joined: Tue Jul 01, 2014 6:12 pm

Re: Nagios XI database was not setup properly error

Post 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:
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Nagios XI database was not setup properly error

Post 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?
Berto
Posts: 162
Joined: Tue Jul 01, 2014 6:12 pm

Re: Nagios XI database was not setup properly error

Post 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
You do not have the required permissions to view the files attached to this post.
Berto
Posts: 162
Joined: Tue Jul 01, 2014 6:12 pm

Re: Nagios XI database was not setup properly error

Post 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
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Nagios XI database was not setup properly error

Post by jdalrymple »

Berto wrote:psql -c "create database nagiosxi owner nagiosxi;
You forgot the close quote (")
Locked