Several devices are in an ongoing outage in JasperReports. This is also observed in the OneClick Report Manager Outage Editor.
Release : 20.2
Component : Spectrum Reporting
When the API getEventListByAttrFilter() is invoked with filters containing start/end time, suspecting that sometimes API is not returning all the events that are qualified to be returned. It is supposed to return all the events with event creation time (utime column of event table) in the start/end time interval of the filter.
Spectrum_10.04.02.D194b
Here are the queries to list the devices in Ongoing Outage:
To list all devices in Ongoing Outage:
SELECT dm.model_name, HEX(dm.model_h), mo.model_key, mo.start_time, mo.end_time, mon.notes FROM devicemodel dm, modeloutage mo LEFT JOIN modeloutage_notes mon USING (model_outage_id) WHERE (mo.outage_type != 0 AND mo.end_time IS NULL) AND mo.model_key=dm.model_key ORDER BY mo.start_time;
To list all devices in Ongoing Outage since a particular date/time:
SELECT dm.model_name, HEX(dm.model_h), mo.model_key, mo.start_time, mo.end_time, mon.notes FROM devicemodel dm, modeloutage mo LEFT JOIN modeloutage_notes mon USING (model_outage_id) WHERE (mo.outage_type != 0 AND mo.end_time IS NULL) AND mo.model_key=dm.model_key AND mo.start_time >= '2022-03-31 08:40:33' ORDER BY mo.start_time;
To list all devices in Ongoing Outage after a certain duration:
SELECT dm.model_name, HEX(dm.model_h), mo.model_key, mo.start_time, mo.end_time, mon.notes FROM devicemodel dm, modeloutage mo LEFT JOIN modeloutage_notes mon USING (model_outage_id) WHERE (mo.outage_type != 0 AND mo.end_time IS NULL) AND mo.model_key=dm.model_key AND mo.start_time <= NOW() - INTERVAL 2 HOUR ORDER BY mo.start_time;
SELECT dm.model_name, HEX(dm.model_h), mo.model_key, mo.start_time, mo.end_time, mon.notes FROM devicemodel dm, modeloutage mo LEFT JOIN modeloutage_notes mon USING (model_outage_id) WHERE (mo.outage_type != 0 AND mo.end_time IS NULL) AND mo.model_key=dm.model_key AND mo.start_time <= NOW() - INTERVAL 2 DAY ORDER BY mo.start_time;