Closed mbanck closed 4 years ago
IIRC, we were only looking for hard states, which is why I settled on "> 1". Is that correct, @lippserd?
The "Runtime Attributes" table of https://icinga.com/docs/icinga2/latest/doc/09-object-types/#host does not make it look like state type (hard or soft) has a bearing on the state value (which has as values "The current state (0 = UP, 1 = DOWN)." according to it). There is a different column state_type
in icinga_statehistory
that defines whether the row is about a hard or a soft state.
I have no real opinion on whether a soft state should be considered a downtime as far as SLA is concerned, I guess it makes sense to just use the same as mysql.
Would love to see this run against some real life data!
This issue has been fixed in c63672e83 and since been merged into the feature/postgresql
branch.
Describe the bug
The Postgres
idoreports_get_sla_ok_percent()
function in thefeature/postgresql
branch has the following code (or similar) multiple times:However, for
icinga_objects.objecttype_id = 1
(i.e. Hosts, not Services),state = 1
isDOWN
, so those are not accounted for. The code needs to distinguish between Hosts (wherestate > 0 AS down
) and Services (wherestate > 1 AS down
).CC: @bluthg