This is a multi-part message in MIME format.
------_=_NextPart_001_01C49B17.B9B4D7AA
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Hi,
First off sorry if I have posted an attachment to an attachment-free
list (if so let me know, and I will repost with the attachment as a
link).
I posted to "nagios-users" a while back (2004-06-23) requesting
information on how to get availability reports based on a timeperiod.
Why I would like this is because we have in our SLA 8x5 but I still want
to have monitoring 24x7 for "internal use".
I got a response suggesting either to add a custom script or to add the
functionality myself. Being somewhat familiar with C/C++ I decided to
try to adding the functionality myself after having updated to 2.0.=20
I have now created a simple patch which does some of the things I want.
This patch is far from complete (as it only covers single hosts and only
avail.cgi). But I wanted to get feedback before embarking on changing a
lot of things as I'm not very familiar with Nagios development.
What this patch does is:
1, Add a drop-down box to the "Select Report Options" page.=20
2, Parses the new variable.
3, If the new variable is detected parses time based on it.
4, on Single Host (ONLY!) rescales the "total_time" to include only the
selected timeperiod.
I would like to know if there is an interest for the functionality, if I
have implemented it in a reasonable way, if I should implement it
"through out" the reports section and similar such questions.
// Michael Medin
------_=_NextPart_001_01C49B17.B9B4D7AA
Content-Type: application/octet-stream;
name="avail_timeperiods.patch"
Content-Transfer-Encoding: base64
Content-Description: avail_timeperiods.patch
Content-Disposition: attachment;
filename="avail_timeperiods.patch"
SW5kZXg6IGNnaS9hdmFpbC5jDQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQpSQ1MgZmlsZTogL2N2c3Jvb3QvbmFnaW9z
L25hZ2lvcy9jZ2kvYXZhaWwuYyx2DQpyZXRyaWV2aW5nIHJldmlzaW9uIDEuMjMNCmRpZmYgLXUg
LXIxLjIzIGF2YWlsLmMNCi0tLSBjZ2kvYXZhaWwuYwkyMSBKYW4gMjAwNCAwNDo1NjowOSAtMDAw
MAkxLjIzDQorKysgY2dpL2F2YWlsLmMJMTUgU2VwIDIwMDQgMTA6NDg6NTMgLTAwMDANCkBAIC00
MSw2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ZCB2YWxp
Z249dG9wIGNsYXNzPSdyZXBvcnRTZWxlY3RTdWJUaXRsZSc+UmVwb3J0IHRpbWUgUGVyaW9kOjwv
dGQ+XG4iKTsNCisJCXByaW50ZigiPHRkIHZhbGlnbj10b3AgYWxpZ249bGVmdCBjbGFzcz0nb3B0
Qm94SXRlbSc+XG4iKTsNCisJCXByaW50ZigiPHNlbGVjdCBuYW1lPSdycHR0aW1lcGVyaW9kJz5c
biIpOw0KKwkJcHJpbnRmKCI8b3B0aW9uIHZhbHVlPT5Ob25lXG4iKTsNCisJCS8qIGNoZWNrIGFs
bCB0aGUgdGltZSBwZXJpb2RzLi4uICovDQorCQlmb3IodGVtcF90aW1lcGVyaW9kPXRpbWVwZXJp
b2RfbGlzdDt0ZW1wX3RpbWVwZXJpb2QhPU5VTEw7dGVtcF90aW1lcGVyaW9kPXRlbXBfdGltZXBl
cmlvZC0+bmV4dCl7DQorCQkJcHJpbnRmKCI8b3B0aW9uIHZhbHVlPSVzPiVzXG4iLCB1cmxfZW5j
b2RlKHRlbXBfdGltZXBlcmlvZC0+bmFtZSksIHRlbXBfdGltZXBlcmlvZC0+bmFtZSk7DQorCQl9
DQorCQlwcmludGYoIjwvc2VsZWN0PlxuIik7DQorCQlwcmludGYoIjwvdGQ+XG4iKTsNCisJCXBy
aW50ZigiPC90cj5cbiIpOw0KKwkJcHJpbnRmKCI8dHI+PHRkIGNvbHNwYW49Mj48YnI+PC90ZD48
L3RyPlxuIik7DQorDQogCQlwcmludGYoIjx0c
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]