From 788104980c474ee9703142641cb8322228eb9a9c Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 28 Aug 2013 16:08:22 +0200 Subject: [PATCH] Implement cluster events for downtimes. --- components/cluster/clustercomponent.cpp | 65 ++++++++++++ components/cluster/clustercomponent.h | 2 + components/compat/compatlog.cpp | 128 ++++++++++++------------ lib/icinga/externalcommandprocessor.cpp | 21 ++-- lib/icinga/service-downtime.cpp | 64 ++++++------ lib/icinga/service.h | 12 ++- lib/ido/servicedbobject.cpp | 96 ++---------------- lib/ido/servicedbobject.h | 5 +- 8 files changed, 199 insertions(+), 194 deletions(-) diff --git a/components/cluster/clustercomponent.cpp b/components/cluster/clustercomponent.cpp index 33cb172e4..628a14bf0 100644 --- a/components/cluster/clustercomponent.cpp +++ b/components/cluster/clustercomponent.cpp @@ -60,6 +60,8 @@ void ClusterComponent::Start(void) Service::OnEnablePassiveChecksChanged.connect(bind(&ClusterComponent::EnablePassiveChecksChangedHandler, this, _1, _2, _3)); Service::OnCommentAdded.connect(bind(&ClusterComponent::CommentAddedHandler, this, _1, _2, _3)); Service::OnCommentRemoved.connect(bind(&ClusterComponent::CommentRemovedHandler, this, _1, _2, _3)); + Service::OnDowntimeAdded.connect(bind(&ClusterComponent::DowntimeAddedHandler, this, _1, _2, _3)); + Service::OnDowntimeRemoved.connect(bind(&ClusterComponent::DowntimeRemovedHandler, this, _1, _2, _3)); Endpoint::OnMessageReceived.connect(bind(&ClusterComponent::MessageHandler, this, _1, _2)); } @@ -404,6 +406,44 @@ void ClusterComponent::CommentRemovedHandler(const Service::Ptr& service, const } } +void ClusterComponent::DowntimeAddedHandler(const Service::Ptr& service, const Dictionary::Ptr& downtime, const String& authority) +{ + if (!authority.IsEmpty() && authority != GetIdentity()) + return; + + Dictionary::Ptr params = boost::make_shared(); + params->Set("service", service->GetName()); + params->Set("downtime", downtime); + + Dictionary::Ptr message = boost::make_shared(); + message->Set("jsonrpc", "2.0"); + message->Set("method", "cluster::AddDowntime"); + message->Set("params", params); + + BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjects()) { + endpoint->SendMessage(message); + } +} + +void ClusterComponent::DowntimeRemovedHandler(const Service::Ptr& service, const Dictionary::Ptr& downtime, const String& authority) +{ + if (!authority.IsEmpty() && authority != GetIdentity()) + return; + + Dictionary::Ptr params = boost::make_shared(); + params->Set("service", service->GetName()); + params->Set("id", downtime->Get("id")); + + Dictionary::Ptr message = boost::make_shared(); + message->Set("jsonrpc", "2.0"); + message->Set("method", "cluster::RemoveDowntime"); + message->Set("params", params); + + BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjects()) { + endpoint->SendMessage(message); + } +} + void ClusterComponent::MessageHandler(const Endpoint::Ptr& sender, const Dictionary::Ptr& message) { BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjects()) { @@ -509,6 +549,31 @@ void ClusterComponent::MessageHandler(const Endpoint::Ptr& sender, const Diction String id = params->Get("id"); service->RemoveComment(id, sender->GetName()); + } else if (message->Get("method") == "cluster::AddDowntime") { + String svc = params->Get("service"); + + Service::Ptr service = Service::GetByName(svc); + + if (!service) + return; + + Dictionary::Ptr downtime = params->Get("downtime"); + + service->AddDowntime(downtime->Get("comment_id"), + downtime->Get("start_time"), downtime->Get("end_time"), + downtime->Get("fixed"), downtime->Get("triggered_by"), + downtime->Get("duration"), downtime->Get("id"), sender->GetName()); + } else if (message->Get("method") == "cluster::RemoveDowntime") { + String svc = params->Get("service"); + + Service::Ptr service = Service::GetByName(svc); + + if (!service) + return; + + String id = params->Get("id"); + + service->RemoveDowntime(id, sender->GetName()); } } diff --git a/components/cluster/clustercomponent.h b/components/cluster/clustercomponent.h index 1abee36e5..c72d8f3be 100644 --- a/components/cluster/clustercomponent.h +++ b/components/cluster/clustercomponent.h @@ -87,6 +87,8 @@ private: void EnablePassiveChecksChangedHandler(const Service::Ptr& service, bool enabled, const String& authority); void CommentAddedHandler(const Service::Ptr& service, const Dictionary::Ptr& comment, const String& authority); void CommentRemovedHandler(const Service::Ptr& service, const Dictionary::Ptr& comment, const String& authority); + void DowntimeAddedHandler(const Service::Ptr& service, const Dictionary::Ptr& downtime, const String& authority); + void DowntimeRemovedHandler(const Service::Ptr& service, const Dictionary::Ptr& downtime, const String& authority); void MessageHandler(const Endpoint::Ptr& sender, const Dictionary::Ptr& message); }; diff --git a/components/compat/compatlog.cpp b/components/compat/compatlog.cpp index 0469168ac..da2797606 100644 --- a/components/compat/compatlog.cpp +++ b/components/compat/compatlog.cpp @@ -50,7 +50,7 @@ CompatLog::CompatLog(void) void CompatLog::Start(void) { Service::OnNewCheckResult.connect(bind(&CompatLog::CheckResultHandler, this, _1, _2)); - Service::OnDowntimeChanged.connect(bind(&CompatLog::DowntimeHandler, this, _1, _2)); +// Service::OnDowntimeTriggered.connect(bind(&CompatLog::DowntimeHandler, this, _1)); Service::OnNotificationSentChanged.connect(bind(&CompatLog::NotificationSentHandler, this, _1, _2, _3, _4, _5, _6)); Service::OnFlappingChanged.connect(bind(&CompatLog::FlappingHandler, this, _1, _2)); @@ -165,69 +165,69 @@ void CompatLog::CheckResultHandler(const Service::Ptr& service, const Dictionary } } -/** - * @threadsafety Always. - */ -void CompatLog::DowntimeHandler(const Service::Ptr& service, DowntimeState downtime_state) -{ - Host::Ptr host = service->GetHost(); - - if (!host) - return; - - String downtime_state_str; - String downtime_output; - - switch (downtime_state) { - case DowntimeStarted: - downtime_output = "Service has entered a period of scheduled downtime."; - downtime_state_str = "STARTED"; - break; - case DowntimeStopped: - downtime_output = "Service has exited from a period of scheduled downtime."; - downtime_state_str = "STOPPED"; - break; - case DowntimeCancelled: - downtime_output = "Scheduled downtime for service has been cancelled."; - downtime_state_str = "CANCELLED"; - break; - default: - Log(LogCritical, "compat", "Unknown downtime state: " + Convert::ToString(downtime_state)); - return; - } - - std::ostringstream msgbuf; - msgbuf << "SERVICE DOWNTIME ALERT: " - << host->GetName() << ";" - << service->GetShortName() << ";" - << downtime_state_str << "; " - << downtime_output - << ""; - - { - ObjectLock oLock(this); - WriteLine(msgbuf.str()); - } - - if (service == host->GetHostCheckService()) { - std::ostringstream msgbuf; - msgbuf << "HOST DOWNTIME ALERT: " - << host->GetName() << ";" - << downtime_state_str << "; " - << downtime_output - << ""; - - { - ObjectLock oLock(this); - WriteLine(msgbuf.str()); - } - } - - { - ObjectLock oLock(this); - Flush(); - } -} +///** +// * @threadsafety Always. +// */ +//void CompatLog::DowntimeHandler(const Service::Ptr& service) +//{ +// Host::Ptr host = service->GetHost(); +// +// if (!host) +// return; +// +// String downtime_state_str; +// String downtime_output; +// +// switch (downtime_state) { +// case DowntimeStarted: +// downtime_output = "Service has entered a period of scheduled downtime."; +// downtime_state_str = "STARTED"; +// break; +// case DowntimeStopped: +// downtime_output = "Service has exited from a period of scheduled downtime."; +// downtime_state_str = "STOPPED"; +// break; +// case DowntimeCancelled: +// downtime_output = "Scheduled downtime for service has been cancelled."; +// downtime_state_str = "CANCELLED"; +// break; +// default: +// Log(LogCritical, "compat", "Unknown downtime state: " + Convert::ToString(downtime_state)); +// return; +// } +// +// std::ostringstream msgbuf; +// msgbuf << "SERVICE DOWNTIME ALERT: " +// << host->GetName() << ";" +// << service->GetShortName() << ";" +// << downtime_state_str << "; " +// << downtime_output +// << ""; +// +// { +// ObjectLock oLock(this); +// WriteLine(msgbuf.str()); +// } +// +// if (service == host->GetHostCheckService()) { +// std::ostringstream msgbuf; +// msgbuf << "HOST DOWNTIME ALERT: " +// << host->GetName() << ";" +// << downtime_state_str << "; " +// << downtime_output +// << ""; +// +// { +// ObjectLock oLock(this); +// WriteLine(msgbuf.str()); +// } +// } +// +// { +// ObjectLock oLock(this); +// Flush(); +// } +//} /** * @threadsafety Always. diff --git a/lib/icinga/externalcommandprocessor.cpp b/lib/icinga/externalcommandprocessor.cpp index ef8e8768c..99de51bdc 100644 --- a/lib/icinga/externalcommandprocessor.cpp +++ b/lib/icinga/externalcommandprocessor.cpp @@ -864,7 +864,8 @@ void ExternalCommandProcessor::ScheduleSvcDowntime(double, const std::vectorGetName()); - (void) service->AddDowntime(arguments[7], arguments[8], + String comment_id = service->AddComment(CommentDowntime, arguments[7], arguments[8], Convert::ToDouble(arguments[3])); + (void) service->AddDowntime(comment_id, Convert::ToDouble(arguments[2]), Convert::ToDouble(arguments[3]), Convert::ToBool(arguments[4]), triggeredBy, Convert::ToDouble(arguments[6])); } @@ -895,7 +896,8 @@ void ExternalCommandProcessor::ScheduleHostDowntime(double, const std::vectorGetName()); Service::Ptr service = host->GetHostCheckService(); if (service) { - (void) service->AddDowntime(arguments[6], arguments[7], + String comment_id = service->AddComment(CommentDowntime, arguments[6], arguments[7], Convert::ToDouble(arguments[2])); + (void) service->AddDowntime(comment_id, Convert::ToDouble(arguments[1]), Convert::ToDouble(arguments[2]), Convert::ToBool(arguments[3]), triggeredBy, Convert::ToDouble(arguments[5])); } @@ -926,7 +928,8 @@ void ExternalCommandProcessor::ScheduleHostSvcDowntime(double, const std::vector BOOST_FOREACH(const Service::Ptr& service, host->GetServices()) { Log(LogInformation, "icinga", "Creating downtime for service " + service->GetName()); - (void) service->AddDowntime(arguments[6], arguments[7], + String comment_id = service->AddComment(CommentDowntime, arguments[6], arguments[7], Convert::ToDouble(arguments[2])); + (void) service->AddDowntime(comment_id, Convert::ToDouble(arguments[1]), Convert::ToDouble(arguments[2]), Convert::ToBool(arguments[3]), triggeredBy, Convert::ToDouble(arguments[5])); } @@ -948,7 +951,8 @@ void ExternalCommandProcessor::ScheduleHostgroupHostDowntime(double, const std:: Log(LogInformation, "icinga", "Creating downtime for host " + host->GetName()); Service::Ptr service = host->GetHostCheckService(); if (service) { - (void) service->AddDowntime(arguments[6], arguments[7], + String comment_id = service->AddComment(CommentDowntime, arguments[6], arguments[7], Convert::ToDouble(arguments[2])); + (void) service->AddDowntime(comment_id, Convert::ToDouble(arguments[1]), Convert::ToDouble(arguments[2]), Convert::ToBool(arguments[3]), triggeredBy, Convert::ToDouble(arguments[5])); } @@ -981,7 +985,8 @@ void ExternalCommandProcessor::ScheduleHostgroupSvcDowntime(double, const std::v BOOST_FOREACH(const Service::Ptr& service, services) { Log(LogInformation, "icinga", "Creating downtime for service " + service->GetName()); - (void) service->AddDowntime(arguments[6], arguments[7], + String comment_id = service->AddComment(CommentDowntime, arguments[6], arguments[7], Convert::ToDouble(arguments[2])); + (void) service->AddDowntime(comment_id, Convert::ToDouble(arguments[1]), Convert::ToDouble(arguments[2]), Convert::ToBool(arguments[3]), triggeredBy, Convert::ToDouble(arguments[5])); } @@ -1014,7 +1019,8 @@ void ExternalCommandProcessor::ScheduleServicegroupHostDowntime(double, const st BOOST_FOREACH(const Service::Ptr& service, services) { Log(LogInformation, "icinga", "Creating downtime for service " + service->GetName()); - (void) service->AddDowntime(arguments[6], arguments[7], + String comment_id = service->AddComment(CommentDowntime, arguments[6], arguments[7], Convert::ToDouble(arguments[2])); + (void) service->AddDowntime(comment_id, Convert::ToDouble(arguments[1]), Convert::ToDouble(arguments[2]), Convert::ToBool(arguments[3]), triggeredBy, Convert::ToDouble(arguments[5])); } @@ -1034,7 +1040,8 @@ void ExternalCommandProcessor::ScheduleServicegroupSvcDowntime(double, const std BOOST_FOREACH(const Service::Ptr& service, sg->GetMembers()) { Log(LogInformation, "icinga", "Creating downtime for service " + service->GetName()); - (void) service->AddDowntime(arguments[6], arguments[7], + String comment_id = service->AddComment(CommentDowntime, arguments[6], arguments[7], Convert::ToDouble(arguments[2])); + (void) service->AddDowntime(comment_id, Convert::ToDouble(arguments[1]), Convert::ToDouble(arguments[2]), Convert::ToBool(arguments[3]), triggeredBy, Convert::ToDouble(arguments[5])); } diff --git a/lib/icinga/service-downtime.cpp b/lib/icinga/service-downtime.cpp index 836197104..cba3ef8bc 100644 --- a/lib/icinga/service-downtime.cpp +++ b/lib/icinga/service-downtime.cpp @@ -35,8 +35,9 @@ static std::map l_LegacyDowntimesCache; static std::map l_DowntimesCache; static Timer::Ptr l_DowntimesExpireTimer; -boost::signals2::signal Service::OnDowntimeChanged; -boost::signals2::signal Service::OnDowntimesChanged; +boost::signals2::signal Service::OnDowntimeAdded; +boost::signals2::signal Service::OnDowntimeRemoved; +boost::signals2::signal Service::OnDowntimeTriggered; int Service::GetNextDowntimeID(void) { @@ -50,14 +51,21 @@ Dictionary::Ptr Service::GetDowntimes(void) const return m_Downtimes; } -String Service::AddDowntime(const String& author, const String& comment, +String Service::AddDowntime(const String& comment_id, double startTime, double endTime, bool fixed, - const String& triggeredBy, double duration) + const String& triggeredBy, double duration, const String& id, const String& authority) { + String uid; + + if (id.IsEmpty()) + uid = Utility::NewUniqueID(); + else + uid = id; + Dictionary::Ptr downtime = boost::make_shared(); + downtime->Set("id", uid); downtime->Set("entry_time", Utility::GetTime()); - downtime->Set("author", author); - downtime->Set("comment", comment); + downtime->Set("comment_id", comment_id); downtime->Set("start_time", startTime); downtime->Set("end_time", endTime); downtime->Set("fixed", fixed); @@ -100,23 +108,20 @@ String Service::AddDowntime(const String& author, const String& comment, m_Downtimes = downtimes; } - String id = Utility::NewUniqueID(); - downtimes->Set(id, downtime); - - (void) AddComment(CommentDowntime, author, comment, endTime); + downtimes->Set(uid, downtime); { boost::mutex::scoped_lock lock(l_DowntimeMutex); - l_LegacyDowntimesCache[legacy_id] = id; - l_DowntimesCache[id] = GetSelf(); + l_LegacyDowntimesCache[legacy_id] = uid; + l_DowntimesCache[uid] = GetSelf(); } - OnDowntimesChanged(GetSelf(), id, DowntimeChangedAdded); + OnDowntimeAdded(GetSelf(), downtime, authority); - return id; + return uid; } -void Service::RemoveDowntime(const String& id) +void Service::RemoveDowntime(const String& id, const String& authority) { Service::Ptr owner = GetOwnerByDowntimeID(id); @@ -128,25 +133,25 @@ void Service::RemoveDowntime(const String& id) if (!downtimes) return; - { - ObjectLock olock(owner); + ObjectLock olock(owner); - Dictionary::Ptr downtime = downtimes->Get(id); + Dictionary::Ptr downtime = downtimes->Get(id); - int legacy_id = downtime->Get("legacy_id"); + String comment_id = downtime->Get("comment_id"); + + RemoveComment(comment_id); - downtimes->Remove(id); + int legacy_id = downtime->Get("legacy_id"); - { - boost::mutex::scoped_lock lock(l_DowntimeMutex); - l_LegacyDowntimesCache.erase(legacy_id); - l_DowntimesCache.erase(id); - } - } + downtimes->Remove(id); - OnDowntimeChanged(owner, DowntimeCancelled); + { + boost::mutex::scoped_lock lock(l_DowntimeMutex); + l_LegacyDowntimesCache.erase(legacy_id); + l_DowntimesCache.erase(id); + } - OnDowntimesChanged(owner, id, DowntimeChangedDeleted); + OnDowntimeRemoved(owner, downtime, authority); } void Service::TriggerDowntimes(void) @@ -196,8 +201,7 @@ void Service::TriggerDowntime(const String& id) TriggerDowntime(tid); } - OnDowntimeChanged(owner, DowntimeStarted); - OnDowntimesChanged(owner, Empty, DowntimeChangedUpdated); + OnDowntimeTriggered(owner, downtime); } String Service::GetDowntimeIDFromLegacyID(int id) diff --git a/lib/icinga/service.h b/lib/icinga/service.h index f835ac26a..58e9db000 100644 --- a/lib/icinga/service.h +++ b/lib/icinga/service.h @@ -241,11 +241,12 @@ public: static boost::signals2::signal OnNewCheckResult; static boost::signals2::signal OnNotificationsRequested; static boost::signals2::signal OnNotificationSentChanged; - static boost::signals2::signal OnDowntimeChanged; static boost::signals2::signal OnFlappingChanged; static boost::signals2::signal OnCommentAdded; static boost::signals2::signal OnCommentRemoved; - static boost::signals2::signal OnDowntimesChanged; + static boost::signals2::signal OnDowntimeAdded; + static boost::signals2::signal OnDowntimeRemoved; + static boost::signals2::signal OnDowntimeTriggered; virtual bool ResolveMacro(const String& macro, const Dictionary::Ptr& cr, String *result) const; @@ -255,11 +256,12 @@ public: Dictionary::Ptr GetDowntimes(void) const; int GetDowntimeDepth(void) const; - String AddDowntime(const String& author, const String& comment, + String AddDowntime(const String& comment_id, double startTime, double endTime, bool fixed, - const String& triggeredBy, double duration); + const String& triggeredBy, double duration, + const String& id = String(), const String& authority = String()); - static void RemoveDowntime(const String& id); + static void RemoveDowntime(const String& id, const String& = String()); void TriggerDowntimes(void); static void TriggerDowntime(const String& id); diff --git a/lib/ido/servicedbobject.cpp b/lib/ido/servicedbobject.cpp index 5e6e773b3..8af8e5120 100644 --- a/lib/ido/servicedbobject.cpp +++ b/lib/ido/servicedbobject.cpp @@ -41,7 +41,9 @@ void ServiceDbObject::StaticInitialize(void) { Service::OnCommentAdded.connect(boost::bind(&ServiceDbObject::AddComment, _1, _2)); Service::OnCommentRemoved.connect(boost::bind(&ServiceDbObject::RemoveComment, _1, _2)); - Service::OnDowntimesChanged.connect(boost::bind(&ServiceDbObject::DowntimesChangedHandler, _1, _2, _3)); + Service::OnDowntimeAdded.connect(boost::bind(&ServiceDbObject::AddDowntime, _1, _2)); + Service::OnDowntimeRemoved.connect(boost::bind(&ServiceDbObject::RemoveDowntime, _1, _2)); + Service::OnDowntimeTriggered.connect(boost::bind(&ServiceDbObject::TriggerDowntime, _1, _2)); } ServiceDbObject::ServiceDbObject(const DbType::Ptr& type, const String& name1, const String& name2) @@ -250,8 +252,8 @@ void ServiceDbObject::OnConfigUpdate(void) /* update comments and downtimes on config change */ AddComments(service); - DowntimesChangedHandler(service, Empty, DowntimeChangedUpdated); - + AddDowntimes(service); + /* service host config update */ Host::Ptr host = service->GetHost(); @@ -373,68 +375,11 @@ void ServiceDbObject::AddCommentByType(const DynamicObject::Ptr& object, const D OnQuery(query1); } -void ServiceDbObject::RemoveComments(const Service::Ptr& service) -{ - /* remove all comments associated for this host/service */ - Log(LogDebug, "ido", "remove comments for '" + service->GetName() + "'"); - - Host::Ptr host = service->GetHost(); - - if (!host) - return; - - DbQuery query1; - query1.Table = "comments"; - query1.Type = DbQueryDelete; - query1.WhereCriteria = boost::make_shared(); - query1.WhereCriteria->Set("object_id", service); - OnQuery(query1); - - /* remove hostcheck service's host comments */ - if (host->GetHostCheckService() == service) { - DbQuery query2; - query2.Table = "comments"; - query2.Type = DbQueryDelete; - query2.WhereCriteria = boost::make_shared(); - query2.WhereCriteria->Set("object_id", host); - OnQuery(query2); - } -} - void ServiceDbObject::RemoveComment(const Service::Ptr& service, const Dictionary::Ptr& comment) { /* TODO: implement */ } -void ServiceDbObject::DowntimesChangedHandler(const Service::Ptr& svcfilter, const String& id, DowntimeChangedType type) -{ - if (type == DowntimeChangedUpdated || type == DowntimeChangedDeleted) { - /* we cannot determine which downtime id is deleted - * id cache may not be in sync - */ - BOOST_FOREACH(const Service::Ptr& service, DynamicType::GetObjects()) { - if (svcfilter && svcfilter != service) - continue; - - Host::Ptr host = service->GetHost(); - - if (!host) - continue; - - /* delete all downtimes associated for this host/service */ - DeleteDowntimes(service); - - /* dump all downtimes */ - AddDowntimes(service); - } - } else if (type == DowntimeChangedAdded) { - Dictionary::Ptr downtime = Service::GetDowntimeByID(id); - AddDowntime(svcfilter, downtime); - } else { - Log(LogDebug, "ido", "invalid downtime change type: " + type); - } -} - void ServiceDbObject::AddDowntimes(const Service::Ptr& service) { /* dump all downtimes */ @@ -518,31 +463,12 @@ void ServiceDbObject::AddDowntimeByType(const DynamicObject::Ptr& object, const OnQuery(query1); } -void ServiceDbObject::DeleteDowntimes(const Service::Ptr& service) +void ServiceDbObject::RemoveDowntime(const Service::Ptr& service, const Dictionary::Ptr& downtime) { - /* delete all downtimes associated for this host/service */ - Log(LogDebug, "ido", "delete downtimes for '" + service->GetName() + "'"); - - Host::Ptr host = service->GetHost(); - - if (!host) - return; - - DbQuery query1; - query1.Table = "scheduleddowntime"; - query1.Type = DbQueryDelete; - query1.WhereCriteria = boost::make_shared(); - query1.WhereCriteria->Set("object_id", service); - OnQuery(query1); - - /* delete hostcheck service's host downtimes */ - if (host->GetHostCheckService() == service) { - DbQuery query2; - query2.Table = "scheduleddowntime"; - query2.Type = DbQueryDelete; - query2.WhereCriteria = boost::make_shared(); - query2.WhereCriteria->Set("object_id", host); - OnQuery(query2); - } + /* TODO: implement */ } +void ServiceDbObject::TriggerDowntime(const Service::Ptr& service, const Dictionary::Ptr& downtime) +{ + /* TODO: implement */ +} diff --git a/lib/ido/servicedbobject.h b/lib/ido/servicedbobject.h index 8691ba079..9d3971b71 100644 --- a/lib/ido/servicedbobject.h +++ b/lib/ido/servicedbobject.h @@ -54,14 +54,13 @@ private: static void AddComments(const Service::Ptr& service); static void AddComment(const Service::Ptr& service, const Dictionary::Ptr& comment); static void AddCommentByType(const DynamicObject::Ptr& object, const Dictionary::Ptr& comment); - static void RemoveComments(const Service::Ptr& service); static void RemoveComment(const Service::Ptr& service, const Dictionary::Ptr& comment); - static void DowntimesChangedHandler(const Service::Ptr& service, const String& id, DowntimeChangedType type); static void AddDowntimes(const Service::Ptr& service); static void AddDowntime(const Service::Ptr& service, const Dictionary::Ptr& downtime); static void AddDowntimeByType(const DynamicObject::Ptr& object, const Dictionary::Ptr& downtime); - static void DeleteDowntimes(const Service::Ptr& service); + static void RemoveDowntime(const Service::Ptr& service, const Dictionary::Ptr& downtime); + static void TriggerDowntime(const Service::Ptr& service, const Dictionary::Ptr& downtime); }; } -- 2.40.0