pcp
[Top] [All Lists]

[PATCH] pmie log file rotation

To: Michael Newton <kimbrr@xxxxxxxxxxxxxxxxx>
Subject: [PATCH] pmie log file rotation
From: Nathan Scott <nscott@xxxxxxxxxx>
Date: Wed, 21 Mar 2007 13:41:10 +1100
Cc: pcp@xxxxxxxxxxx
Organization: Aconex
Reply-to: nscott@xxxxxxxxxx
Sender: pcp-bounce@xxxxxxxxxxx
Hi there,

Following is a patch which implements log file rotation for pmie
daemons, using a similar mechanism to that used for the archives
from pmlogger.  This is useful when using multiple pmie actions
for all rules, one of which is to write to the local log (every
delta, potentially, so unbounded logfile growth becomes an issue)
and the other action is to send performance events to an "event
clearinghouse" (i.e. one of the many management frameworks).

This provides an audit trail in the situation where the events
are being sent across an unreliable network, for example, and one
needs to know whether a problem was detected at all, or whether
the problem report was sent but lost in the ether.

The patches provide:
- pmie_daily log rotation, with log file culling and compression,
which builds on the control file that pmie_check already uses;
- ability for pmie to catch SIGHUP in daemon mode and to start
writing to a new log file;
- a <pcp/impl.h> libpcp API extension "__pmRotateLog" which is an
extension to the existing "__pmOpenLog" API, for daemons.
- some minor fixes for issues in man pages, pmlogger scripts, etc.
- two QA scripts to exercise the new functionality.

I also noticed that pmlogger_daily uses the compress(1) program as
its default compression method; however, that only exists on IRIX.
So, I updated that to use bzip2(1) instead, which should exist on
all supported PCP platforms (there is a command line option to use
a different tool, of course, but we should start with something we
know exists, probably...).  There is an associated piece in the QA
test patches which ensures existing QA tests continue to work for
both old and new pmlogger_daily versions.

cheers.

-- 
Nathan

Attachment: pmie-log-rotation
Description: Text Data

Attachment: 314-pmie_daily
Description: Text Data

Attachment: 315-pmie_daily
Description: Text Data

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] pmie log file rotation, Nathan Scott <=