MCPcopy Create free account
hub / github.com/Icinga/icinga2 / IsRecoveryOrFlappingEndAndCheckableIsOK

Function IsRecoveryOrFlappingEndAndCheckableIsOK

lib/icinga/notification.cpp:242–250  ·  view source on GitHub ↗

* Check whether the given notification type is a Recovery or FlappingEnd notification and the Checkable object * has already recovered. * * For the latter case, if the Checkable has recovered while it was in a Flapping state, the recovery notification * will be silently discarded and leave some internal states of the Notification object that depend on it in an * inconsistent state. So, use th

Source from the content-addressed store, hash-verified

240 * @return bool
241 */
242static bool IsRecoveryOrFlappingEndAndCheckableIsOK(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, NotificationType type)
243{
244 if (type == NotificationRecovery) {
245 return true;
246 }
247
248 // Check whether missed the Checkable recovery because of its Flapping state.
249 return type == NotificationFlappingEnd && cr && checkable->IsStateOK(cr->GetState());
250}
251
252void Notification::BeginExecuteNotification(NotificationType type, const CheckResult::Ptr& cr, bool force, bool reminder, const String& author, const String& text)
253{

Callers 1

Calls 2

IsStateOKMethod · 0.45
GetStateMethod · 0.45

Tested by

no test coverage detected