[rrd-users] Graphing a rotating logfile
Steve Shipway
s.shipway at auckland.ac.nz
Mon Mar 21 00:19:22 CET 2011
> I'm currently thinking about graphing the php error log to see how much
> errors/warnings/notices are generated over time.
>
> Can anyone tell me if I can use a simple: grep -c "Error" php.log to get
> the stats or do I have to script something that deals with the daily
> logfile rotation? Does the overflow function in COUNTER help with the
> rotation?
I assume this file grows during the day, and ten is set to empty at some set time (eg, midnight).
If you set the type to be a COUNTER, and input the total number of 'Error' lines, then youll get a constantly rising number during the day, so you can measure a rate from it.
When the file resets, the rate will either go negative (if the count wasn’t so high) or it could possibly trigger the counter-rollover checks and give a very high rate.
You can set the min/max values to 0 and something reasonable, so that the rollover merely results in a single 'unknown' being logged (the massive or negative value being dropped).
However, if your error count is not high (only a few per day) then a rate of x per second is going to be vanishingly small...
Steve
Steve Shipway
ITS Unix Services Design Lead
University of Auckland, New Zealand
Floor 1, 58 Symonds Street, Auckland
Phone: +64 (0)9 3737599 ext 86487
DDI: +64 (0)9 924 6487
Mobile: +64 (0)21 753 189
Email: s.shipway at auckland.ac.nz
Please consider the environment before printing this e-mail
More information about the rrd-users
mailing list