Icinga / icingaweb2-module-idoreports

Icinga IDO Reports provides host and service availability reports for Icinga based on the monitoring database (IDO).
GNU General Public License v2.0
34 stars 13 forks source link

idoreports_get_sla_ok_percent returns > 100 #24

Closed fabsi88 closed 1 year ago

fabsi88 commented 4 years ago

Describe the bug

The function idoreports_get_sla_ok_percent returns >100 % in unknown cases.

To Reproduce

Steps to reproduce the behavior:

  1. Call the function for a period of a month like select idoreports_get_sla_ok_percent(13918, '2020-01-01 00:00:00', '2020-01-31 23:59:59', NULL); Last state change of this object was on 2020-01-01 13:31:58 from 3 to 0

    Expected behavior

Return 100

Screenshots

If applicable, add screenshots to help explain your problem. image

Your Environment

fabsi88 commented 4 years ago

any update?

lippserd commented 4 years ago

Hi,

Thanks for the report.

Could you please also share the hard state change that happened before your mentioned change?

A screenshot of the history would help.

All the best, Eric

sklaes commented 4 years ago

In the past few months I have observed strange behaviour. The reports covering the last month change during the current month. Which should not happen, since the last month is already finished and therefore there are no more changes. The reports tend to become more realistic towards the end of the month, at least there are less services with more than 100%.

Here is an example same report of last month: image

(please note the different creation dates of the Report)

sklaes commented 4 years ago

I have exported the state history of the services above: idoreports-issues-24 idoreports-issues-24.txt Filter uses for this export: state_type LIKE '1' AND object_id IN ('16528','16536','16538','16535','16541','16542') and state_time > '2020-03-01 00:00:00' and state_time < '2020-03-31 23:59:59'

As far as I can see all services that are changing their percentage value over the time have an wildcard (*) at the end of their service name, so that is probably a different issue.

danielboydston commented 3 years ago

I've encountered this issue as well. It happened when I had a host in downtime. During downtime, the SLA did not take the downtime into effect. After I removed the downtime, the SLA then showed above 100%. image Here is the state change history: image The report is covering a 1 week time span. image

moreamazingnick commented 2 years ago

that happens in strange downtime scenarios if you devide by total time this can't happen https://github.com/moreamazingnick/icingaweb2-module-idoreports