Problem with NDOUtils

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problem with NDOUtils

Post by scottwilkerson »

Not knowing completely how this was installed we could hit other problems, however from inside the db directory you may be able to do the following:

Code: Select all

sed -i "s/TYPE/ENGINE/g" ./*.sql
When these scripts were written 10 years ago the TYPE directive was proper however it has been switched to ENGINE and type was deprecated in MySQL/Mariadb 5.5
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Cristhian_Plaza
Posts: 62
Joined: Thu Oct 27, 2016 2:43 pm

Re: Problem with NDOUtils

Post by Cristhian_Plaza »

scottwilkerson wrote:Not knowing completely how this was installed we could hit other problems, however from inside the db directory you may be able to do the following:

Code: Select all

sed -i "s/TYPE/ENGINE/g" ./*.sql
When these scripts were written 10 years ago the TYPE directive was proper however it has been switched to ENGINE and type was deprecated in MySQL/Mariadb 5.5
Ok.., now jajaajja we are having progress although I got another error.., I think this is easiest to solve. What can you tell me about the error?

Code: Select all

[root@ip-10-0-8-150 db]# ./upgradedb -u xxxx -p xxxx -h localhost -d xxxx
Current database version: 1.4b2
** DB upgrade required for 1.4b3
     Using mysql-upgrade-1.4b3.sql for upgrade...
ERROR 1060 (42S21) at line 123: Duplicate column name 'last_state'
Upgrade from mysql-upgrade-1.4b3.sql failed at ./upgradedb line 106.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problem with NDOUtils

Post by scottwilkerson »

We need to stop for a minute, the command is listing

Code: Select all

Current database version: 1.4b2
But previously you showed that ndo2db version was 2.1.2

At this point, if it has never actually worked correctly, and you do not have data that you risk losing, I would highly recommend NOT doing the upgrade, and remove the existing database, and running the install script instead

Code: Select all

mysql -u root -p

> DROP DATABASE nagios;
> CREATE DATABASE nagios;
Create a username/password that has at least the following privileges for the database:

Code: Select all

SELECT, INSERT, UPDATE, DELETE
then:

Code: Select all

./installdb  -u xxxx -p xxxx -h localhost -d xxxx
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked