<font size=2 face="sans-serif">Hello</font>
<br>
<br><font size=2 face="sans-serif">I'm currently running Nagios 3.2.1,
and have been having issues with avail.cgi. </font>
<br>
<br><font size=2 face="sans-serif">If a report is run for a service which
has a period of scheduled downtime outside of rpttimeperiod, then there
are negative percentages for unscheduled critical. To recreate this:</font>
<br>
<br><font size=2 color=#2f2f2f face="sans-serif">- The report must be run
with a time period such as 'workhours'. The issue does not occur with 24x7.</font>
<br><font size=2 color=#2f2f2f face="sans-serif">- The service must have
a scheduled downtime period which lies outside of the report time period.
</font>
<br>
<br><font size=2 face="sans-serif">After a bit of digging this turned out
to be due to the total critical time being calculated based on the rpttimeperiod,
but the calculation of the scheduled critical time ignoring this and always
being 24x7, i.e.</font>
<br>
<br><font size=2 face="sans-serif">        total(during
rpttimeperiod) - scheduled(at any time) = unscheduled</font>
<br>
<br><font size=2 face="sans-serif">I've had a go at fixing this in version
3.2.1, and the diff is attached. There are undoubtably many things wrong
with the way I have done this, but thought I'd send it anyway! It also
contains a fix for the stray 'TEST' when outputting to csv, which I notice
has already been fixed in version 3.2.3. </font>
<br>
<br><font size=2 face="sans-serif">I've checked, and this is also a problem
with avail.cgi version 3.2.3.</font>
<br>
<br><font size=2 face="sans-serif">Thanks</font>
<br>
<br><font size=2 face="sans-serif">Jon</font>
<br>
<br>
<br>
<br>
<br>
<br>