From 6d6826cc077ff16d8396a11d3b35a4af35bacf63 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Thu, 16 Jul 2015 13:24:49 +0200 Subject: [PATCH] DB IDO: Do not update endpointstatus table on config updates fixes #9634 --- lib/db_ido/endpointdbobject.cpp | 22 ---------------------- lib/db_ido/endpointdbobject.hpp | 3 --- 2 files changed, 25 deletions(-) diff --git a/lib/db_ido/endpointdbobject.cpp b/lib/db_ido/endpointdbobject.cpp index 504ba3f25..db42f48da 100644 --- a/lib/db_ido/endpointdbobject.cpp +++ b/lib/db_ido/endpointdbobject.cpp @@ -106,25 +106,3 @@ int EndpointDbObject::EndpointIsConnected(const Endpoint::Ptr& endpoint) return is_connected; } - -void EndpointDbObject::OnConfigUpdate(void) -{ - /* update current status on config dump once */ - Endpoint::Ptr endpoint = static_pointer_cast(GetObject()); - - DbQuery query1; - query1.Table = "endpointstatus"; - query1.Type = DbQueryInsert; - query1.Category = DbCatConfig; - - Dictionary::Ptr fields1 = new Dictionary(); - fields1->Set("identity", endpoint->GetName()); - fields1->Set("node", IcingaApplication::GetInstance()->GetNodeName()); - fields1->Set("is_connected", EndpointIsConnected(endpoint)); - fields1->Set("status_update_time", DbValue::FromTimestamp(Utility::GetTime())); - fields1->Set("endpoint_object_id", endpoint); - fields1->Set("instance_id", 0); /* DbConnection class fills in real ID */ - query1.Fields = fields1; - - OnQuery(query1); -} diff --git a/lib/db_ido/endpointdbobject.hpp b/lib/db_ido/endpointdbobject.hpp index febe64a20..66f6555ea 100644 --- a/lib/db_ido/endpointdbobject.hpp +++ b/lib/db_ido/endpointdbobject.hpp @@ -44,9 +44,6 @@ public: virtual Dictionary::Ptr GetConfigFields(void) const; virtual Dictionary::Ptr GetStatusFields(void) const; -protected: - virtual void OnConfigUpdate(void); - private: static void UpdateConnectedStatus(const Endpoint::Ptr& endpoint); static int EndpointIsConnected(const Endpoint::Ptr& endpoint);