From 8d56f8e95155112363ed41a06e4357e63923e09c Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Thu, 11 May 2017 15:05:50 +0200 Subject: [PATCH] Fix that host downtimes might be triggered even if their state is Up If the checkresult's state is 1, this is internally mapped to Up. The added downtime will check for triggers and might cause a wrong downtime start event. refs #5202 --- lib/icinga/downtime.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/icinga/downtime.cpp b/lib/icinga/downtime.cpp index 909ba7e8f..f2fbc8419 100644 --- a/lib/icinga/downtime.cpp +++ b/lib/icinga/downtime.cpp @@ -134,7 +134,7 @@ void Downtime::Start(bool runtimeCreated) * this downtime now *after* it has been added (important * for DB IDO, etc.) */ - if (checkable->GetStateRaw() != ServiceOK) { + if (!checkable->IsStateOK(checkable->GetStateRaw())) { Log(LogNotice, "Downtime") << "Checkable '" << checkable->GetName() << "' already in a NOT-OK state." << " Triggering downtime now.";