Page 1 of 1

Nagios Portal Down

Posted: Wed Jan 13, 2016 7:22 pm
by raamardhani7
Hi Team,

Can someone help me on priority as our Nagios portal is down.

Code: Select all

tail -f /var/log/httpd/error_log
[Wed Jan 13 18:20:05 2016] [error] [client 10.10.83.91] PHP Notice:  Undefined variable: result in /usr/local/nagiosxi/html/includes/db.inc.php on line 249
[Wed Jan 13 18:20:05 2016] [error] [client 10.10.83.91] PHP Warning:  pg_pconnect(): Unable to connect to PostgreSQL server: could not connect to server: No such file or directory\n\tIs the server running locally and accepting\n\tconnections on Unix domain socket "/tmp/.s.PGSQL.5432"? in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-postgres64.inc.php on line 682
[Wed Jan 13 18:20:05 2016] [error] [client 10.10.83.91] PHP Notice:  Undefined variable: result in /usr/local/nagiosxi/html/includes/db.inc.php on line 249
[Wed Jan 13 18:20:05 2016] [error] [client 10.10.83.91] PHP Warning:  pg_pconnect(): Unable to connect to PostgreSQL server: could not connect to server: No such file or directory\n\tIs the server running locally and accepting\n\tconnections on Unix domain socket "/tmp/.s.PGSQL.5432"? in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-postgres64.inc.php on line 682
[Wed Jan 13 18:20:05 2016] [error] [client 10.10.83.91] PHP Notice:  Undefined variable: result in /usr/local/nagiosxi/html/includes/db.inc.php on line 249
[Wed Jan 13 18:20:05 2016] [error] [client 10.10.83.91] PHP Warning:  pg_pconnect(): Unable to connect to PostgreSQL server: could not connect to server: No such file or directory\n\tIs the server running locally and accepting\n\tconnections on Unix domain socket "/tmp/.s.PGSQL.5432"? in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-postgres64.inc.php on line 682
[Wed Jan 13 18:20:05 2016] [error] [client 10.10.83.91] PHP Notice:  Undefined variable: result in /usr/local/nagiosxi/html/includes/db.inc.php on line 249
[Wed Jan 13 18:20:05 2016] [error] [client 10.10.83.91] PHP Warning:  pg_pconnect(): Unable to connect to PostgreSQL server: could not connect to server: No such file or directory\n\tIs the server running locally and accepting\n\tconnections on Unix domain socket "/tmp/.s.PGSQL.5432"? in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-postgres64.inc.php on line 682
On portal I am getting this below error.

Code: Select all

Message: A database connection error has been detected, we are attempting to repair the server, if the repair does not resolve the issue, please contact Nagios support.

Run the following from the CLI as root to attempt to repair the DB

/usr/local/nagiosxi/scripts/repair_databases.sh
I ran the repair script, but no luck.. Could you please help me with this, thanks.

Re: Nagios Portal Down

Posted: Wed Jan 13, 2016 7:27 pm
by Box293
Can you try this and let us know if it fixes the problem:

Code: Select all

service postgresql stop
su postgres
echo "VACUUM FULL;" > /tmp/fix.sql
postgres -D /var/lib/pgsql/data nagiosxi < /tmp/fix.sql
postgres -D /var/lib/pgsql/data postgres < /tmp/fix.sql
postgres -D /var/lib/pgsql/data template1 < /tmp/fix.sql
exit
service postgresql start

Re: Nagios Portal Down

Posted: Wed Jan 13, 2016 7:33 pm
by raamardhani7
Box293 wrote:Can you try this and let us know if it fixes the problem:

Code: Select all

service postgresql stop
su postgres
echo "VACUUM FULL;" > /tmp/fix.sql
postgres -D /var/lib/pgsql/data nagiosxi < /tmp/fix.sql
postgres -D /var/lib/pgsql/data postgres < /tmp/fix.sql
postgres -D /var/lib/pgsql/data template1 < /tmp/fix.sql
exit
service postgresql start
Hi Box,

Please find the update.

Code: Select all

service postgresql stop
Stopping postgresql service:                               [FAILED]
[root@lcnhkpnagiosxi00 nagiosxi]# service postgresql start
Starting postgresql service:                               [  OK  ]
[root@lcnhkpnagiosxi00 nagiosxi]# service postgresql stop
Stopping postgresql service:                               [FAILED]

Code: Select all

[root@lcnhkpnagiosxi00 nagiosxi]# su postgres
bash-4.1$ echo "VACUUM FULL;" > /tmp/fix.sql
bash-4.1$ postgres -D /var/lib/pgsql/data nagiosxi < /tmp/fix.sql
postgres: invalid argument: "nagiosxi"
Try "postgres --help" for more information.
bash-4.1$ postgres -D /var/lib/pgsql/data postgres < /tmp/fix.sql
postgres: invalid argument: "postgres"
Try "postgres --help" for more information.
bash-4.1$ postgres -D /var/lib/pgsql/data template1 < /tmp/fix.sql
postgres: invalid argument: "template1"
Try "postgres --help" for more information.

Re: Nagios Portal Down

Posted: Wed Jan 13, 2016 7:49 pm
by Box293
I think we should take this into a support ticket so we can help you through a remote session.

Please send an email to [email protected] referencing this forum thread and we'll take it from there. Reply to this thread when you have done this so we can confirm we received the email.

Re: Nagios Portal Down

Posted: Wed Jan 13, 2016 7:56 pm
by raamardhani7
Box293 wrote:I think we should take this into a support ticket so we can help you through a remote session.

Please send an email to [email protected] referencing this forum thread and we'll take it from there. Reply to this thread when you have done this so we can confirm we received the email.
Hi Box,

I've just sent out an email. waiting for the response. thanks.

Re: Nagios Portal Down

Posted: Wed Jan 13, 2016 9:55 pm
by raamardhani7
Thanks a lot Troy, issue is now resolved. Below are the comments from him, updating it to see if someone needs in emergency.

Code: Select all

After todays' remote we identified the mysql Nagios database needed to be restored due to some corrupted tables.

After doing this we found that we also needed to reset the permissions on the postgres data folder.

Once this was done everything started working as expected.
Thanks a lot Box for your support. This thread can be closed. thanks again.

Regards,
Ram.

Re: Nagios Portal Down

Posted: Thu Jan 14, 2016 10:13 am
by bwallace
Glad we were able to help. We'll lock this thread now and feel free to open another should you require assistance with anything else.