Merge pull request #9198 from Icinga/Al2Klimov-patch-6

Doc: technical concepts: allow to change severity formula across Icinga 2 releases
This commit is contained in:
Julian Brost 2022-01-31 16:43:06 +01:00 committed by GitHub
commit 4491123f7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 65 deletions

View File

@ -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:
```cpp
/**
* Severity Flags
*
* @ingroup icinga
*/
enum SeverityFlag
{
SeverityFlagDowntime = 1,
SeverityFlagAcknowledgement = 2,
SeverityFlagHostDown = 4,
SeverityFlagUnhandled = 8,
SeverityFlagPending = 16,
SeverityFlagWarning = 32,
SeverityFlagUnknown = 64,
SeverityFlagCritical = 128,
};
```
Host:
```cpp
/* 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:
```cpp
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>