Page 2 of 4

Re: Nagiosxi tables

Posted: Tue Dec 06, 2011 1:33 pm
by lamin
Here is the result

Re: Nagiosxi tables

Posted: Tue Dec 06, 2011 2:14 pm
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.

Re: Nagiosxi tables

Posted: Tue Dec 06, 2011 2:35 pm
by lamin
I did not see any database error in nagios log.

Re: Nagiosxi tables

Posted: Wed Dec 07, 2011 10:06 am
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?

Re: Nagiosxi tables

Posted: Wed Dec 07, 2011 10:25 am
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

Re: Nagiosxi tables

Posted: Wed Dec 07, 2011 10:44 am
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';

Re: Nagiosxi tables

Posted: Wed Dec 07, 2011 11:39 am
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

Re: Nagiosxi tables

Posted: Wed Dec 07, 2011 4:52 pm
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).

Re: Nagiosxi tables

Posted: Thu Dec 08, 2011 7:44 am
by lamin
Attached are the availability and the state reports.

Re: Nagiosxi tables

Posted: Thu Dec 08, 2011 10:35 am
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.