Restoring XI system from backup

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
highness
Posts: 192
Joined: Thu May 01, 2014 4:25 pm

Re: Restoring XI system from backup

Post by highness »

npolovenko wrote:@highness, I'm looking at your config.inc.php file and some usernames and passwords for the database are incorrect. It looks like you had an external-offloaded database at some point?
We did, but we had to repatriate that database some time ago.



All requested changes made, but we're still seeing the same error in the httpd error_log file:

[Thu May 24 13:58:57 2018] [error] [client 10.XX.XX.XX] PHP Warning: mysqli_real_connect(): (28000/1045): Access denied for user 'nagios'@'localhost' (using password: YES) in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysqli.inc.php on line 117
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Restoring XI system from backup

Post by npolovenko »

@highness, Let's reset the services:

Code: Select all

service mariadb restart
service mysqld restart
service httpd restart
service nagios restart
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
highness
Posts: 192
Joined: Thu May 01, 2014 4:25 pm

Re: Restoring XI system from backup

Post by highness »

Did that previously, but did them again just for fun.

Same result. No joy.
highness
Posts: 192
Joined: Thu May 01, 2014 4:25 pm

Re: Restoring XI system from backup

Post by highness »

Any suggestions for next steps?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Restoring XI system from backup

Post by scottwilkerson »

Lets see this output

Code: Select all

echo "SHOW GRANTS;"|mysql -pnagiosxi
and

Code: Select all

cat /etc/hosts
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
highness
Posts: 192
Joined: Thu May 01, 2014 4:25 pm

Re: Restoring XI system from backup

Post by highness »

scottwilkerson wrote:Lets see this output

Code: Select all

echo "SHOW GRANTS;"|mysql -pnagiosxi
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*C96C0FA6D6B3B9CD6D66526C681E7912D3EA134C' WITH GRANT OPTION

and

Code: Select all

cat /etc/hosts
127.0.0.1 localhost localhost4 localhost.localdomain localhost4.localdomain4 loopback
10.XX.XX.XX xxxxxxxxxxxxxxx.xxx.xxx xxxxxxxxxxxxxxx

This is the host/IP address of the secondary Nagios box we're trying to get things to work on
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Restoring XI system from backup

Post by npolovenko »

@highness, Looking at the passwords and usernames in your configs it seems like you were still using an offloaded database. Unless you manually changed users and passwords for the localhost db?

Please open:

Code: Select all

/usr/local/nagios/etc/ndo2db.cfg
Find these lines:

Code: Select all

db_user=nagios
db_pass=nagios

And change them to:

Code: Select all

db_user=ndoutils
db_pass=n@gweb
Then run the following commands:

Code: Select all

service ndo2db restart
service nagios restart

Also, please upload the following files here:

Code: Select all

upload the modified /usr/local/nagiosxi/html/config.inc.php
and
/var/www/html/nagiosql/config/settings.php
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
highness
Posts: 192
Joined: Thu May 01, 2014 4:25 pm

Re: Restoring XI system from backup

Post by highness »

npolovenko wrote:@highness, Looking at the passwords and usernames in your configs it seems like you were still using an offloaded database. Unless you manually changed users and passwords for the localhost db?

Please open:

Code: Select all

/usr/local/nagios/etc/ndo2db.cfg
Find these lines:

Code: Select all

db_user=nagios
db_pass=nagios

And change them to:

Code: Select all

db_user=ndoutils
db_pass=n@gweb
Then run the following commands:

Code: Select all

service ndo2db restart
service nagios restart

Also, please upload the following files here:

Code: Select all

upload the modified /usr/local/nagiosxi/html/config.inc.php
and
/var/www/html/nagiosql/config/settings.php

There must be some kind of disconnect (or maybe I just haven't had enough caffeine yet...) While we did have an external database (well over a year ago - which we repatriated back to our original Nagios box) - the external database was shut down once the database was moved back to the original Nagios box. The backup we are restoring from is from our working Nagios XI instance, so I'm completely confused as to why this would be an issue.

In regards to the /usr/local/nagios/etc/ndo2db.cfg file the lines you asked me to find and replace - those fields are already set to what you've asked me to change them to.

I've send you the following files in PM:

/usr/local/nagiosxi/html/config.inc.php
/var/www/html/nagiosql/config/settings.php
/usr/local/nagios/etc/ndo2db.cfg
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Restoring XI system from backup

Post by npolovenko »

@highness, This makes sense...Please disregard my previous statement.

Please change the user from nagios to ndoutils in the following paragraph in your config.inc.php file:

Code: Select all

"ndoutils" => array(
		"dbtype" => 'mysql',
		"dbserver" => 'localhost',
		"user" => 'nagios',
		"pwd" => 'n@gweb',
		"db" => 'nagios',
		"dbmaint" => array(	
And then run:

Code: Select all

service httpd restart
service mysqld restart
service ndo2db restart
service nagios restart
If this still doesn't fix the problem please run all the following commands and show me the output:

Code: Select all

echo "show tables;" |    mysql -unagiosxi -pn@gweb nagiosxi
echo "show tables;" |    mysql -undoutils -pn@gweb nagios
echo "show tables;" |    mysql -unagiosql -pn@gweb nagiosql
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
highness
Posts: 192
Joined: Thu May 01, 2014 4:25 pm

Re: Restoring XI system from backup

Post by highness »

Ok - that worked - I can now log into the new box - the second biggest issue is that the secondary box appears to be displaying data from the original (primary) box.

I checked all the configurations that I could find and it appears that the secondary box are all referencing localhost - not the primary box.... yet all the alerts on the primary box are showing up on the secondary box.

Any idea what to check ?
Locked