SQL Error [nagiosxi] showing on the screen

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
dpearceFL
Posts: 6
Joined: Wed Jan 25, 2017 3:59 pm

SQL Error [nagiosxi] showing on the screen

Post by dpearceFL »

SQL Error [nagiosxi] : ERROR: relation "xi_incidents_id_seq" already exists
SQL Error [nagiosxi] : ERROR: syntax error at or near "NOT"
LINE 2: CREATE TABLE IF NOT EXISTS xi_incidents ...
^
SQL Error [nagiosxi] : ERROR: syntax error at or near "NOT"
LINE 2: CREATE TABLE IF NOT EXISTS xi_incidents ...

Any ideas?

CentOS 6.8
PHP 5.5
Current Nagios, just upgraded from 2012 era
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: SQL Error [nagiosxi] showing on the screen

Post by dwhitfield »

Please run the fullowing

Code: Select all

cd /usr/local/nagiosxi/scripts/
./repair_databases.sh
If that doesn't fix things for you, take a look at https://support.nagios.com/kb/article.php?id=24

Please note that you have (or should have, at least) both MySQL and Postgres. This is no longer the default, but we keep Postgres from older versions.

Also, if that doesn't do it, can you upload you upgrade.log? Thanks!
dpearceFL
Posts: 6
Joined: Wed Jan 25, 2017 3:59 pm

Re: SQL Error [nagiosxi] showing on the screen

Post by dpearceFL »

I seem to have both postgres and mysql running. If I want to start from scratch instead of upgrading, do I just uninstall Nagios and reinstall or can I just nuke a database? The installation has nothing of value in it.

Dave
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: SQL Error [nagiosxi] showing on the screen

Post by dwhitfield »

If it really has nothing of value, I'd install CentOS 7.3 and Nagios XI 5.4.1: https://assets.nagios.com/downloads/nag ... 4.1.tar.gz

Even if you stick with CentOS 6.8, I'd do a full install just to clear out all the old log messages and such. It's not strictly necessary, but installs don't take that long.

To be clear, there is no problem with running both Postgres and MySQL. That was just what we did in the past. I take it from your post that the db repair didn't work?
Locked