Thanks. In the meantime I looked again on JSON Query Generator. It seems I'll be able to distinguish scheduled and unscheduled downtimes with it. However, I think I found a bug.
First, I created availability report for one specific service from Nagios Core. See core_avail_result.png file. Data in this table seems to be correct.
Then I tried to use JSON Query generator to get these data. Here's what I got:
Code: Select all
"time_ok": 2527907,
"time_warning": 0,
"time_critical": 132493,
"time_unknown": 0,
"scheduled_time_ok": 0,
"scheduled_time_warning": 0,
"scheduled_time_critical": 411,
"scheduled_time_unknown": 0,
"time_indeterminate_nodata": 0,
"time_indeterminate_notrunning": 0
If you check the ...result.png file, you can see we have 4 non-zero values: scheduled OK, unscheduled OK, scheduled Critical, unscheduled Critical. And if you check result from JSON - we have only 3 non zero values. I did some calculations and data from JSON are exactly the same as data in ...result.png table, except one - scheduled_time_ok (=Scheduled OK). If I'm right, scheduled_time_ok should contain value 17589.
I used this time interval:
JSON report start time: 1470002400
JSON report end time: 1472680800
---> report duration: 2678400
If you sum all values from json, and add missing 17589, you'll get report duration. (2527907+132493+411+17589 = 2678400).
Could you confirm this and check if there are no more miscalculations...
Thanks.
just fyi: this service is configured for scheduled downtime for one hour every week.