You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed this bug when we evaluated the icinga reporting module for our internal SLA Monitoring. The Values seemed to be off when a Host did not exist for the whole timeframe used in the report.
Describe the bug
The SLA value is not calculated based on the total time selected by the timeframe, instead, if there is no data for the whole timeframe, the total time starts with the first entry, which results in a wrong value.
For example, a timeframe of a year is selcted and the data starts after half a year, then the total_time should always be a year. Let's assume the following, we have a downtime of 08 hours 41 minutes and 38 seconds, which should result in a SLA value 99,9 over a year.
Expected: timeframe: 1 Year total_time: 1 Year, with a downtime of 08:41:38, which results in 99,9 Actual: timeframe: 1 Year total_time: 1/2 Year, with a downtime of 08:41:38, which results in less
The Database function is located in the icingadb schema file and in my tests the issue is resolved when its changed liked this:
- IF row_previous_hard_state = 99 THEN- SET total_time = total_time - (row_event_time - last_event_time);- ELSEIF ((in_service_id IS NULL AND last_hard_state > 0) OR (in_service_id IS NOT NULL AND last_hard_state > 1))+ IF ((in_service_id IS NULL AND last_hard_state > 0) OR (in_service_id IS NOT NULL AND last_hard_state > 1))
AND last_hard_state != 99
AND active_downtimes = 0
THEN
And i could not think of a situation where this behaviour would be needed, but i guess it has its reason why its in there 🙂, maybe someone who has a deeper understanding of the reporting module may have a clue?
I hope its not a stupid mistake on my end, even if i tried to check everything throughly.
Last but not least, thanks to anyone who spent the time looking into it and espacially thanks for the software and all the effort everyone has put into it.
The text was updated successfully, but these errors were encountered:
marcojarjour
changed the title
always use the selected timeframe for calculation
always use the selected timeframe for sla calculation
Oct 18, 2024
Preface
I noticed this bug when we evaluated the icinga reporting module for our internal SLA Monitoring. The Values seemed to be off when a Host did not exist for the whole timeframe used in the report.
Describe the bug
The SLA value is not calculated based on the total time selected by the timeframe, instead, if there is no data for the whole timeframe, the total time starts with the first entry, which results in a wrong value.
For example, a timeframe of a year is selcted and the data starts after half a year, then the total_time should always be a year. Let's assume the following, we have a downtime of 08 hours 41 minutes and 38 seconds, which should result in a SLA value 99,9 over a year.
Expected: timeframe:
1 Year
total_time:1 Year
, with a downtime of08:41:38
, which results in99,9
Actual: timeframe:
1 Year
total_time:1/2 Year
, with a downtime of08:41:38
, which results in lessTo Reproduce
Steps to reproduce the behavior:
Expected behavior
Both queries have a timeframe of one year, therefore i would expect both to have the same result.
Your Environment
Additional context
The Database function is located in the icingadb schema file and in my tests the issue is resolved when its changed liked this:
And i could not think of a situation where this behaviour would be needed, but i guess it has its reason why its in there 🙂, maybe someone who has a deeper understanding of the reporting module may have a clue?
I hope its not a stupid mistake on my end, even if i tried to check everything throughly.
Last but not least, thanks to anyone who spent the time looking into it and espacially thanks for the software and all the effort everyone has put into it.
The text was updated successfully, but these errors were encountered: