Page 1 of 1
Restoring Nagios on new Centos VM
Posted: Sun Feb 02, 2025 3:05 pm
by Tx243
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?
Re: Restoring Nagios on new Centos VM
Posted: Mon Feb 03, 2025 10:27 am
by lgute
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?
Re: Restoring Nagios on new Centos VM
Posted: Mon Feb 03, 2025 12:50 pm
by sgardil
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.
Re: Restoring Nagios on new Centos VM
Posted: Mon Feb 03, 2025 1:10 pm
by Tx243
lgute wrote: ↑Mon Feb 03, 2025 10:27 am
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?
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
Posted: Mon Feb 03, 2025 1:45 pm
by Tx243
lgute wrote: ↑Mon Feb 03, 2025 10:27 am
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?
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...
But then generated new failure messages at the end:
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
When I ran the status Nagios.service this was the failure
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
Posted: Thu Feb 06, 2025 2:20 pm
by lgute
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...
Code: Select all
sudo /usr/local/nagiosxi/scripts/restore_xi.sh /store/backups/nagiosxi/
You need to do something like this...
Code: Select all
sudo /usr/local/nagiosxi/scripts/restore_xi.sh /tmp/<backup file name from Cent OS 7 server>.tar.gz