mirror of https://github.com/Icinga/icinga2.git
Revert "DB IDO: Add check_source_object_id reference to endpoint objects."
There's not necessarily a 1:1 relation between the check source node
name and the endpoint name.
This reverts commit a26df23e3d
.
Refs #5810
Refs #5636
Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
This commit is contained in:
parent
0c7d53503d
commit
bda7e9f362
|
@ -1398,10 +1398,6 @@ ALTER TABLE icinga_servicechecks ADD COLUMN endpoint_object_id bigint default NU
|
||||||
ALTER TABLE icinga_statehistory ADD COLUMN endpoint_object_id bigint default NULL;
|
ALTER TABLE icinga_statehistory ADD COLUMN endpoint_object_id bigint default NULL;
|
||||||
ALTER TABLE icinga_systemcommands ADD COLUMN endpoint_object_id bigint default NULL;
|
ALTER TABLE icinga_systemcommands ADD COLUMN endpoint_object_id bigint default NULL;
|
||||||
|
|
||||||
ALTER TABLE icinga_servicestatus ADD COLUMN check_source_object_id bigint default NULL;
|
|
||||||
ALTER TABLE icinga_hoststatus ADD COLUMN check_source_object_id bigint default NULL;
|
|
||||||
ALTER TABLE icinga_statehistory ADD COLUMN check_source_object_id bigint default NULL;
|
|
||||||
|
|
||||||
|
|
||||||
-- -----------------------------------------
|
-- -----------------------------------------
|
||||||
-- add index (delete)
|
-- add index (delete)
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
|
|
||||||
ALTER TABLE icinga_servicestatus ADD COLUMN check_source_object_id bigint default NULL;
|
|
||||||
ALTER TABLE icinga_hoststatus ADD COLUMN check_source_object_id bigint default NULL;
|
|
||||||
ALTER TABLE icinga_statehistory ADD COLUMN check_source_object_id bigint default NULL;
|
|
|
@ -1426,9 +1426,6 @@ ALTER TABLE icinga_servicechecks ADD COLUMN endpoint_object_id bigint default NU
|
||||||
ALTER TABLE icinga_statehistory ADD COLUMN endpoint_object_id bigint default NULL;
|
ALTER TABLE icinga_statehistory ADD COLUMN endpoint_object_id bigint default NULL;
|
||||||
ALTER TABLE icinga_systemcommands ADD COLUMN endpoint_object_id bigint default NULL;
|
ALTER TABLE icinga_systemcommands ADD COLUMN endpoint_object_id bigint default NULL;
|
||||||
|
|
||||||
ALTER TABLE icinga_servicestatus ADD COLUMN check_source_object_id bigint default NULL;
|
|
||||||
ALTER TABLE icinga_hoststatus ADD COLUMN check_source_object_id bigint default NULL;
|
|
||||||
ALTER TABLE icinga_statehistory ADD COLUMN check_source_object_id bigint default NULL;
|
|
||||||
|
|
||||||
-- -----------------------------------------
|
-- -----------------------------------------
|
||||||
-- add index (delete)
|
-- add index (delete)
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
|
|
||||||
ALTER TABLE icinga_servicestatus ADD COLUMN check_source_object_id bigint default NULL;
|
|
||||||
ALTER TABLE icinga_hoststatus ADD COLUMN check_source_object_id bigint default NULL;
|
|
||||||
ALTER TABLE icinga_statehistory ADD COLUMN check_source_object_id bigint default NULL;
|
|
||||||
|
|
|
@ -145,14 +145,7 @@ Dictionary::Ptr ServiceDbObject::GetStatusFields(void) const
|
||||||
fields->Set("output", CompatUtility::GetCheckResultOutput(cr));
|
fields->Set("output", CompatUtility::GetCheckResultOutput(cr));
|
||||||
fields->Set("long_output", CompatUtility::GetCheckResultLongOutput(cr));
|
fields->Set("long_output", CompatUtility::GetCheckResultLongOutput(cr));
|
||||||
fields->Set("perfdata", CompatUtility::GetCheckResultPerfdata(cr));
|
fields->Set("perfdata", CompatUtility::GetCheckResultPerfdata(cr));
|
||||||
|
fields->Set("check_source", cr->GetCheckSource());
|
||||||
String check_source = cr->GetCheckSource();
|
|
||||||
fields->Set("check_source", check_source);
|
|
||||||
|
|
||||||
Endpoint::Ptr check_endpoint = Endpoint::GetByName(check_source);
|
|
||||||
|
|
||||||
if(check_endpoint)
|
|
||||||
fields->Set("check_source_object_id", check_endpoint);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fields->Set("current_state", CompatUtility::GetServiceCurrentState(service));
|
fields->Set("current_state", CompatUtility::GetServiceCurrentState(service));
|
||||||
|
@ -894,14 +887,7 @@ void ServiceDbObject::AddStateChangeHistory(const Service::Ptr& service, const C
|
||||||
if (cr) {
|
if (cr) {
|
||||||
fields1->Set("output", CompatUtility::GetCheckResultOutput(cr));
|
fields1->Set("output", CompatUtility::GetCheckResultOutput(cr));
|
||||||
fields1->Set("long_output", CompatUtility::GetCheckResultLongOutput(cr));
|
fields1->Set("long_output", CompatUtility::GetCheckResultLongOutput(cr));
|
||||||
|
fields1->Set("check_source", cr->GetCheckSource());
|
||||||
String check_source = cr->GetCheckSource();
|
|
||||||
fields1->Set("check_source", check_source);
|
|
||||||
|
|
||||||
Endpoint::Ptr check_endpoint = Endpoint::GetByName(check_source);
|
|
||||||
|
|
||||||
if(check_endpoint)
|
|
||||||
fields1->Set("check_source_object_id", check_endpoint);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fields1->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
fields1->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||||
|
|
Loading…
Reference in New Issue