[Nagios-devel] avail.cgi issue
Posted: Thu Mar 24, 2011 2:00 pm
--=_mixed 00526F9E8025785D_=
Content-Type: multipart/alternative;
boundary="=_alternative 00526F9E8025785D_="
--=_alternative 00526F9E8025785D_=
Content-Type: text/plain; charset="US-ASCII"
Hello
I'm currently running Nagios 3.2.1, and have been having issues with
avail.cgi.
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:
- The report must be run with a time period such as 'workhours'. The issue
does not occur with 24x7.
- The service must have a scheduled downtime period which lies outside of
the report time period.
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.
total(during rpttimeperiod) - scheduled(at any time) = unscheduled
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.
I've checked, and this is also a problem with avail.cgi version 3.2.3.
Thanks
Jon
--=_alternative 00526F9E8025785D_=
Content-Type: text/html; charset="US-ASCII"
Hello
I'm currently running Nagios 3.2.1,
and have been having issues with avail.cgi.
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:
- The report must be run
with a time period such as 'workhours'. The issue does not occur with 24x7.
- The service must have
a scheduled downtime period which lies outside of the report time period.
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.
total(during
rpttimeperiod) - scheduled(at any time) = unscheduled
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.
I've checked, and this is also a problem
with avail.cgi version 3.2.3.
Thanks
Jon
--=_alternative 00526F9E8025785D_=--
--=_mixed 00526F9E8025785D_=
Content-Type: application/octet-stream; name="avail.c.3.2.1.rpttimeperiod.diff"
Content-Disposition: attachment; filename="avail.c.3.2.1.rpttimeperiod.diff"
Content-Transfer-Encoding: base64
LS0tIGF2YWlsLmMJMjAxMS0wMy0yNCAxNDozNTo0OS4wMDAwMDAwMDAgKzAwMDAKKysrIGF2YWls
Lm5ldy5jCTIwMTEtMDMtMjQgMTQ6MzY6MTYuMDAwMDAwMDAwICswMDAwCkBAIC0yMTcwLDYgKzIx
NzAsMTYgQEAKIAlpbnQgaG9zdF9kb3dudGltZV9kZXB0aD0wOwogCWludCBzZXJ2aWNlX2Rvd250
aW1lX2RlcHRoPTA7CiAJaW50IHByb2Nlc3NfY2h1bms9RkFMU0U7CisJc3RydWN0IHRtICp0Owor
CXVuc2lnbmVkIGxvbmcgbWlkbmlnaHRfdG9kYXk7CisJaW50IHdlZWtkYXk7CisJdGltZXJhbmdl
ICp0ZW1wX3RpbWVyYW5nZTsKKwl1bnNpZ25lZCBsb25nIHRlbXBfZHVyYXRpb247CisJdW5zaWdu
ZWQgbG9uZyB0ZW1wX2VuZDsKKwl1bnNpZ25lZCBsb25nIHRlbXBfc3RhcnQ7CisJdW5zaWduZWQg
bG9uZyBzdGFydDsKKwl1bnNpZ25lZCBsb25nIGVuZDsKKwkKIAogI2lmZGVmIERFQlVHMgogCXBy
aW50ZigiQ09NUFVURV9TVUJKRUNUX0RPV05USU1FXG4iKTsKQEAgLTIyMzIsMjEgKzIyNDIsNzgg
QEAKIAkJC
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Content-Type: multipart/alternative;
boundary="=_alternative 00526F9E8025785D_="
--=_alternative 00526F9E8025785D_=
Content-Type: text/plain; charset="US-ASCII"
Hello
I'm currently running Nagios 3.2.1, and have been having issues with
avail.cgi.
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:
- The report must be run with a time period such as 'workhours'. The issue
does not occur with 24x7.
- The service must have a scheduled downtime period which lies outside of
the report time period.
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.
total(during rpttimeperiod) - scheduled(at any time) = unscheduled
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.
I've checked, and this is also a problem with avail.cgi version 3.2.3.
Thanks
Jon
--=_alternative 00526F9E8025785D_=
Content-Type: text/html; charset="US-ASCII"
Hello
I'm currently running Nagios 3.2.1,
and have been having issues with avail.cgi.
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:
- The report must be run
with a time period such as 'workhours'. The issue does not occur with 24x7.
- The service must have
a scheduled downtime period which lies outside of the report time period.
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.
total(during
rpttimeperiod) - scheduled(at any time) = unscheduled
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.
I've checked, and this is also a problem
with avail.cgi version 3.2.3.
Thanks
Jon
--=_alternative 00526F9E8025785D_=--
--=_mixed 00526F9E8025785D_=
Content-Type: application/octet-stream; name="avail.c.3.2.1.rpttimeperiod.diff"
Content-Disposition: attachment; filename="avail.c.3.2.1.rpttimeperiod.diff"
Content-Transfer-Encoding: base64
LS0tIGF2YWlsLmMJMjAxMS0wMy0yNCAxNDozNTo0OS4wMDAwMDAwMDAgKzAwMDAKKysrIGF2YWls
Lm5ldy5jCTIwMTEtMDMtMjQgMTQ6MzY6MTYuMDAwMDAwMDAwICswMDAwCkBAIC0yMTcwLDYgKzIx
NzAsMTYgQEAKIAlpbnQgaG9zdF9kb3dudGltZV9kZXB0aD0wOwogCWludCBzZXJ2aWNlX2Rvd250
aW1lX2RlcHRoPTA7CiAJaW50IHByb2Nlc3NfY2h1bms9RkFMU0U7CisJc3RydWN0IHRtICp0Owor
CXVuc2lnbmVkIGxvbmcgbWlkbmlnaHRfdG9kYXk7CisJaW50IHdlZWtkYXk7CisJdGltZXJhbmdl
ICp0ZW1wX3RpbWVyYW5nZTsKKwl1bnNpZ25lZCBsb25nIHRlbXBfZHVyYXRpb247CisJdW5zaWdu
ZWQgbG9uZyB0ZW1wX2VuZDsKKwl1bnNpZ25lZCBsb25nIHRlbXBfc3RhcnQ7CisJdW5zaWduZWQg
bG9uZyBzdGFydDsKKwl1bnNpZ25lZCBsb25nIGVuZDsKKwkKIAogI2lmZGVmIERFQlVHMgogCXBy
aW50ZigiQ09NUFVURV9TVUJKRUNUX0RPV05USU1FXG4iKTsKQEAgLTIyMzIsMjEgKzIyNDIsNzgg
QEAKIAkJC
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]