Page 2 of 5
Re: RESTORE: ndo2db is not running but subsystem locked
Posted: Wed Jun 05, 2019 10:55 am
by FrancisNagios
Hi,
It was re-started on the clean NagiosRedHat server before the Restore failed.
The selinux was disabled
Code: Select all
[root @ nagiosxi-rh tmp] # sestatus
SELinux status: disabled
The Restore procedure was performed again.
When performing the restoration it gives these errors again:
RESTORE.txt
These commands were executed:
Code: Select all
rm -rf /usr/local/nagios/var/ndo.sock
rm -rf /usr/local/nagios/var/ndo2db.lock
ndo2db service home
systemctl restart mariadb
I attache the result the file mariadb.log
tail.txt
But the database is still failing.
Thanks and regards
Re: RESTORE: ndo2db is not running but subsystem locked
Posted: Wed Jun 05, 2019 1:13 pm
by tgriep
Some of the errors when restoring the config are expected as your original server is setup to use the Postgres daemon for the nagiosxi database and the errors generated are because of that.
This is important, after you did the restore, did you re-run the Manual XI Upgrade?
If not, do so now as you are moving files from one system to another and they need to be upgraded on the new system.
https://assets.nagios.com/downloads/nag ... ctions.pdf
If the errors are the same as before, it is probably the Postgres database.
Get the following files from the new server and post them here.
Code: Select all
/var/lib/pgsql/data/postgresql.conf
/var/lib/pgsql/data/pg_hba.conf
/var/lib/pgsql/data/pg_log/postgresql-Wed.log
Run this command as root and post the output.
Re: RESTORE: ndo2db is not running but subsystem locked
Posted: Wed Jun 05, 2019 4:42 pm
by FrancisNagios
Hi,
Thank you for the answer
Tomorrow I´ll respond with the output of the tar command and files
I did these steps:
1)[root @ nagiosxi-rh tmp] # sestatus
SELinux status: disabled
2)/usr/local/nagiosxi/scripts/
restore_xi.sh /store/backups/nagiosxi/Backup_NagiosCentos_31_05_19.1559289305.tar.gz
3)wget
https://assets.nagios.com/downloads/nag ... _repair.sh
chmod +x restore_repair.sh
./restore_repair.sh
4) rm -rf /usr/local/nagios/var/ndo.sock
rm -rf /usr/local/nagios/var/ndo2db.lock
ndo2db service home
systemctl restart mariadb
Did you re-run the Manual XI Upgrade?
No, I did step 3 that corresponds to page 12 of the manual -> Backup and restoration-Nagios-XI.pdf
So step 5 would be the next one to update nagios again maintaining the same version?
Code: Select all
cd /tmp
rm -rf nagiosxi xi-5.4.13.tar.gz
wget http://assets.nagios.com/downloads/nagiosxi/xi-5.4.13.tar.gz
tar xzf xi-5.4.13.tar.gz
cd nagiosxi
./upgrade
Thanks and regards
Re: RESTORE: ndo2db is not running but subsystem locked
Posted: Wed Jun 05, 2019 4:56 pm
by tgriep
The steps you posted will run the manual XI upgrade but it will keep the version that you want to run at 5.4.13 so try it out and post back the upgrade.log file if you have any issues.
Re: RESTORE: ndo2db is not running but subsystem locked
Posted: Thu Jun 06, 2019 3:06 am
by FrancisNagios
Hi,
I attach the files before doing step 5 (./upgrade)
Before..tar
I attach the files after doing step 5 (./upgrade)
after.tar
The file /usr/local/nagiosxi/tmp/upgrade.log is
empty.
I attach the file mariadb.log among other commands to try to start the database.
mariadb.txt
Thanks and regards
Re: RESTORE: ndo2db is not running but subsystem locked
Posted: Thu Jun 06, 2019 1:11 pm
by tgriep
Run these commands on the new server and post the output.
Code: Select all
/usr/local/nagios/ndo2db
tail -200 /var/lib/pgsql/data/pg_log/postgresql-Wed.log
tail -200 /var/lib/pgsql/data/pg_log/postgresql-Thu.log
Then, run the ndo2db daemon in the fore ground to see what sort of errors are generated.
Run this and post the output here.
Code: Select all
/usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg -f
In the upgrade log file, it says that the server is an RPM install.
The issue is that using the backup and restore procedure to migrate to a new server running a different OS will not work.
It is written to work with a source install and not an RPM install.
Try running the rpmupgrade script instead.
Go to the /tmp/nagiosxi folder and run the following
If this fails, you would have to do the import procedure to setup the new server.
Re: RESTORE: ndo2db is not running but subsystem locked
Posted: Fri Jun 07, 2019 4:10 am
by FrancisNagios
Hi,
The requested commands of postgresql are attached.
postgresql-Wed.log
postgresql-Thu.log
This is the result of run the ndo2db daemon
Code: Select all
[root @ nagiosxi-rh etc] # / usr / local / nagios / bin / ndo2db -c /usr/local/nagios/etc/ndo2db.cfg -f
/ usr / local / nagios / bin / ndo2db: error while loading shared libraries: libmysqlclient.so.16: can not open shared object file: No such file or director
This is the result ./rpmupfrade
rpmupfrade.txt
It still continues with the status of Database Maitence stop.
Code: Select all
[root @ nagiosxi-rh nagiosxi] # service ndo2db status
ndo2db is not running but subsystem locked
Thanks and regards
Re: RESTORE: ndo2db is not running but subsystem locked
Posted: Fri Jun 07, 2019 9:07 am
by tgriep
It looks like the ndo2db daemon did not get reinstalled so it will have to be manually recreated.
First, make sure the MYSQL library is installed buy running this as root
Then follow this procedure to download XI and compile ndo2db
Code: Select all
cd /tmp
rm -rf nagiosxi xi-5.4.13.tar.gz
wget http://assets.nagios.com/downloads/nagiosxi/xi-5.4.13.tar.gz
tar xzf xi-5.4.13.tar.gz
cd nagiosxi/subcomponents/ndoutils
./upgrade
cp -f ndoutils-2.1.3/src/ndo2db-4x /usr/local/nagios/bin/ndo2db
cp -f ndoutils-2.1.3/src/ndomod-4x.o /usr/local/nagios/bin/ndomod.o
To see if it works, run this command again and you should not see any errors.
Code: Select all
/usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg -f
Re: RESTORE: ndo2db is not running but subsystem locked
Posted: Mon Jun 10, 2019 5:10 am
by FrancisNagios
Hi,
I show the result of the
MYSQL library installation:
Code: Select all
[root@nagiosxi-rh nagiosxi]# yum install mariadb-libs
Complementos cargados:product-id, search-disabled-repos, subscription-manager
rhel-7-server-optional-rpms | 3.2 kB 00:00:00
rhel-7-server-rpms | 3.5 kB 00:00:00
(1/4): rhel-7-server-optional-rpms/7Server/x86_64/updateinfo | 2.3 MB 00:00:00
(2/4): rhel-7-server-optional-rpms/7Server/x86_64/primary_db | 7.6 MB 00:00:01
(3/4): rhel-7-server-rpms/7Server/x86_64/updateinfo | 3.2 MB 00:00:01
(4/4): rhel-7-server-rpms/7Server/x86_64/primary_db | 57 MB 00:00:02
El paquete 1:mariadb-libs-5.5.60-1.el7_5.x86_64 ya se encuentra instalado con su versión más reciente Nada para hace
Muestro el resultado del
upgrade:
Code: Select all
PGRADING NDOUTILS...
Applying Nagios XI patches to NDOUtils...
./apply-patches: línea 9: patch: no se encontró la orden
Which the following could not be done:
Code: Select all
[root@nagiosxi-rh ndoutils]# cp -f ndoutils-2.1.3/src/ndo2db-4x /usr/local/nagios/bin/ndo2db
cp: no se puede efectuar `stat' sobre «ndoutils-2.1.3/src/ndo2db-4x»: No existe el fichero o el directorio
[root@nagiosxi-rh ndoutils]# cp -f ndoutils-2.1.3/src/ndomod-4x.o /usr/local/nagios/bin/ndomod.o
cp: no se puede efectuar `stat' sobre «ndoutils-2.1.3/src/ndomod-4x.o»: No existe el fichero o el directorio
[root@nagiosxi-rh ndoutils]# /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg -f
/usr/local/nagios/bin/ndo2db: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory
I attach the content of the upgrade file
upgrade.txt
Thanks and regards
Re: RESTORE: ndo2db is not running but subsystem locked
Posted: Mon Jun 10, 2019 9:00 am
by tgriep
Try installing MDOUTILS using the source installation.
Run this as root.
Code: Select all
cd /tmp
wget -O ndoutils.tar.gz https://github.com/NagiosEnterprises/ndoutils/releases/download/ndoutils-2.1.3/ndoutils-2.1.3.tar.gz
tar xzf ndoutils.tar.gz
cd /tmp/ndoutils-2.1.3/
./configure
make all
make install
If it works, run this command again and you should not see any errors.
Code: Select all
/usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg -f