[icinga-users] Icinga Classic Availability CGI problem

Patrick F tradiuz at gmail.com
Fri Dec 7 19:26:59 CET 2012


I am using the package for Ubuntu (by formorer) which is 1.8.1-2

I have an issue where avail.cgi is outputting invalid data if you use the
CSV/JSON/XML format.

Examples:

CSV:

'HOSTGROUP SOC2 HOST_STATE_BREAKDOWNS';
'host_name';'time_up_scheduled';'percent_time_up_scheduled';'percent_known_time_up_scheduled';'time_up_unscheduled';'percent_time_up_unscheduled';'percent_known_time_up_unscheduled';'total_time_up';'percent_total_time_up';'percent_known_time_up';'time_down_scheduled';'percent_time_down_scheduled';'percent_known_time_down_scheduled';'time_down_unscheduled';'percent_time_down_unscheduled';'percent_known_time_down_unscheduled';'total_time_down';'percent_total_time_down';'percent_known_time_down';'time_unreachable_scheduled';'percent_time_unreachable_scheduled';'percent_known_time_unreachable_scheduled';'time_unreachable_unscheduled';'percent_time_unreachable_unscheduled';'percent_known_time_unreachable_unscheduled';'total_time_unreachable';'percent_total_time_unreachable';'percent_known_time_unreachable';'time_undetermined_not_running';'percent_time_undetermined_not_running';'time_undetermined_no_data';'percent_time_undetermined_no_data';'total_time_undetermined';'percent_total_time_undetermined';
'host.example.site';'59111';'0.000%';'0.000%';'2390399';'0.000%';'0.000%';'2449510';'94.372%';'94.372%';'146089';'0.000%';'0.000%';'0';'0.000%';'0.000%';'146089';'5.628%';'5.628%';'0';'0.000%';'0.000%';'0';'0.000%';'0.000%';'0';'0.000%';'0.000%';'0';'0.000%';'0';'0.000%';'0';'0.000%';

XML for the same host:


<host name="host.example.site">
<time_up_scheduled>
59111
</time_up_scheduled>
<percent_time_up_scheduled>
0.000
</percent_time_up_scheduled>
<percent_known_time_up_scheduled>
0.000
</percent_known_time_up_scheduled>
<time_up_unscheduled>
2390399
</time_up_unscheduled>
<percent_time_up_unscheduled>
0.000
</percent_time_up_unscheduled>
<percent_known_time_up_unscheduled>
0.000
</percent_known_time_up_unscheduled>
<total_time_up>
2449510
</total_time_up>
<percent_total_time_up>
94.372
</percent_total_time_up>
<percent_known_time_up>
94.372
</percent_known_time_up>
<time_down_scheduled>
146089
</time_down_scheduled>
<percent_time_down_scheduled>
0.000
</percent_time_down_scheduled>
<percent_known_time_down_scheduled>
0.000
</percent_known_time_down_scheduled>
<time_down_unscheduled>
0
</time_down_unscheduled>
<percent_time_down_unscheduled>
0.000
</percent_time_down_unscheduled>
<percent_known_time_down_unscheduled>
0.000
</percent_known_time_down_unscheduled>
<total_time_down>
146089
</total_time_down>
<percent_total_time_down>
5.628
</percent_total_time_down>
<percent_known_time_down>
5.628
</percent_known_time_down>
<time_unreachable_scheduled>
0
</time_unreachable_scheduled>
<percent_time_unreachable_scheduled>
0.000
</percent_time_unreachable_scheduled>
<percent_known_time_unreachable_scheduled>
0.000
</percent_known_time_unreachable_scheduled>
<time_unreachable_unscheduled>
0
</time_unreachable_unscheduled>
<percent_time_unreachable_unscheduled>
0.000
</percent_time_unreachable_unscheduled>
<percent_known_time_unreachable_unscheduled>
0.000
</percent_known_time_unreachable_unscheduled>
<total_time_unreachable>
0
</total_time_unreachable>
<percent_total_time_unreachable>
0.000
</percent_total_time_unreachable>
<percent_known_time_unreachable>
0.000
</percent_known_time_unreachable>
<time_undetermined_not_running>
0
</time_undetermined_not_running>
<percent_time_undetermined_not_running>
0.000
</percent_time_undetermined_not_running>
<time_undetermined_no_data>
0
</time_undetermined_no_data>
<percent_time_undetermined_no_data>
0.000
</percent_time_undetermined_no_data>
<total_time_undetermined>
0
</total_time_undetermined>
<percent_total_time_undetermined>
0.000
</percent_total_time_undetermined>
</host>


If you look at the "time_down_scheduled" field, you'll see the actual time
that the host was down, however, the "percent_time_down_scheduled" is 0.

Is this a known bug, and is there a workaround (short of parsing through
perl and doing the math).

-- 
Patrick Forristal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.icinga.org/pipermail/icinga-users/attachments/20121207/2920606e/attachment.html>


More information about the icinga-users mailing list