Parallel Upgrade

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
zovy
Posts: 26
Joined: Fri Dec 19, 2014 1:17 pm

Parallel Upgrade

Post 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?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Parallel Upgrade

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
zovy
Posts: 26
Joined: Fri Dec 19, 2014 1:17 pm

Re: Parallel Upgrade

Post 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.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Parallel Upgrade

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Parallel Upgrade

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
zovy
Posts: 26
Joined: Fri Dec 19, 2014 1:17 pm

Re: Parallel Upgrade

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Parallel Upgrade

Post 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
zovy
Posts: 26
Joined: Fri Dec 19, 2014 1:17 pm

Re: Parallel Upgrade

Post 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 ~]#
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Parallel Upgrade

Post by sreinhardt »

Looks like postgres isn't presently running. Let's try:

Code: Select all

service postgresql status
service postgresql restart
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
zovy
Posts: 26
Joined: Fri Dec 19, 2014 1:17 pm

Re: Parallel Upgrade

Post 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
Locked