From 66949dd01868518854341d5615c86ac33930f322 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Thu, 11 Apr 2019 11:36:23 +0200 Subject: [PATCH] Service: reduce severity while host is down --- lib/icinga/checkable.hpp | 1 + lib/icinga/service.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lib/icinga/checkable.hpp b/lib/icinga/checkable.hpp index 44cfaad49..0c436f0e1 100644 --- a/lib/icinga/checkable.hpp +++ b/lib/icinga/checkable.hpp @@ -45,6 +45,7 @@ enum SeverityFlag { SeverityFlagDowntime = 1, SeverityFlagAcknowledgement = 2, + SeverityFlagHostDown = 4, SeverityFlagUnhandled = 8, SeverityFlagPending = 16, SeverityFlagWarning = 32, diff --git a/lib/icinga/service.cpp b/lib/icinga/service.cpp index 99a479647..58531c975 100644 --- a/lib/icinga/service.cpp +++ b/lib/icinga/service.cpp @@ -125,6 +125,8 @@ int Service::GetSeverity() const severity |= SeverityFlagDowntime; else if (IsAcknowledged()) severity |= SeverityFlagAcknowledgement; + else if (m_Host->GetProblem()) + severity |= SeverityFlagHostDown; else severity |= SeverityFlagUnhandled;