Page 1 of 2

Parallel Upgrade

Posted: Tue Dec 23, 2014 9:16 am
by zovy
I've inherited a very old Nagios XI 2012R2.0 installation and would like to stand up a new VM and migrate the existing config into the new environment. Is this possible?

Re: Parallel Upgrade

Posted: Tue Dec 23, 2014 9:52 am
by scottwilkerson
zovy wrote:I've inherited a very old Nagios XI 2012R2.0 installation and would like to stand up a new VM and migrate the existing config into the new environment. Is this possible?
Yes.

I would perform the upgrade on the current machine to get it to the current version.

http://assets.nagios.com/downloads/nagi ... nstall.pdf

Then perform a backup and restore the backup on the new machine

http://assets.nagios.com/downloads/nagi ... ios-XI.pdf

Re: Parallel Upgrade

Posted: Fri Jan 02, 2015 1:58 pm
by zovy
What's required to get the new machine built? Every download link leads me to contact sales. I'd really like to have a fresh machine in parallel in order to replace the existing (and problematic) server rather than just upgrade the existing and copy it. It's old and not very clean. I'm familiar with the old core installations but not XI and would gladly download, compile, use binaries or even a vSphere appliance. I'd prefer NOT to upgrade then duplicate.

Re: Parallel Upgrade

Posted: Fri Jan 02, 2015 2:19 pm
by slansing
You can either build your own supported CENTOS/RHEL minimal VM, and then follow the manual installation steps:

http://assets.nagios.com/downloads/nagi ... ctions.pdf

Or you can download a pre-configured VM from:

http://library.nagios.com/library/produ ... loads/main

Then follow the steps Scott recommended. Be sure that both systems are running the same version XI.

Re: Parallel Upgrade

Posted: Fri Jan 02, 2015 2:23 pm
by lmiltchev
I would recommend following the scottwilkerson's suggestion. In order to migrate your configs to the new server, you will need to use the same XI versions and preferably the same OS/architecture. You will probably run into issues if you try to restore an old 2012R2.0 instance to Nagios XI 2014.

Re: Parallel Upgrade

Posted: Wed Jan 07, 2015 2:42 pm
by zovy
Thanks again. I've downloaded the VM template and deployed it. Logged in, changed root and mysql passwords, then changed to an appropriate static IP and hostname and get the following when I follow the "Access Nagios XI" link. I'm guessing I missed a configuration somewhere that will recognize the change in hostname, perhaps?
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
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
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

Re: Parallel Upgrade

Posted: Wed Jan 07, 2015 5:06 pm
by slansing
Can you try manually running that repair script and then accessing the web interface again? The database may have been in a degraded state when you backed it up:

Code: Select all

/usr/local/nagiosxi/scripts/repair_databases.sh
If it is still giving you issues, please post the output of the following immediately after seeing the web front-end issues:

Code: Select all

tail -30 /var/log/httpd/error_log

tail -30 /var/log/mysql.log

tail -30 /var/log/messages

Re: Parallel Upgrade

