Nagios Portal Down

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
raamardhani7
Posts: 459
Joined: Tue Jun 02, 2015 12:36 am

Nagios Portal Down

Post 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.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Nagios Portal Down

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
raamardhani7
Posts: 459
Joined: Tue Jun 02, 2015 12:36 am

Re: Nagios Portal Down

Post 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.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Nagios Portal Down

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
raamardhani7
Posts: 459
Joined: Tue Jun 02, 2015 12:36 am

Re: Nagios Portal Down

Post 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.
raamardhani7
Posts: 459
Joined: Tue Jun 02, 2015 12:36 am

Re: Nagios Portal Down

Post 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.
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Nagios Portal Down

Post 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.
Be sure to check out the Knowledgebase for helpful articles and solutions!
Locked