Icinga / icinga-reports

Icinga Reports 1.x MySQL (EOL 31.12.2018)
GNU General Public License v2.0
14 stars 13 forks source link

Telling 100% up althought service was down #78

Closed Isma399 closed 6 years ago

Isma399 commented 6 years ago

Hello,

We have been ddos the 23 March and we're looking for the SLA time. On icinga, the object_id of the service is 566, SELECT give us:

SELECT state_time, state_change, state, state_type, last_state, last_hard_state, state_time_usec FROM icinga_statehistory WHERE object_id=566 AND state_time LIKE '%%2018-03-23%%'; +---------------------+--------------+-------+------------+------------+-----------------+-----------------+ | state_time | state_change | state | state_type | last_state | last_hard_state | state_time_usec | +---------------------+--------------+-------+------------+------------+-----------------+-----------------+ | 2018-03-23 03:03:07 | 1 | 0 | 1 | 2 | 0 | 149319 | | 2018-03-23 06:46:07 | 1 | 0 | 1 | 2 | 0 | 153281 | | 2018-03-23 03:02:37 | 1 | 2 | 0 | 0 | 0 | 98517 | | 2018-03-23 06:45:37 | 1 | 2 | 0 | 0 | 0 | 95838 | +---------------------+--------------+-------+------------+------------+-----------------+-----------------+ 4 rows in set (0.00 sec)

Calling the function with time period (SLA period) = 138 give 100%

SELECT icinga_sla_state_availability( 566, 0,' 2018-03-23', ' 2018-03-24',138) * 100 AS state_ok FROM icinga_objects WHERE object_id=566; +----------+ | state_ok | +----------+ | 100 | +----------+

When checking the cache, all current_state is 0:

SELECT start_time, end_time, current_state, duration FROM icinga_sla_eventcache WHERE object_id = 566 AND start = '2018-03-23' AND end = '2018-03-24' AND tp_object_id = 138; +---------------------+---------------------+---------------+----------+ | start_time | end_time | current_state | duration | +---------------------+---------------------+---------------+----------+ | 2018-03-24 00:00:00 | 2018-03-24 00:00:00 | 0 | 0 | | 2018-03-23 06:46:07 | 2018-03-24 00:00:00 | 0 | 62033 | | 2018-03-23 06:45:37 | 2018-03-23 06:46:07 | 0 | 30 | | 2018-03-23 03:03:07 | 2018-03-23 06:45:37 | 0 | 13350 | | 2018-03-23 03:02:37 | 2018-03-23 03:03:07 | 0 | 30 | | 2018-03-23 00:00:00 | 2018-03-23 03:02:37 | 0 | 10957 | | 2018-03-23 00:00:00 | 2018-03-23 00:00:00 | 0 | 0 | +---------------------+---------------------+---------------+----------+ 7 rows in set (0.00 sec)

I thank everyone who could help me

Isma399 commented 6 years ago

Sorry, I didn't think too much about the results of the first SELECT.