and some debug output.
refs #4360
refs #2711
<< "\t" << "notifications_enabled=" << (service->GetEnableNotifications() ? 1 : 0) << "\n"
<< "\t" << "active_checks_enabled=" << (service->GetEnableActiveChecks() ? 1 : 0) <<"\n"
<< "\t" << "passive_checks_enabled=" << (service->GetEnablePassiveChecks() ? 1 : 0) << "\n"
+ << "\t" << "flap_detection_enabled=" << "\t" << (service->GetEnableFlapping() ? 1 : 0) << "\n"
+ << "\t" << "is_flapping=" << "\t" << (service->IsFlapping() ? 1 : 0) << "\n"
+ << "\t" << "percent_state_change=" << "\t" << Convert::ToString(service->GetFlappingCurrent()) << "\n"
<< "\t" << "problem_has_been_acknowledged=" << (service->GetAcknowledgement() != AcknowledgementNone ? 1 : 0) << "\n"
<< "\t" << "acknowledgement_type=" << static_cast<int>(service->GetAcknowledgement()) << "\n"
<< "\t" << "acknowledgement_end_time=" << service->GetAcknowledgementExpiry() << "\n"
RegisterCommand("ACKNOWLEDGE_HOST_PROBLEM", &ExternalCommandProcessor::AcknowledgeHostProblem);
RegisterCommand("ACKNOWLEDGE_HOST_PROBLEM_EXPIRE", &ExternalCommandProcessor::AcknowledgeHostProblemExpire);
RegisterCommand("REMOVE_HOST_ACKNOWLEDGEMENT", &ExternalCommandProcessor::RemoveHostAcknowledgement);
+ RegisterCommand("DISABLE_HOST_FLAP_DETECTION", &ExternalCommandProcessor::DisableHostFlapping);
+ RegisterCommand("ENABLE_HOST_FLAP_DETECTION", &ExternalCommandProcessor::EnableHostFlapping);
+ RegisterCommand("DISABLE_SVC_FLAP_DETECTION", &ExternalCommandProcessor::DisableSvcFlapping);
+ RegisterCommand("ENABLE_SVC_FLAP_DETECTION", &ExternalCommandProcessor::EnableSvcFlapping);
RegisterCommand("ENABLE_HOSTGROUP_SVC_CHECKS", &ExternalCommandProcessor::EnableHostgroupSvcChecks);
RegisterCommand("DISABLE_HOSTGROUP_SVC_CHECKS", &ExternalCommandProcessor::DisableHostgroupSvcChecks);
RegisterCommand("ENABLE_SERVICEGROUP_SVC_CHECKS", &ExternalCommandProcessor::EnableServicegroupSvcChecks);
#include "base/dynamictype.h"
#include "base/objectlock.h"
#include "base/logger_fwd.h"
+#include "base/convert.h"
#include <boost/smart_ptr/make_shared.hpp>
#include <boost/foreach.hpp>
#include <boost/exception/diagnostic_information.hpp>
olock.Unlock();
+ Log(LogDebug, "icinga", "Flapping: Service " +
+ GetName() + " was: " +
+ Convert::ToString(was_flapping) + " is: " +
+ Convert::ToString(was_flapping) + " threshold: " +
+ Convert::ToString(GetFlappingThreshold()) + "% current: " +
+ Convert::ToString(GetFlappingCurrent()) + "%.");
+
/* Flush the object so other instances see the service's
* new state when they receive the CheckResult message */
Flush();
rm.SetParams(params);
EndpointManager::GetInstance()->SendMulticastMessage(rm);
+
+ Log(LogDebug, "icinga", "Flapping: Service " + GetName() + " started flapping (" + Convert::ToString(GetFlappingThreshold()) + "% < " + Convert::ToString(GetFlappingCurrent()) + "%).");
}
else if (was_flapping && !is_flapping) {
RequestNotifications(NotificationFlappingEnd, cr);
rm.SetParams(params);
EndpointManager::GetInstance()->SendMulticastMessage(rm);
+
+ Log(LogDebug, "icinga", "Flapping: Service " + GetName() + " stopped flapping (" + Convert::ToString(GetFlappingThreshold()) + "% >= " + Convert::ToString(GetFlappingCurrent()) + "%).");
}
else if (send_notification)
RequestNotifications(recovery ? NotificationRecovery : NotificationProblem, cr);
if (m_FlappingNegative.IsEmpty() || m_FlappingPositive.IsEmpty())
return 0;
+ if ((m_FlappingPositive + m_FlappingNegative) <= 0)
+ return 0;
+
return 100 * m_FlappingPositive / (m_FlappingPositive + m_FlappingNegative);
}