DB IDO: Add check_source to statehistory table.

Refs #5470
This commit is contained in:
Michael Friedrich 2014-02-06 16:01:03 +01:00
parent 1e0a11c7f2
commit 07615f14e8
3 changed files with 8 additions and 0 deletions

View File

@ -1277,6 +1277,7 @@ CREATE TABLE IF NOT EXISTS icinga_statehistory (
last_hard_state smallint default 0,
output TEXT character set latin1 default '',
long_output TEXT default '',
check_source varchar(255) character set latin1 default NULL,
PRIMARY KEY (statehistory_id)
) ENGINE=InnoDB COMMENT='Historical host and service state changes';
@ -1524,6 +1525,9 @@ CREATE INDEX sla_idx_sthist ON icinga_statehistory (object_id, state_time DESC);
CREATE INDEX sla_idx_dohist ON icinga_downtimehistory (object_id, actual_start_time, actual_end_time);
CREATE INDEX sla_idx_obj ON icinga_objects (objecttype_id, is_active, name1);
-- #4985
CREATE INDEX commenthistory_delete_idx ON icinga_commenthistory (instance_id, comment_time, internal_comment_id);
-- -----------------------------------------
-- set dbversion
-- -----------------------------------------

View File

@ -1303,6 +1303,7 @@ CREATE TABLE icinga_statehistory (
last_hard_state INTEGER default '-1',
output TEXT default '',
long_output TEXT default '',
check_source varchar(255) default NULL,
CONSTRAINT PK_statehistory_id PRIMARY KEY (statehistory_id)
) ;
@ -1550,6 +1551,8 @@ CREATE INDEX sla_idx_sthist ON icinga_statehistory (object_id, state_time DESC);
CREATE INDEX sla_idx_dohist ON icinga_downtimehistory (object_id, actual_start_time, actual_end_time);
CREATE INDEX sla_idx_obj ON icinga_objects (objecttype_id, is_active, name1);
-- #4985
CREATE INDEX commenthistory_delete_idx ON icinga_commenthistory (instance_id, comment_time, internal_comment_id);
-- -----------------------------------------
-- set dbversion

View File

@ -861,6 +861,7 @@ void ServiceDbObject::AddStateChangeHistory(const Service::Ptr& service, const C
if (cr) {
fields1->Set("output", CompatUtility::GetCheckResultOutput(cr));
fields1->Set("long_output", CompatUtility::GetCheckResultLongOutput(cr));
fields1->Set("check_source", cr->GetCheckSource());
}
fields1->Set("instance_id", 0); /* DbConnection class fills in real ID */