Page 1 of 1

SQL Error [nagiosxi] : Table 'nagiosxi.xi_sessions' doesn't

Posted: Tue Apr 09, 2019 4:48 am
by ppalmer
Hello,

We have just upgraded our test box from Nagios xi version 5.2.9 to 5.5.11. There was a mistake made where the unix administrator didn't stop the Nagios service before before performing the upgrade, since reinstalling Nagios we are getting the error message SQL Error [nagiosxi] : Table 'nagiosxi.xi_sessions' doesn't exist.

I also cannot restart Nagios because it tells me that there are errors in the pre-flight checks:

Checking objects...
Error: There are no services defined!
Checked 0 services.
Error: There are no hosts defined!
Checked 0 hosts.
Checked 1 host groups.
Checked 0 service groups.
Checked 4 contacts.
Checked 2 contact groups.
Checked 124 commands.
Checked 10 time periods.
Checked 0 host escalations.
Checked 0 service escalations.

There is also no lock file found when I try and stop Nagios.

Could someone assist me please?

Thanks,

Paul

Re: SQL Error [nagiosxi] : Table 'nagiosxi.xi_sessions' does

Posted: Tue Apr 09, 2019 1:29 pm
by cdienger
Attached are two sql files - one for the mysql database and one for the postgres database. To import them on a default install where the database is on the XI machine:

Code: Select all

mysql -uroot -pnagiosxi -Dnagiosxi < schema_03.sql

Code: Select all

psql -U nagiosxi
\i schema_03.psql
Note that one of these can fail - if you have a postgres database the mysql import will fail and vise versa.

Re: SQL Error [nagiosxi] : Table 'nagiosxi.xi_sessions' does

Posted: Thu Apr 18, 2019 6:04 am
by ppalmer
Thanks for the reply. I have run the following.

[nagios@smpnagios-kn-t100 p5003574]$ mysql -uroot -pnagiosxi -Dnagiosxi < schema_03.sql
[nagios@smpnagios-kn-t100 p5003574]$ psql -U nagiosxi \i schema_03.sql
psql: warning: extra command-line argument "schema_03.sql" ignored
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

It does seem to have cured the issue though, the error message has gone.

Re: SQL Error [nagiosxi] : Table 'nagiosxi.xi_sessions' does

Posted: Thu Apr 18, 2019 9:03 am
by cdienger
Thanks for the update and glad to hear it's working now! It's expected that one of those commands would fail since you'll only have either a postgres or mysql database but not both.