Skip to content

Commit

Permalink
Doc: technical concepts: allow to change severity formula across Icin…
Browse files Browse the repository at this point in the history
…ga 2 releases

so nobody is surprised in that case.
  • Loading branch information
Al2Klimov authored and yhabteab committed Feb 21, 2022
1 parent f150ad9 commit 865953e
Showing 1 changed file with 1 addition and 65 deletions.
66 changes: 1 addition & 65 deletions doc/19-technical-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -451,71 +451,7 @@ The severity value is pre-calculated for visualization interfaces
such as Icinga Web which sorts the problem dashboard by severity by default.

The higher the severity number is, the more important the problem is.

Flags:

```
/**
* Severity Flags
*
* @ingroup icinga
*/
enum SeverityFlag
{
SeverityFlagDowntime = 1,
SeverityFlagAcknowledgement = 2,
SeverityFlagHostDown = 4,
SeverityFlagUnhandled = 8,
SeverityFlagPending = 16,
SeverityFlagWarning = 32,
SeverityFlagUnknown = 64,
SeverityFlagCritical = 128,
};
```


Host:

```
/* OK/Warning = Up, Critical/Unknown = Down */
if (!HasBeenChecked())
severity |= SeverityFlagPending;
else if (state == ServiceUnknown)
severity |= SeverityFlagCritical;
else if (state == ServiceCritical)
severity |= SeverityFlagCritical;
if (IsInDowntime())
severity |= SeverityFlagDowntime;
else if (IsAcknowledged())
severity |= SeverityFlagAcknowledgement;
else
severity |= SeverityFlagUnhandled;
```


Service:

```
if (!HasBeenChecked())
severity |= SeverityFlagPending;
else if (state == ServiceWarning)
severity |= SeverityFlagWarning;
else if (state == ServiceUnknown)
severity |= SeverityFlagUnknown;
else if (state == ServiceCritical)
severity |= SeverityFlagCritical;
if (IsInDowntime())
severity |= SeverityFlagDowntime;
else if (IsAcknowledged())
severity |= SeverityFlagAcknowledgement;
else if (m_Host->GetProblem())
severity |= SeverityFlagHostDown;
else
severity |= SeverityFlagUnhandled;
```

However, the formula can change across Icinga 2 releases.


## Cluster <a id="technical-concepts-cluster"></a>
Expand Down

0 comments on commit 865953e

Please sign in to comment.