[mrtg] Removing some spikes from older graphs

Vincent De Keyzer vincent at dekeyzer.net
Wed Mar 28 14:03:13 CEST 2007


Gaurav,

> ya i know that it can be done by scrolling down, finding the values and
> deleting the one it has created the spikes, but what if the spikes were
> not that big and were in the range of around 500 Kbs where the traffic
> should be around a a range of 200 kbs, it will be hard finding the spikes.
> so it means that i have to scroll down the log file where the timestamp
> difference is long and than assume that "this is the one i am looking for"
> and delete it right. :S any other suggestions..

we do this with a shell script:

Let $max be the value above which you want to delete. The script somewhat
looks like:

cat target.log | awk -v max=$max '!(NF==5 && ($4 > max || $5 > max))'
>/tmp/tempfile
cp /tmp/tempfile target.log
rm /tmp/tempfile

... but this is linux, so YMMV if you're using Windows.

Vincent




More information about the mrtg mailing list