Our Nagios XI resided on Centos 7 and is well past EOL so my only path was to backup the existing server info and restore it on a fresh Centos9 VM. I created the VM, installed the same version of Nagios and verified the base installation loads up successfully so I attempted to do a restore of the production server.
When I start the restore I see two quick erorrs about end of file issues but the restore process continues till I get a restore successful message. I ran the restorerepair.sh after I completed the restore and afterwords it loads up with a Database Error:
Database Error
A database connection error has been detected, please follow the repair prompt below
so I ran the recommended /usr/local/nagiosxi/scripts/repair_databases.sh but it still loads with the same DB error. Any good suggestions for next step?
Restoring Nagios on new Centos VM
Re: Restoring Nagios on new Centos VM
Hi @Tx243,
Thanks for reaching out. What version of XI are you migrating?
Have you tried running the repair_databases.sh script on the CentOS 7 database and then creating the backup?
Thanks for reaching out. What version of XI are you migrating?
Have you tried running the repair_databases.sh script on the CentOS 7 database and then creating the backup?
Please let us know if you have any other questions or concerns.
-Laura
-Laura
Re: Restoring Nagios on new Centos VM
Hey @Tx243
If repairing the database before taking the backup like Laura suggested doesnt work, could you provide us with the errors that you are seeing so we can debug a little more and see why the repair db scripts arnt fixing the issues.
If repairing the database before taking the backup like Laura suggested doesnt work, could you provide us with the errors that you are seeing so we can debug a little more and see why the repair db scripts arnt fixing the issues.
Re: Restoring Nagios on new Centos VM
Version is 2024R1.02 on both servers, I have not done a DB repair on the source server. I will snapshot it and run that and get a fresh backup and try restoring that and report back.
Re: Restoring Nagios on new Centos VM
OK ran the DB on the original server, ran a new backup and restore and it started with the same errors in the beginning then moved to restoring components
Code: Select all
[nagiosadmin@NagiosCent nagiosxi]$ sudo /usr/local/nagiosxi/scripts/restore_xi.sh /store/backups/nagiosxi/
/usr/local/nagiosxi/scripts/restore_xi.sh /store/backups/nagiosxi/1738607057.tar.gz
tar: 1738607057/nagiosxi.tar.gz: Not found in archive
tar: Exiting with failure status due to previous errors
gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
tar: 1738607057/nagiosxi.tar.gz: Not found in archive
tar: Exiting with failure status due to previous errors
gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
TS=1738607815
Extracting backup to /store/backups/nagiosxi/1738607815-restore...
In /store/backups/nagiosxi/1738607815-restore/xi-backup-1738607057-gM2z6AVb6tVUBgmCnI97...
Backup files look okay. Preparing to restore...
Shutting down services...
Restoring directories to /...
Restoring Nagios Core...
Restoring Nagios XI...
Restoring NRDP backups...
Restoring MRTG...Code: Select all
Restoring Apache config files...
Job for nagios.service failed because the control process exited with error code.
See "systemctl status nagios.service" and "journalctl -xeu nagios.service" for details.
===============
RESTORE COMPLETE
===============
[nagiosadmin@NagiosCent nagiosxi]$ cat See "systemctl status nagios.service" and "journalctl -xeu nagios.service" for details.
See "systemctl status nagios.service" and "journalctl -xeu nagios.service" for details/etc/systemd/system/nagios.service/etc/systemd/system/nagios.service
Code: Select all
systemctl status nagios.servicesystemctl status nagios.service
× nagios.service - Nagios Core 4.4.13
Loaded: loaded (/usr/lib/systemd/system/nagios.service; enabled; preset: disabled)
Active: failed (Result: exit-code) since Mon 2025-02-03 12:39:28 CST; 3min 38s ago
Duration: 2d 32min 26.022s
Docs: https://www.nagios.org/documentation
Process: 178138 ExecStartPre=/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg (code=exited, status=127)
Process: 178139 ExecStopPost=/bin/rm -f /usr/local/nagios/var/rw/nagios.cmd (code=exited, status=0/SUCCESS)
CPU: 3ms
Feb 03 12:39:28 NagiosCent.traxxascorp.com systemd[1]: Starting Nagios Core 4.4.13...
Feb 03 12:39:28 NagiosCent.traxxascorp.com nagios[178138]: /usr/local/nagios/bin/nagios: error while loading shared libraries: libssl.so.10: cannot open shared object file: No such file or directory
Feb 03 12:39:28 NagiosCent.traxxascorp.com systemd[1]: nagios.service: Control process exited, code=exited, status=127/n/a
Feb 03 12:39:28 NagiosCent.traxxascorp.com systemd[1]: nagios.service: Failed with result 'exit-code'.
Feb 03 12:39:28 NagiosCent.traxxascorp.com systemd[1]: Failed to start Nagios Core 4.4.13.
Re: Restoring Nagios on new Centos VM
Hi @Tx243,
I think I see what is going on. According to the Backing-Up-And-Restoring-Nagios-XI document, you need to give the full path to the backup file you want to restore from.
So, instead of running this...
You need to do something like this...
I think I see what is going on. According to the Backing-Up-And-Restoring-Nagios-XI document, you need to give the full path to the backup file you want to restore from.
So, instead of running this...
Code: Select all
sudo /usr/local/nagiosxi/scripts/restore_xi.sh /store/backups/nagiosxi/
Code: Select all
sudo /usr/local/nagiosxi/scripts/restore_xi.sh /tmp/<backup file name from Cent OS 7 server>.tar.gzPlease let us know if you have any other questions or concerns.
-Laura
-Laura