Page 1 of 1

xi_sessions does not exist Error After Upgrade to 5.5.2

Posted: Mon Aug 13, 2018 3:01 am
by ariawenda
We recently upgraded the server to version 5.5.2 from the version xi-2014r1.0. There are 2 servers that we upgraded, one of them has the web GUI returning an error of xi_sessions does not exist:

refer to attachment.
nagiosxi sessions error.JPG
The other server seems to be working fine. Any pointer on how we can resolve this?

Re: xi_sessions does not exist Error After Upgrade to 5.5.2

Posted: Mon Aug 13, 2018 7:15 am
by jomann
I would verify that all the new XI 5.5 tables have been created. You should save the below SQL into a file and then import it into your nagiosxi database - is your XI using postgresql or mysql?

Code: Select all

CREATE TABLE IF NOT EXISTS `nagiosxi`.`xi_auth_tokens` (
    `auth_token_id` int auto_increment,
    `auth_user_id` int not null,
    `auth_session_id` int not null,
    `auth_token` varchar(128),
    `auth_valid_until` datetime,
    `auth_expires_at` datetime,
    `auth_restrictions` mediumtext,
    `auth_used` smallint default 0 not null,
    primary key (`auth_token_id`),
    unique (`auth_token_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `nagiosxi`.`xi_sessions` (
    `session_id` int auto_increment,
    `session_phpid` varchar(128),
    `session_created` datetime,
    `session_user_id` int not null,
    `session_address` varchar(128),
    `session_page` varchar(255),
    `session_data` text,
    `session_last_active` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE current_timestamp,
    primary key (`session_id`),
    unique (`session_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `nagiosxi`.`xi_cmp_trapdata` (
    `trapdata_id` int auto_increment,
    `trapdata_updated` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE current_timestamp,
    `trapdata_enabled` smallint default 1,
    `trapdata_event_name` varchar(128) NOT NULL default '',
    `trapdata_event_oid` varchar(256) NOT NULL default '',
    `trapdata_category` varchar(128) NOT NULL default '',
    `trapdata_severity` varchar(64) NOT NULL default '',
    `trapdata_custom_format` text,
    `trapdata_raw_data` text,
    `trapdata_exec` text,
    `trapdata_desc` text,
    `trapdata_wizard_integration_enabled` smallint default 0,
    `trapdata_wizard_integration_data` text,
    primary key (`trapdata_id`),
    unique (`trapdata_event_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `nagiosxi`.`xi_cmp_trapdata_log` (
    `trapdata_log_id` int auto_increment,
    `trapdata_log_event_name` varchar(128) NOT NULL default '',
    `trapdata_log_event_oid` varchar(50) NOT NULL default '',
    `trapdata_log_numeric_oid` varchar(100),
    `trapdata_log_symbolic_oid` varchar(100),
    `trapdata_log_community` varchar(20),
    `trapdata_log_trap_hostname` varchar(100),
    `trapdata_log_trap_ip` varchar(16),
    `trapdata_log_agent_hostname` varchar(100),
    `trapdata_log_agent_IP` varchar(16),
    `trapdata_log_category` varchar(20) NOT NULL default '',
    `trapdata_log_severity` varchar(20) NOT NULL default '',
    `trapdata_log_uptime` varchar(20) NOT NULL default '',
    `trapdata_log_datetime` datetime,
    `trapdata_log_bindings` text,
    primary key (`trapdata_log_id`),
    unique (`trapdata_log_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;

Re: xi_sessions does not exist Error After Upgrade to 5.5.2

Posted: Thu Aug 23, 2018 12:12 am
by ariawenda
@jomann: Thank you for your prompt reply. It seems to be able to resolve the issue.

Now we are facing a new issue of Monitoring Engine failed to start. Screenshot attached.

We tried to stop and start it again but it's still reporting as not running.

Re: xi_sessions does not exist Error After Upgrade to 5.5.2

Posted: Thu Aug 23, 2018 3:08 pm
by ssax
Please run this command:

Code: Select all

service nagios restart
Then look in your /var/log/messages and your /usr/local/nagios/var/nagios.log and post any relevant errors/messages.

Re: xi_sessions does not exist Error After Upgrade to 5.5.2

Posted: Sun Aug 26, 2018 10:26 pm
by ariawenda
For the moment, the service restart seems to work. Thank you very much for your quick response.

We can consider this as solved then.

Re: xi_sessions does not exist Error After Upgrade to 5.5.2

Posted: Mon Aug 27, 2018 12:48 pm
by ssax
Did the upgrade fail in the middle? Were you able to re-run the upgrade successfully?