[Nagios-devel] Event Profiler Patch

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] Event Profiler Patch

Post by Guest »

--_003_3679AE44D8C04547A4F3EB83E77905628241945A3FMBX01ldschurc_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi Everyone,

In our attempts to squeeze more and more performance out of Nagios, we want=
ed a way to see how long Nagios is spending in each event type, average an=
d tota as well as how many times each event is calledl.
The solution I came up with was an Event Profiler.
It's quite simple really, we start a timer at the beginning of handle_timed=
_event, then we stop the timer at the end.
Next we add that time to the total timer for the event type, and increment =
the event call timer for that type.
Finally we write it out as part of status.dat. From here nagiostats prints=
out a nicely formatted list of whats going on as per normal.
It looks something like this (note I have host checking and retention savin=
g disabled on my dev box right now, also my copy/paste munged the formattin=
g).

EVENT PROFILE DATA: total seconds spent / number of events / avg time per =
event
----------------------------------------------------
service check 7420 / 104033 / 0.0713=20
host check 0 / 0 / 0.0000=20
external command check 0 / 159 / 0.0000=20
log file rotation 0 / 0 / 0.0000=20
program restart 0 / 0 / 0.0000=20
service check reaper 1438 / 951 / 1.5121=20
orphaned service check 0 / 0 / 0.0000=20
retention save 0 / 0 / 0.0000=20
status save 634 / 317 / 2.0000=20
scheduled downtime 0 / 0 / 0.0000=20
service result freshness check 0 / 0 / 0.0000=20
host result freshness check 0 / 0 / 0.0000=20
expire downtime 0 / 0 / 0.0000=20
reschedule checks 0 / 159 / 0.0000=20
expire comment 0 / 0 / 0.0000=20
user function 0 / 0 / 0.0000=20

Simply apply the patch to your nagios install (I have included patches for =
Nagios3x and nagios-2.12), and compile with the -DEVENT_PROFILER to take ad=
vantage of the new functionality.
I hope this helps!

Sincerely,
Steve


NOTICE: This email message is for the sole use of the intended recipient(s=
) and may contain confidential and privileged information. Any unauthorized=
review, use, disclosure or distribution is prohibited. If you are not the =
intended recipient, please contact the sender by reply email and destroy al=
l copies of the original message.



--_003_3679AE44D8C04547A4F3EB83E77905628241945A3FMBX01ldschurc_
Content-Type: text/x-patch; name="nagios-2.12-event_profiler.patch"
Content-Description: nagios-2.12-event_profiler.patch
Content-Disposition: attachment;
filename="nagios-2.12-event_profiler.patch"; size=23611;
creation-date="Fri, 05 Jun 2009 15:42:34 GMT";
modification-date="Fri, 05 Jun 2009 15:42:34 GMT"
Content-Transfer-Encoding: base64

ZGlmZiAtd3VycE4gbmFnaW9zLTIuMTItY2xlYW4vYmFzZS9ldmVudHMuYyBuYWdpb3MtMi4xMi1t
b2RpZmllZC9iYXNlL2V2ZW50cy5jCi0tLSBuYWdpb3MtMi4xMi1jbGVhbi9iYXNlL2V2ZW50cy5j
CTIwMDctMDMtMDUgMTI6NTU6MzQuMDAwMDAwMDAwIC0wNzAwCisrKyBuYWdpb3MtMi4xMi1tb2Rp
ZmllZC9iYXNlL2V2ZW50cy5jCTIwMDktMDYtMDUgMTU6MTc6NDQuMDAwMDAwMDAwIC0wNjAwCkBA
IC05MSw2ICs5MSw0NyBAQCBzY2hlZF9pbmZvIHNjaGVkdWxpbmdfaW5mbzsKIAogZXh0ZXJuIHVu
c2lnbmVkIGxvbmcgICBjaGVja19yZXN1bHRfYnVmZmVyX3Nsb3RzOwogCisjaWZkZWYgRVZFTlRf
UFJPRklMRVIKK3RpbWVfdCBndF9icm9rZXI9MDsKK3RpbWVfdCBndF9zZXJ2aWNlPTA7Cit0aW1l
X3QgZ3RfaG9zdD0wOwordGltZV90IGd0X2NvbW1hbmQ9MDsKK3RpbWVfdCBndF9sb2c9MDsKK3Rp
bWVfdCBndF9zaHV0ZG93bj0wOwordGltZV90IGd0X3Jlc3RhcnQ9MDsKK3RpbWVfdCBndF9yZWFw
PTA7Cit0aW1lX3QgZ3Rfb3JwaGFuPTA7Cit0aW1lX3QgZ3Rfc2F2ZV9yZXQ9MDsKK3RpbWVfdCBn
dF9zYXZlX3N0YXRlPTA7Cit0aW1lX3QgZ3RfZG93bnRpbWU9MDsKK3RpbWVfdCBndF9zZnJlc2g9
MDsKK3RpbWVfdCBndF9oZnJlc2g9MDsKK3RpbWVfdCBndF9kb3dudGltZV9leHBpcmU9MDsKK3Rp
bWVfdCBndF9yZXNjaGVkdWxlPTA7Cit0aW1lX3QgZ3RfY29tbWVudF9leHBpcmU9MDsKK3RpbWVf
dCBndF91c2VyX2Z1bmM9MDsKKworaW50IGdvX2Jyb2tlcj0wOworaW50IGdvX3NlcnZpY2U9MDsK
K2ludCBnb19ob3N0PTA7Citpbn

...[email truncated]...


This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked