Uninstalling NagioXI after the XI folder has been blown away

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
JakeHatMacys
Posts: 281
Joined: Thu Sep 25, 2014 3:21 pm

Uninstalling NagioXI after the XI folder has been blown away

Post by JakeHatMacys »

So I did a bad thing, I was attempting to backup / restore one of our other servers to the other.

Basically we need to move off this Physical box, so I took a back up, then tried to restore it onto our VM Test box.

It error'd out during the restore with a MySQL password issue for some reason. And well when that happened the Nagiosxi folder is not longer present on the box at all.

Meaning I can't run the uninstall script, and after downloading it and putting it on the server it appears to reference a bunch of stuff that no longer exists. So the question is what's the best way to blow away my old Nagios install and reload it?

Could I "rm -rf" the directories??? Then do a full install? I thought I'd ask first before making things worse haha. (It appears Nagios's Core folder is still there)
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Uninstalling NagioXI after the XI folder has been blown

Post by lmiltchev »

Could I "rm -rf" the directories??? Then do a full install?
The fullinstall script may still fail if this is not a "clean" system. You may try running the relevant commands from the "uninstall_xi.sh" script manually in order to remove users/groups, init files, DBs, etc.
Then run the fullinstall script, move your xi backup (from the "old server") to the "new" XI server and restore from it.
Be sure to check out our Knowledgebase for helpful articles and solutions!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Uninstalling NagioXI after the XI folder has been blown

Post by ssax »

What happens if you just try running the same version upgrade?

Code: Select all

cd /tmp/nagiosxi
./upgrade
Then you should be able to run the uninstall script.
JakeHatMacys
Posts: 281
Joined: Thu Sep 25, 2014 3:21 pm

Re: Uninstalling NagioXI after the XI folder has been blown

Post by JakeHatMacys »

ssax wrote:What happens if you just try running the same version upgrade?

Code: Select all

cd /tmp/nagiosxi
./upgrade
Then you should be able to run the uninstall script.
cp: cannot create regular file `/usr/local/nagiosxi/var/': No such file or directory
[root@******** nagiosxi]#
JakeHatMacys
Posts: 281
Joined: Thu Sep 25, 2014 3:21 pm

Re: Uninstalling NagioXI after the XI folder has been blown

Post by JakeHatMacys »

lmiltchev wrote:
Could I "rm -rf" the directories??? Then do a full install?
The fullinstall script may still fail if this is not a "clean" system. You may try running the relevant commands from the "uninstall_xi.sh" script manually in order to remove users/groups, init files, DBs, etc.
Then run the fullinstall script, move your xi backup (from the "old server") to the "new" XI server and restore from it.
So stepped through the un-install script. Then tried to ./fullinstall:

Code: Select all

Install      11 Package(s)

Total size: 20 M
Installed size: 0
Downloading Packages:
Running rpm_check_debug
Running Transaction Test


Transaction Check Error:
  file /usr/share/ibus-table/tables/cangjie-big.db from install of ibus-table-cangjie-1.2.0.20100210-1.el6.noarch conflicts with file from pa                                          ckage ibus-table-chinese-cangjie-1.4.6-1.el6.noarch
  file /usr/share/ibus-table/tables/cangjie3.db from install of ibus-table-cangjie-1.2.0.20100210-1.el6.noarch conflicts with file from packa                                          ge ibus-table-chinese-cangjie-1.4.6-1.el6.noarch
  file /usr/share/ibus-table/tables/cangjie5.db from install of ibus-table-cangjie-1.2.0.20100210-1.el6.noarch conflicts with file from packa                                          ge ibus-table-chinese-cangjie-1.4.6-1.el6.noarch
  file /usr/share/ibus-table/tables/erbi.db from install of ibus-table-erbi-1.2.0.20090901-8.el6.noarch conflicts with file from package ibus                                          -table-chinese-erbi-1.4.6-1.el6.noarch
  installing package ibus-chewing-1.3.5.20100714-4.el6.x86_64 needs 20KB on the / filesystem
  installing package anthy-9100h-10.1.el6.x86_64 needs 24KB on the / filesystem

Error Summary
-------------

RESULT=1

===================
INSTALLATION ERROR!
===================
Installation step failed - exiting.
Check for error messages in the install log (install.log).

If you require assistance in resolving the issue, please include install.log
in your communications with Nagios XI technical support.

The script that failed was: './1-prereqs'
From the install.log last entries:

Code: Select all

Transaction Summary
================================================================================
Install      11 Package(s)

Total size: 20 M
Installed size: 0
Downloading Packages:
Running rpm_check_debug
Running Transaction Test


Transaction Check Error:
  file /usr/share/ibus-table/tables/cangjie-big.db from install of ibus-table-cangjie-1.2.0.20100210-1.el6.noarch conflicts with file from package ibus-table-chinese-cangjie-1.4.6-1.el6.noarch
  file /usr/share/ibus-table/tables/cangjie3.db from install of ibus-table-cangjie-1.2.0.20100210-1.el6.noarch conflicts with file from package ibus-table-chinese-cangjie-1.4.6-1.el6.noarch
  file /usr/share/ibus-table/tables/cangjie5.db from install of ibus-table-cangjie-1.2.0.20100210-1.el6.noarch conflicts with file from package ibus-table-chinese-cangjie-1.4.6-1.el6.noarch
  file /usr/share/ibus-table/tables/erbi.db from install of ibus-table-erbi-1.2.0.20090901-8.el6.noarch conflicts with file from package ibus-table-chinese-erbi-1.4.6-1.el6.noarch
  installing package ibus-chewing-1.3.5.20100714-4.el6.x86_64 needs 20KB on the / filesystem
  installing package anthy-9100h-10.1.el6.x86_64 needs 24KB on the / filesystem

Error Summary
-------------
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Uninstalling NagioXI after the XI folder has been blown

Post by lmiltchev »

Have you tried removing the conflicting packages:

Code: Select all

yum remove ibus-table-chinese-cangjie-1.4.6-1.el6.noarch ibus-table-chinese-cangjie-1.4.6-1.el6.noarch ibus-table-chinese-cangjie-1.4.6-1.el6.noarch ibus-table-chinese-erbi-1.4.6-1.el6.noarch
and running the "./fullinstall" again?
Be sure to check out our Knowledgebase for helpful articles and solutions!
JakeHatMacys
Posts: 281
Joined: Thu Sep 25, 2014 3:21 pm

Re: Uninstalling NagioXI after the XI folder has been blown

Post by JakeHatMacys »

lmiltchev wrote:Have you tried removing the conflicting packages:

Code: Select all

yum remove ibus-table-chinese-cangjie-1.4.6-1.el6.noarch ibus-table-chinese-cangjie-1.4.6-1.el6.noarch ibus-table-chinese-cangjie-1.4.6-1.el6.noarch ibus-table-chinese-erbi-1.4.6-1.el6.noarch
and running the "./fullinstall" again?
Removed and ran again. Failed here:

Code: Select all

Dependencies Resolved

================================================================================
 Package         Arch   Version        Repository                          Size
================================================================================
Installing:
 ibus-anthy      x86_64 1.2.1-3.el6    macys-clone-rhel-x86_64-server-6.3 133 k
 ibus-chewing    x86_64 1.3.5.20100714-4.el6
                                       macys-clone-rhel-x86_64-server-6.3  64 k
 ibus-hangul     x86_64 1.3.0.20100329-4.el6
                                       macys-clone-rhel-x86_64-server-6.3  40 k
 ibus-pinyin     x86_64 1.3.8-1.el6    macys-clone-rhel-x86_64-server-6.3 1.1 M
 ibus-table-cangjie
                 noarch 1.2.0.20100210-1.el6
                                       macys-clone-rhel-x86_64-server-6.3 4.9 M
 ibus-table-erbi noarch 1.2.0.20090901-8.el6
                                       macys-clone-rhel-x86_64-server-6.3 2.0 M
 ibus-table-wubi noarch 1.2.0.20090715-8.el6
                                       macys-clone-rhel-x86_64-server-6.3 2.0 M
Installing for dependencies:
 anthy           x86_64 9100h-10.1.el6 macys-clone-rhel-x86_64-server-6.3 6.0 M
 kasumi          x86_64 2.5-1.1.el6    macys-clone-rhel-x86_64-server-6.3  71 k
 libchewing      x86_64 0.3.2-27.el6   macys-clone-rhel-x86_64-server-6.3 1.5 M
 libhangul       x86_64 0.0.10-1.el6   macys-clone-rhel-x86_64-server-6.3 2.1 M

Transaction Summary
================================================================================
Install      11 Package(s)

Total size: 20 M
Installed size: 0
Downloading Packages:
Running rpm_check_debug
Running Transaction Test


Transaction Check Error:
  installing package ibus-chewing-1.3.5.20100714-4.el6.x86_64 needs 20KB on the / filesystem
  installing package anthy-9100h-10.1.el6.x86_64 needs 24KB on the / filesystem

Error Summary
-------------

User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Uninstalling NagioXI after the XI folder has been blown

Post by tgriep »

The message points to the root partition is full. Can you run the following and post the output?

Code: Select all

df -h
df -i
du -a / | sort -n -r | head -n 20
Be sure to check out our Knowledgebase for helpful articles and solutions!
JakeHatMacys
Posts: 281
Joined: Thu Sep 25, 2014 3:21 pm

Re: Uninstalling NagioXI after the XI folder has been blown

Post by JakeHatMacys »

Geez, that was it. Freed up some space and got a lot further:

Code: Select all

*** Configuration summary for ndoutils 2.0.0 02-28-2014 ***:

 General Options:
 -------------------------
 NDO2DB user:    nagios
 NDO2DB group:   nagios


Review the options above for accuracy.  If they look okay,
type 'make' to compile the NDO utilities.

cd ./src && make
make[1]: Entering directory `/tmp/nagiosxi/subcomponents/ndoutils/ndoutils-2.0.0/src'
gcc -fPIC -g -O2 -I/usr/include/mysql -DHAVE_CONFIG_H  -c -o io.o io.c
gcc -fPIC -g -O2 -I/usr/include/mysql -DHAVE_CONFIG_H  -c -o utils.o utils.c
gcc -g -O2 -I/usr/include/mysql -DHAVE_CONFIG_H  -o file2sock file2sock.c io.o utils.o   -lm -lnsl
gcc -g -O2 -I/usr/include/mysql -DHAVE_CONFIG_H  -o log2ndo log2ndo.c io.o utils.o   -lm -lnsl
make ndo2db-2x
make[2]: Entering directory `/tmp/nagiosxi/subcomponents/ndoutils/ndoutils-2.0.0/src'
gcc -g -O2 -I/usr/include/mysql -DHAVE_CONFIG_H  -c -o db.o db.c
gcc -g -O2 -I/usr/include/mysql -DHAVE_CONFIG_H  -D BUILD_NAGIOS_2X -c -o dbhandlers-2x.o dbhandlers.c
gcc -g -O2 -I/usr/include/mysql -DHAVE_CONFIG_H   -D BUILD_NAGIOS_2X -o ndo2db-2x queue.c ndo2db.c dbhandlers-2x.o io.o utils.o db.o    -lnsl -L/usr/lib64/mysql -lmysqlclient -lpthread -lz -lm -lrt -lssl -lcrypto -ldl -lm
make[2]: Leaving directory `/tmp/nagiosxi/subcomponents/ndoutils/ndoutils-2.0.0/src'
make ndo2db-3x
make[2]: Entering directory `/tmp/nagiosxi/subcomponents/ndoutils/ndoutils-2.0.0/src'
gcc -g -O2 -I/usr/include/mysql -DHAVE_CONFIG_H  -D BUILD_NAGIOS_3X -c -o dbhandlers-3x.o dbhandlers.c
gcc -g -O2 -I/usr/include/mysql -DHAVE_CONFIG_H   -D BUILD_NAGIOS_3X -o ndo2db-3x queue.c ndo2db.c dbhandlers-3x.o io.o utils.o db.o    -lnsl -L/usr/lib64/mysql -lmysqlclient -lpthread -lz -lm -lrt -lssl -lcrypto -ldl -lm
make[2]: Leaving directory `/tmp/nagiosxi/subcomponents/ndoutils/ndoutils-2.0.0/src'
make ndo2db-4x
make[2]: Entering directory `/tmp/nagiosxi/subcomponents/ndoutils/ndoutils-2.0.0/src'
gcc -g -O2 -I/usr/include/mysql -DHAVE_CONFIG_H  -I ../include/nagios-4x  -D BUILD_NAGIOS_4X -c -o dbhandlers-4x.o dbhandlers.c
gcc -g -O2 -I/usr/include/mysql -DHAVE_CONFIG_H   -D BUILD_NAGIOS_4X -o ndo2db-4x queue.c ndo2db.c dbhandlers-4x.o io.o utils.o db.o    -lnsl -L/usr/lib64/mysql -lmysqlclient -lpthread -lz -lm -lrt -lssl -lcrypto -ldl -lm
make[2]: Leaving directory `/tmp/nagiosxi/subcomponents/ndoutils/ndoutils-2.0.0/src'
make ndomod-2x.o
make[2]: Entering directory `/tmp/nagiosxi/subcomponents/ndoutils/ndoutils-2.0.0/src'
gcc -fPIC -g -O2 -I/usr/include/mysql -DHAVE_CONFIG_H  -D BUILD_NAGIOS_2X -o ndomod-2x.o ndomod.c io.o utils.o -shared   -lnsl
make[2]: Leaving directory `/tmp/nagiosxi/subcomponents/ndoutils/ndoutils-2.0.0/src'
make ndomod-3x.o
make[2]: Entering directory `/tmp/nagiosxi/subcomponents/ndoutils/ndoutils-2.0.0/src'
gcc -fPIC -g -O2 -I/usr/include/mysql -DHAVE_CONFIG_H  -D BUILD_NAGIOS_3X -o ndomod-3x.o ndomod.c io.o utils.o -shared   -lnsl
make[2]: Leaving directory `/tmp/nagiosxi/subcomponents/ndoutils/ndoutils-2.0.0/src'
make ndomod-4x.o
make[2]: Entering directory `/tmp/nagiosxi/subcomponents/ndoutils/ndoutils-2.0.0/src'
gcc -fPIC -g -O2 -I/usr/include/mysql -DHAVE_CONFIG_H  -I ../include/nagios-4x  -D BUILD_NAGIOS_4X -o ndomod-4x.o ndomod.c io.o utils.o -shared   -lnsl
make[2]: Leaving directory `/tmp/nagiosxi/subcomponents/ndoutils/ndoutils-2.0.0/src'
gcc -g -O2 -I/usr/include/mysql -DHAVE_CONFIG_H  -o sockdebug sockdebug.c io.o utils.o   -lm -lnsl
make[1]: Leaving directory `/tmp/nagiosxi/subcomponents/ndoutils/ndoutils-2.0.0/src'
/usr/bin/install -c -m 755 -o root -g root -d /etc/rc.d/init.d
/usr/bin/install -c -m 755 -o root -g root daemon-init /etc/rc.d/init.d/ndo2db
NDOUTILS-POST
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 131072000
kernel.msgmax = 131072000
kernel.shmmax = 4294967295
kernel.shmall = 268435456
NOTE: If prompted, enter the MySQL root password
ERROR 1396 (HY000) at line 3: Operation CREATE USER failed for 'ndoutils'@'localhost'
ERROR: Subcomponent 'ndoutils' installation failed - exiting.
Subcomponents installation failed - exiting
RESULT=1

===================
INSTALLATION ERROR!
===================
Installation step failed - exiting.
Check for error messages in the install log (install.log).

If you require assistance in resolving the issue, please include install.log
in your communications with Nagios XI technical support.

The script that failed was: './A-subcomponents'
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Uninstalling NagioXI after the XI folder has been blown

Post by lmiltchev »

Can you log in mysql as root? Run the following command and show the output:

Code: Select all

echo 'show databases;' | mysql -t -u root -pnagiosxi nagios
Is there any chance that you start "clean" (run the installer on a new, clean system, minimal install)? It may take less time to do this vs troubleshooting each step along the way. The idea is to have a clean install of XI, where you can restore from a backup, correct?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked