I am using the package for Ubuntu (by formorer) which is 1.8.1-2<div><br></div><div>I have an issue where avail.cgi is outputting invalid data if you use the CSV/JSON/XML format.</div><div><br></div><div>Examples:</div><div>
<br></div><div>CSV:</div><div><br></div><div>'HOSTGROUP SOC2 HOST_STATE_BREAKDOWNS';<br></div><div>'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';<br>
</div><div>'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%';<br>
</div><div><br></div><div>XML for the same host:</div><div><br></div><div><br></div><div><span class="" style="color:rgb(0,0,0);background-color:rgb(135,206,235);border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;font-family:monospace;font-size:13px"><<span class="" style="color:purple;font-weight:bold">host</span></span><span style="color:rgb(0,0,0);font-family:monospace;font-size:13px"> </span><span class="" style="color:olive;font-family:monospace;font-size:13px">name</span><span class="" style="color:blue;font-family:monospace;font-size:13px">="</span><span class="" style="color:blue;font-family:monospace;font-size:13px">host.example.site</span><span class="" style="color:blue;font-family:monospace;font-size:13px">"</span><span class="" style="color:rgb(0,0,0);font-family:monospace;font-size:13px">></span><div class="" style="display:inline;color:rgb(0,0,0);font-family:monospace;font-size:13px">
<div class="" style="margin:2px 0px 5px 20px"><span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">time_up_scheduled</span></span><span class="" style="color:black">></span><div class="" style="display:inline">
<span class="" style="white-space:pre;color:black;font-weight:bold">59111</span></div><span class="" style></<span class="" style="color:purple;font-weight:bold">time_up_scheduled</span>></span></div><div class="" style="margin:2px 0px 5px 20px">
<span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">percent_time_up_scheduled</span></span><span class="" style="color:black">></span><div class="" style="display:inline"><span class="" style="white-space:pre;color:black;font-weight:bold">0.000</span></div>
<span class="" style></<span class="" style="color:purple;font-weight:bold">percent_time_up_scheduled</span>></span></div><div class="" style="margin:2px 0px 5px 20px"><span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">percent_known_time_up_scheduled</span></span><span class="" style="color:black">></span><div class="" style="display:inline">
<span class="" style="white-space:pre;color:black;font-weight:bold">0.000</span></div><span class="" style></<span class="" style="color:purple;font-weight:bold">percent_known_time_up_scheduled</span>></span></div><div class="" style="margin:2px 0px 5px 20px">
<span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">time_up_unscheduled</span></span><span class="" style="color:black">></span><div class="" style="display:inline"><span class="" style="white-space:pre;color:black;font-weight:bold">2390399</span></div>
<span class="" style></<span class="" style="color:purple;font-weight:bold">time_up_unscheduled</span>></span></div><div class="" style="margin:2px 0px 5px 20px"><span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">percent_time_up_unscheduled</span></span><span class="" style="color:black">></span><div class="" style="display:inline">
<span class="" style="white-space:pre;color:black;font-weight:bold">0.000</span></div><span class="" style></<span class="" style="color:purple;font-weight:bold">percent_time_up_unscheduled</span>></span></div><div class="" style="margin:2px 0px 5px 20px">
<span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">percent_known_time_up_unscheduled</span></span><span class="" style="color:black">></span><div class="" style="display:inline">
<span class="" style="white-space:pre;color:black;font-weight:bold">0.000</span></div><span class="" style></<span class="" style="color:purple;font-weight:bold">percent_known_time_up_unscheduled</span>></span></div>
<div class="" style="margin:2px 0px 5px 20px"><span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">total_time_up</span></span><span class="" style="color:black">></span><div class="" style="display:inline">
<span class="" style="white-space:pre;color:black;font-weight:bold">2449510</span></div><span class="" style></<span class="" style="color:purple;font-weight:bold">total_time_up</span>></span></div><div class="" style="margin:2px 0px 5px 20px">
<span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">percent_total_time_up</span></span><span class="" style="color:black">></span><div class="" style="display:inline"><span class="" style="white-space:pre;color:black;font-weight:bold">94.372</span></div>
<span class="" style></<span class="" style="color:purple;font-weight:bold">percent_total_time_up</span>></span></div><div class="" style="margin:2px 0px 5px 20px"><span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">percent_known_time_up</span></span><span class="" style="color:black">></span><div class="" style="display:inline">
<span class="" style="white-space:pre;color:black;font-weight:bold">94.372</span></div><span class="" style></<span class="" style="color:purple;font-weight:bold">percent_known_time_up</span>></span></div><div class="" style="margin:2px 0px 5px 20px">
<span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">time_down_scheduled</span></span><span class="" style="color:black">></span><div class="" style="display:inline"><span class="" style="white-space:pre;color:black;font-weight:bold">146089</span></div>
<span class="" style></<span class="" style="color:purple;font-weight:bold">time_down_scheduled</span>></span></div><div class="" style="margin:2px 0px 5px 20px"><span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">percent_time_down_scheduled</span></span><span class="" style="color:black">></span><div class="" style="display:inline">
<span class="" style="white-space:pre;color:black;font-weight:bold">0.000</span></div><span class="" style></<span class="" style="color:purple;font-weight:bold">percent_time_down_scheduled</span>></span></div><div class="" style="margin:2px 0px 5px 20px">
<span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">percent_known_time_down_scheduled</span></span><span class="" style="color:black">></span><div class="" style="display:inline">
<span class="" style="white-space:pre;color:black;font-weight:bold">0.000</span></div><span class="" style></<span class="" style="color:purple;font-weight:bold">percent_known_time_down_scheduled</span>></span></div>
<div class="" style="margin:2px 0px 5px 20px"><span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">time_down_unscheduled</span></span><span class="" style="color:black">></span><div class="" style="display:inline">
<span class="" style="white-space:pre;color:black;font-weight:bold">0</span></div><span class="" style></<span class="" style="color:purple;font-weight:bold">time_down_unscheduled</span>></span></div><div class="" style="margin:2px 0px 5px 20px">
<span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">percent_time_down_unscheduled</span></span><span class="" style="color:black">></span><div class="" style="display:inline"><span class="" style="white-space:pre;color:black;font-weight:bold">0.000</span></div>
<span class="" style></<span class="" style="color:purple;font-weight:bold">percent_time_down_unscheduled</span>></span></div><div class="" style="margin:2px 0px 5px 20px"><span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">percent_known_time_down_unscheduled</span></span><span class="" style="color:black">></span><div class="" style="display:inline">
<span class="" style="white-space:pre;color:black;font-weight:bold">0.000</span></div><span class="" style></<span class="" style="color:purple;font-weight:bold">percent_known_time_down_unscheduled</span>></span></div>
<div class="" style="margin:2px 0px 5px 20px"><span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">total_time_down</span></span><span class="" style="color:black">></span><div class="" style="display:inline">
<span class="" style="white-space:pre;color:black;font-weight:bold">146089</span></div><span class="" style></<span class="" style="color:purple;font-weight:bold">total_time_down</span>></span></div><div class="" style="margin:2px 0px 5px 20px">
<span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">percent_total_time_down</span></span><span class="" style="color:black">></span><div class="" style="display:inline"><span class="" style="white-space:pre;color:black;font-weight:bold">5.628</span></div>
<span class="" style></<span class="" style="color:purple;font-weight:bold">percent_total_time_down</span>></span></div><div class="" style="margin:2px 0px 5px 20px"><span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">percent_known_time_down</span></span><span class="" style="color:black">></span><div class="" style="display:inline">
<span class="" style="white-space:pre;color:black;font-weight:bold">5.628</span></div><span class="" style></<span class="" style="color:purple;font-weight:bold">percent_known_time_down</span>></span></div><div class="" style="margin:2px 0px 5px 20px">
<span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">time_unreachable_scheduled</span></span><span class="" style="color:black">></span><div class="" style="display:inline"><span class="" style="white-space:pre;color:black;font-weight:bold">0</span></div>
<span class="" style></<span class="" style="color:purple;font-weight:bold">time_unreachable_scheduled</span>></span></div><div class="" style="margin:2px 0px 5px 20px"><span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">percent_time_unreachable_scheduled</span></span><span class="" style="color:black">></span><div class="" style="display:inline">
<span class="" style="white-space:pre;color:black;font-weight:bold">0.000</span></div><span class="" style></<span class="" style="color:purple;font-weight:bold">percent_time_unreachable_scheduled</span>></span></div>
<div class="" style="margin:2px 0px 5px 20px"><span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">percent_known_time_unreachable_scheduled</span></span><span class="" style="color:black">></span><div class="" style="display:inline">
<span class="" style="white-space:pre;color:black;font-weight:bold">0.000</span></div><span class="" style></<span class="" style="color:purple;font-weight:bold">percent_known_time_unreachable_scheduled</span>></span></div>
<div class="" style="margin:2px 0px 5px 20px"><span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">time_unreachable_unscheduled</span></span><span class="" style="color:black">></span><div class="" style="display:inline">
<span class="" style="white-space:pre;color:black;font-weight:bold">0</span></div><span class="" style></<span class="" style="color:purple;font-weight:bold">time_unreachable_unscheduled</span>></span></div><div class="" style="margin:2px 0px 5px 20px">
<span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">percent_time_unreachable_unscheduled</span></span><span class="" style="color:black">></span><div class="" style="display:inline">
<span class="" style="white-space:pre;color:black;font-weight:bold">0.000</span></div><span class="" style></<span class="" style="color:purple;font-weight:bold">percent_time_unreachable_unscheduled</span>></span></div>
<div class="" style="margin:2px 0px 5px 20px"><span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">percent_known_time_unreachable_unscheduled</span></span><span class="" style="color:black">></span><div class="" style="display:inline">
<span class="" style="white-space:pre;color:black;font-weight:bold">0.000</span></div><span class="" style></<span class="" style="color:purple;font-weight:bold">percent_known_time_unreachable_unscheduled</span>></span></div>
<div class="" style="margin:2px 0px 5px 20px"><span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">total_time_unreachable</span></span><span class="" style="color:black">></span><div class="" style="display:inline">
<span class="" style="white-space:pre;color:black;font-weight:bold">0</span></div><span class="" style></<span class="" style="color:purple;font-weight:bold">total_time_unreachable</span>></span></div><div class="" style="margin:2px 0px 5px 20px">
<span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">percent_total_time_unreachable</span></span><span class="" style="color:black">></span><div class="" style="display:inline"><span class="" style="white-space:pre;color:black;font-weight:bold">0.000</span></div>
<span class="" style></<span class="" style="color:purple;font-weight:bold">percent_total_time_unreachable</span>></span></div><div class="" style="margin:2px 0px 5px 20px"><span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">percent_known_time_unreachable</span></span><span class="" style="color:black">></span><div class="" style="display:inline">
<span class="" style="white-space:pre;color:black;font-weight:bold">0.000</span></div><span class="" style></<span class="" style="color:purple;font-weight:bold">percent_known_time_unreachable</span>></span></div><div class="" style="margin:2px 0px 5px 20px">
<span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">time_undetermined_not_running</span></span><span class="" style="color:black">></span><div class="" style="display:inline"><span class="" style="white-space:pre;color:black;font-weight:bold">0</span></div>
<span class="" style></<span class="" style="color:purple;font-weight:bold">time_undetermined_not_running</span>></span></div><div class="" style="margin:2px 0px 5px 20px"><span class="" style="color:black;background-color:rgb(135,206,235);border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px"><<span class="" style="color:purple;font-weight:bold">percent_time_undetermined_not_running</span></span><span class="" style="color:black">></span><div class="" style="display:inline">
<span class="" style="white-space:pre;color:black;font-weight:bold">0.000</span></div><span class="" style="background-color:rgb(135,206,235);border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px"></<span class="" style="color:purple;font-weight:bold">percent_time_undetermined_not_running</span>></span></div>
<div class="" style="margin:2px 0px 5px 20px"><span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">time_undetermined_no_data</span></span><span class="" style="color:black">></span><div class="" style="display:inline">
<span class="" style="white-space:pre;color:black;font-weight:bold">0</span></div><span class="" style></<span class="" style="color:purple;font-weight:bold">time_undetermined_no_data</span>></span></div><div class="" style="margin:2px 0px 5px 20px">
<span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">percent_time_undetermined_no_data</span></span><span class="" style="color:black">></span><div class="" style="display:inline">
<span class="" style="white-space:pre;color:black;font-weight:bold">0.000</span></div><span class="" style></<span class="" style="color:purple;font-weight:bold">percent_time_undetermined_no_data</span>></span></div>
<div class="" style="margin:2px 0px 5px 20px"><span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">total_time_undetermined</span></span><span class="" style="color:black">></span><div class="" style="display:inline">
<span class="" style="white-space:pre;color:black;font-weight:bold">0</span></div><span class="" style></<span class="" style="color:purple;font-weight:bold">total_time_undetermined</span>></span></div><div class="" style="margin:2px 0px 5px 20px">
<span class="" style="color:black"><<span class="" style="color:purple;font-weight:bold">percent_total_time_undetermined</span></span><span class="" style="color:black">></span><div class="" style="display:inline"><span class="" style="white-space:pre;color:black;font-weight:bold">0.000</span></div>
<span class="" style></<span class="" style="color:purple;font-weight:bold">percent_total_time_undetermined</span>></span></div></div><span class="" style="background-color:rgb(135,206,235);border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;color:rgb(0,0,0);font-family:monospace;font-size:13px"></<span class="" style="color:purple;font-weight:bold">host</span>></span><br clear="all">
<div><br></div><div><br></div><div>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.</div><div><br>
</div><div>Is this a known bug, and is there a workaround (short of parsing through perl and doing the math).</div><div><br></div>-- <br>Patrick Forristal<br>
</div>