mirror of https://github.com/Icinga/icinga2.git
Merge pull request #7112 from Icinga/bugfix/service-handled
Include host state in Service#handled and Service#severity
This commit is contained in:
commit
3665430005
|
@ -45,6 +45,7 @@ enum SeverityFlag
|
|||
{
|
||||
SeverityFlagDowntime = 1,
|
||||
SeverityFlagAcknowledgement = 2,
|
||||
SeverityFlagHostDown = 4,
|
||||
SeverityFlagUnhandled = 8,
|
||||
SeverityFlagPending = 16,
|
||||
SeverityFlagWarning = 32,
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
@ -133,6 +135,11 @@ int Service::GetSeverity() const
|
|||
return severity;
|
||||
}
|
||||
|
||||
bool Service::GetHandled() const
|
||||
{
|
||||
return Checkable::GetHandled() || m_Host->GetProblem();
|
||||
}
|
||||
|
||||
bool Service::IsStateOK(ServiceState state) const
|
||||
{
|
||||
return state == ServiceOK;
|
||||
|
|
|
@ -29,6 +29,7 @@ public:
|
|||
|
||||
Host::Ptr GetHost() const override;
|
||||
int GetSeverity() const override;
|
||||
bool GetHandled() const override;
|
||||
|
||||
bool ResolveMacro(const String& macro, const CheckResult::Ptr& cr, Value *result) const override;
|
||||
|
||||
|
|
Loading…
Reference in New Issue