migrating from oel6 to centos 7.8

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
erkanerturk
Posts: 53
Joined: Wed Jan 16, 2019 4:35 am

migrating from oel6 to centos 7.8

Post by erkanerturk »

Hi
we have nagios XI 5.6.14 on oel 6.10. we want to migrate centos 7.8 then nagios xi 5.7.4.
we are following "Backing Up And Restoring Your Nagios XI System". we have installed new centos 7.8 and installed nagios xi 5.6.14 on it..

we have backed up our oel system successfully using backup_xi.sh script

restore part:
/usr/local/nagiosxi/scripts/restore_xi.sh /store/backups/nagiosxi/16043001044.tar.gz
it warned us about migration from el6 to el7. that is OK (according to doc)
but also it said:

restoring nagios core
tar: usr/local/nagios: cannot open: file exists
tar: exiting with failure status due to previous errors
tar: usr/local/nagios/libexec/*.*: not found in archive
tar: exiting with failure status due to previous errors
restoring nagios xi
....

after restore finishes, nagios service did not start. it says "can not open main configuration file nagios.cfg for reading"

moreover we are using an internal network which do not access internet.

we needed to have offline restore_repair package. is that possible?..or what are the requirements for this file to run successfully?
i have changed the main script so that it can run offline. but in the running part it searched for gcc and some perl packages.. i need to have all prerequisite packages..

TIA
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: migrating from oel6 to centos 7.8

Post by ssax »

Are you sure you're backup is good? Can you manually extract it? Send us the output of these commands:

Code: Select all

tar zxf /store/backups/nagiosxi/16043001044.tar.gz
cd 16043001044
tar zxf nagios.tar.gz
ls -l usr/local/nagios
Yes, you'll need to run the restore_repair script after restoring (it needs to be successful restoring first).

Also try doing it this way instead to see if it helps (you must run it as root/sudo):

Code: Select all

cd /usr/local/nagiosxi/scripts
./restore_xi.sh /store/backups/nagiosxi/16043001044.tar.gz
Send us the full output from all commands so we can see everything that is occurring on the restore.
erkanerturk
Posts: 53
Joined: Wed Jan 16, 2019 4:35 am

Re: migrating from oel6 to centos 7.8

Post by erkanerturk »

Thanks for assistance..

Yes I think there is a problem with nagios.tar.gz. there is no /data/nagios directory..
how can we solve it?

Moreover i need to have restore_repair script's all prerequisites. we are running nagios in an isolated network..

[root@nagios tmp]# tar zxf /store/backups/nagiosxi/1604301044.tar.gz
[root@nagios tmp]# cd 1604301044/
[root@nagios 1604301044]# tar zxf nagios.tar.gz
[root@nagios 1604301044]# ls -l usr/local/nagios
lrwxrwxrwx 1 root root 13 Feb 26 2019 usr/local/nagios -> /data/nagios/
[root@nagios 1604301044]# ls -l
total 106180
drwxr-xr-x 2 root root 6 Nov 2 10:11 conf.d
drwxr-xr-x 2 root root 20 Nov 2 10:12 cron
-rw-r--r-- 1 root root 13720 Nov 2 10:11 etc-snmp.tar.gz
-rw-r--r-- 1 root root 566 Nov 2 10:11 home-nagios.tar.gz
drwxr-xr-x 2 root root 123 Nov 2 10:12 httpd
drwxr-xr-x 2 root root 22 Nov 2 10:12 logrotate
-rwxr-xr-x 1 root root 788 Nov 2 10:11 mrtg.cfg
-rw-r--r-- 1 root root 158 Nov 2 10:11 mrtg.tar.gz
drwxr-xr-x 2 root root 64 Nov 2 10:12 mysql
-rw-r--r-- 1 root root 126 Nov 2 10:10 nagios.tar.gz
-rw-r--r-- 1 root root 85116723 Nov 2 10:11 nagiosxi.tar.gz
-rw-r--r-- 1 root root 1952255 Nov 2 10:11 nagvis.tar.gz
-rw-r--r-- 1 root root 21084413 Nov 2 10:11 nrdp.tar.gz
drwxr-xr-x 3 root root 19 Nov 3 18:20 usr
-rw-r--r-- 1 root root 535033 Nov 2 10:11 usr-share-snmp.tar.gz


[root@nagios 1604301044]# cd /usr/local/nagiosxi/scripts/
[root@nagios scripts]# ./restore_xi.sh /store/backups/nagiosxi/1604301044.tar.gz
WARNING: you are trying to restore a el6 backup on a el7 system
Compiled plugins and other binaries as well as httpd configurations
will NOT be restored.

You will need to re-download the Nagios XI tarball, and re-install
the subcomponents for this system. More info here:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Are you sure you want to continue? [y/N] y
TS=1604417192
Extracting backup to /store/backups/nagiosxi/1604417192-restore...
In /store/backups/nagiosxi/1604417192-restore/1604301044...
Backup files look okay. Preparing to restore...
Shutting down services...
Restoring directories to /...
Restoring Nagios Core...
tar: usr/local/nagios: Cannot open: File exists
tar: Exiting with failure status due to previous errors
tar: usr/local/nagios/libexec/*.*: Not found in archive
tar: Exiting with failure status due to previous errors
Restoring Nagios XI...
Restoring NRDP backups...
Restoring MRTG...
Restoring SNMP configuration files...
Restoring SNMP MIBs...
Restoring Nagvis backups...
Restoring nagios home dir...
Restoring MySQL databases...
Restoring Nagios XI MySQL database...
Restarting database servers...
Restoring Apache cronjobs...
Restoring logrotate config files...
Skipping Apache config files restoration
Job for npcd.service failed because the control process exited with error code. See "systemctl status npcd.service" and "journalctl -xe" for details.
Job for nagios.service failed because the control process exited with error code. See "systemctl status nagios.service" and "journalctl -xe" for details.

===============
RESTORE COMPLETE
===============
[root@nagios scripts]#
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: migrating from oel6 to centos 7.8

Post by ssax »

It's likely because the backup is not following the symlink to your customized installation.

You'll need to modify your backup script to do it:

Code: Select all

/usr/local/nagiosxi/scripts/backup_xi.sh
Change this:

Code: Select all

echo "Backing up Nagios Core..."
tar czfp $mydir/nagios.tar.gz /usr/local/nagios
To this:

Code: Select all

echo "Backing up Nagios Core..."
tar czhfp $mydir/nagios.tar.gz /usr/local/nagios
NOTE: Before restoring you'll need to make sure the symlink is in place and the data directory exists (for example, if it was a fresh install of XI):

Code: Select all

mkdir /data
mv /usr/local/nagios /data/
ln -s /data/nagios /usr/local/nagios
erkanerturk
Posts: 53
Joined: Wed Jan 16, 2019 4:35 am

Re: migrating from oel6 to centos 7.8

Post by erkanerturk »

Hi

Thank you for your support. Now we are in el7...

but i also want to summarize what happened during restore_repair.sh process as we are running in an isolated environment
1- restore_repair.sh must be revized. i have read the script, manually downloaded tarball, untarred it and changed script according to this.
2- i have encountered many problems . mostly they are required packages and utils. i have installed the following
yum install patch libmcrypt libmcrypt-devel mysql-devel gcc perl-ExtUtils-MakeMaker

after this, script has run successfully..
as a minor problem, after restore, i encountered host-perfdata and service-perfdata file can not be opened. i have deleted the old ones and nagios created new ones..
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: migrating from oel6 to centos 7.8

Post by ssax »

Do you have the logs from the restore repair script so we can see what actually occurred? We would need the logs to see where it was failing in order to submit it to development for revising.
erkanerturk
Posts: 53
Joined: Wed Jan 16, 2019 4:35 am

Re: migrating from oel6 to centos 7.8

Post by erkanerturk »

Hi

we have lost performance graphs. my rrds files are not updated after migration.

as a solution:
i have restarted npcd, nagios
i have restarted performance grapher
i have deleted host-perfdata and service-perfdata files and they are recreated by nagios..
npcd.log and perfdata.log styas in the migration date. i.e not updated

but no one worked!

Moreover;
we have lost host&service critical durations. for example before migration we had a 200 days critical host. but now GUI shows only 2 days of critical state. how can we bring those real critical durations..
erkanerturk
Posts: 53
Joined: Wed Jan 16, 2019 4:35 am

Re: migrating from oel6 to centos 7.8

Post by erkanerturk »

Hi

now i have noticed that i do not have rrdcached service according to this doc:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf

do i need to follow that guide? we have migrated from oel6 to centos7. our host runs in an internal LAN
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: migrating from oel6 to centos 7.8

Post by ssax »

Yes, follow that RRDCacheD guide to set it up.

Once you're done, wait 15 minutes and then see if they are showing up. If they are not, PM me a FRESH copy of your profile from the new system so I can see the latest configs/logs.
erkanerturk
Posts: 53
Joined: Wed Jan 16, 2019 4:35 am

Re: migrating from oel6 to centos 7.8

Post by erkanerturk »

i have sent PM
waiting for your reply..