Posted: Wed Jan 07, 2015 7:37 pm
by zovy
Ran the fix script. I can also log into mysql client. Here's the results of the logs.
[Wed Jan 07 14:39:13 2015] [error] [client 172.16.0.106] PHP Notice: Undefined variable: result in /usr/local/nagiosxi/html/includes/db.inc.php on line 241, referer: http://10.0.0.23/
[Wed Jan 07 19:33:43 2015] [error] [client 172.16.0.106] 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, referer: http://10.0.0.23/
[Wed Jan 07 19:33:43 2015] [error] [client 172.16.0.106] PHP Notice: Undefined variable: result in /usr/local/nagiosxi/html/includes/db.inc.php on line 241, referer: http://10.0.0.23/
[Wed Jan 07 19:33:43 2015] [error] [client 172.16.0.106] 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, referer: http://10.0.0.23/
[Wed Jan 07 19:33:43 2015] [error] [client 172.16.0.106] PHP Notice: Undefined variable: result in /usr/local/nagiosxi/html/includes/db.inc.php on line 241, referer: http://10.0.0.23/
[Wed Jan 07 19:33:43 2015] [error] [client 172.16.0.106] 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, referer: http://10.0.0.23/
[Wed Jan 07 19:33:43 2015] [error] [client 172.16.0.106] PHP Notice: Undefined variable: result in /usr/local/nagiosxi/html/includes/db.inc.php on line 241, referer: http://10.0.0.23/
[root@srvnag01 ~]#
[root@srvnag01 ~]# tail -30 /var/log/mysql.log
tail: cannot open `/var/log/mysql.log' for reading: No such file or directory
[root@srvnag01 ~]#
[root@srvnag01 ~]# tail -30 /var/log/messages
Jan 7 19:33:14 srvnag01 nagios: wproc: Registry request: name=Core Worker 20172;pid=20172
Jan 7 19:33:14 srvnag01 nagios: wproc: Registry request: name=Core Worker 20175;pid=20175
Jan 7 19:33:14 srvnag01 nagios: ndomod: NDOMOD 2.0.0 (02-28-2014) Copyright (c) 2009 Nagios Core Development Team and Community Contributors
Jan 7 19:33:14 srvnag01 nagios: ndomod: Successfully connected to data sink. 8 queued items to flush.
Jan 7 19:33:14 srvnag01 nagios: ndomod: Successfully flushed 8 queued items to data sink.
Jan 7 19:33:14 srvnag01 nagios: ndomod registered for process data
Jan 7 19:33:14 srvnag01 nagios: ndomod registered for log data'
Jan 7 19:33:14 srvnag01 nagios: ndomod registered for system command data'
Jan 7 19:33:14 srvnag01 nagios: ndomod registered for event handler data'
Jan 7 19:33:14 srvnag01 nagios: ndomod registered for notification data'
Jan 7 19:33:14 srvnag01 nagios: ndomod registered for comment data'
Jan 7 19:33:14 srvnag01 nagios: ndomod registered for downtime data'
Jan 7 19:33:14 srvnag01 nagios: ndomod registered for flapping data'
Jan 7 19:33:14 srvnag01 nagios: ndomod registered for program status data'
Jan 7 19:33:14 srvnag01 nagios: ndomod registered for host status data'
Jan 7 19:33:14 srvnag01 nagios: ndomod registered for service status data'
Jan 7 19:33:14 srvnag01 nagios: ndomod registered for adaptive program data'
Jan 7 19:33:14 srvnag01 nagios: ndomod registered for adaptive host data'
Jan 7 19:33:14 srvnag01 nagios: ndomod registered for adaptive service data'
Jan 7 19:33:14 srvnag01 nagios: ndomod registered for external command data'
Jan 7 19:33:14 srvnag01 nagios: ndomod registered for aggregated status data'
Jan 7 19:33:14 srvnag01 nagios: ndomod registered for retention data'
Jan 7 19:33:14 srvnag01 nagios: ndomod registered for contact data'
Jan 7 19:33:14 srvnag01 nagios: ndomod registered for contact notification data'
Jan 7 19:33:14 srvnag01 nagios: ndomod registered for acknowledgement data'
Jan 7 19:33:14 srvnag01 nagios: ndomod registered for state change data'
Jan 7 19:33:14 srvnag01 nagios: ndomod registered for contact status data'
Jan 7 19:33:14 srvnag01 nagios: ndomod registered for adaptive contact data'
Jan 7 19:33:14 srvnag01 nagios: Event broker module '/usr/local/nagios/bin/ndomod.o' initialized successfully.
Jan 7 19:33:14 srvnag01 nagios: Successfully launched command file worker with pid 20182
[root@srvnag01 ~]#

Re: Parallel Upgrade

Posted: Thu Jan 08, 2015 12:33 pm
by sreinhardt
Looks like postgres isn't presently running. Let's try:

Code: Select all

service postgresql status
service postgresql restart

Re: Parallel Upgrade

Posted: Fri Jan 09, 2015 7:37 am
by zovy
[root@srvnag01 log]# service postgresql status
postmaster dead but pid file exists
[root@srvnag01 log]#
[root@srvnag01 log]# service postgresql restart
Stopping postgresql service: [FAILED]
Starting postgresql service: [ OK ]
But then it dies again ...

[root@srvnag01 log]# service postgresql status
postmaster dead but pid file exists