Nagiosxi tables

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
lamin
Posts: 177
Joined: Thu Oct 28, 2010 6:59 am

Re: Nagiosxi tables

Post by lamin »

Here is the result
You do not have the required permissions to view the files attached to this post.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Nagiosxi tables

Post by mguthrie »

Ok, so it looks like the tables are clear of corruption.

Lets check the los and see if the data is failing to write. You can run:

Code: Select all

tail -f /usr/local/nagios/var/nagios.log
and see if there are any error message related to those tables. If we don't find anything there we might have to rebuild them.
lamin
Posts: 177
Joined: Thu Oct 28, 2010 6:59 am

Re: Nagiosxi tables

Post by lamin »

I did not see any database error in nagios log.
You do not have the required permissions to view the files attached to this post.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Nagiosxi tables

Post by mguthrie »

Just a review first before we look at rebuilding the table. How did you determine that those tables were empty and didn't have any data in them?
lamin
Posts: 177
Joined: Thu Oct 28, 2010 6:59 am

Re: Nagiosxi tables

Post by lamin »

i ran a select * from nagios_servicechecks; then i saw that the table is empty. Will i lose my current data if we decide to rebuild the database?

Thanks
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Nagiosxi tables

Post by mguthrie »

If those tables are empty, then the data is probably lost already. However, if Nagios is currently unable to write to them, there *should* be some "ndo2db" or "ndoutils" messages showing up somewhere in the nagios.log file.

I might also suggest going through our backup procedure before rebuilding the table.
http://assets.nagios.com/downloads/nagi ... kuprestore


To rebuild the table, we'll first have to drop it.

Code: Select all

DROP TABL nagios_servicechecks;
Here's the CREATE query for that table.

Code: Select all

CREATE TABLE IF NOT EXISTS `nagios_servicechecks` (
  `servicecheck_id` int(11) NOT NULL auto_increment,
  `instance_id` smallint(6) NOT NULL default '0',
  `service_object_id` int(11) NOT NULL default '0',
  `check_type` smallint(6) NOT NULL default '0',
  `current_check_attempt` smallint(6) NOT NULL default '0',
  `max_check_attempts` smallint(6) NOT NULL default '0',
  `state` smallint(6) NOT NULL default '0',
  `state_type` smallint(6) NOT NULL default '0',
  `start_time` datetime NOT NULL default '0000-00-00 00:00:00',
  `start_time_usec` int(11) NOT NULL default '0',
  `end_time` datetime NOT NULL default '0000-00-00 00:00:00',
  `end_time_usec` int(11) NOT NULL default '0',
  `command_object_id` int(11) NOT NULL default '0',
  `command_args` varchar(255) character set latin1 NOT NULL default '',
  `command_line` varchar(255) character set latin1 NOT NULL default '',
  `timeout` smallint(6) NOT NULL default '0',
  `early_timeout` smallint(6) NOT NULL default '0',
  `execution_time` double NOT NULL default '0',
  `latency` double NOT NULL default '0',
  `return_code` smallint(6) NOT NULL default '0',
  `output` varchar(255) character set latin1 NOT NULL default '',
  `long_output` varchar(8192) NOT NULL default '',
  `perfdata` varchar(255) character set latin1 NOT NULL default '',
  PRIMARY KEY  (`servicecheck_id`),
  KEY `instance_id` (`instance_id`),
  KEY `service_object_id` (`service_object_id`),
  KEY `start_time` (`start_time`)
) ENGINE=MyISAM  COMMENT='Historical service checks';
lamin
Posts: 177
Joined: Thu Oct 28, 2010 6:59 am

Re: Nagiosxi tables

Post by lamin »

Remember, everything is running ok except the two tables (nagios_servicechecks and nagios_hostchecks). Right now I am seeing and getting all output from my devices but I need those tables to be populated.

Thanks
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Nagiosxi tables

Post by mguthrie »

Can you upload your nagios.log, and also check to see if you can access any information for a host or service state history or availability (in the reports section).
lamin
Posts: 177
Joined: Thu Oct 28, 2010 6:59 am

Re: Nagiosxi tables

Post by lamin »

Attached are the availability and the state reports.
You do not have the required permissions to view the files attached to this post.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Nagiosxi tables

Post by mguthrie »

So I'm not seeing anything in the log to indicate an issue, and the fact that you're able to access your reports and historical data seems to indicate that there isn't actually a problem here from what I can tell. Those reports pull data directory from those tables.
Locked