Categories
Networking Open Source Software

Remove Spikes From RRDtool Graphs

I use RRDtool to make graphs on various things I monitor like server stats, network stats and it does a relatively good job. My one (big) complaint is that when you restart you occasionally see these gigantic spikes that completely mess up the data. I’ve even seen spikes larger than what the system can technically handle.

Nobody mentioned there’s a removespikes.pl script (download) that will remove these outliers from your rrds. I put together a quick shell script to make it quick for when I need to run it again:

!/bin/sh
 
for i in /path/to/graphs/rrd/*;
do
        perl removespikes.pl $i;
done;

If you have a ton of graphs a quick shell script to iterate through the directly may be quicker. If you only have a handful like me, no big deal.

Keep the script around for the next time you have spikes to deal with.

3 replies on “Remove Spikes From RRDtool Graphs”

hello,
i have been using this script for a while, and now it stoped working
i have changed the rrd server to a 64bit os and i think thats when it stoped, any idea how to make it work again?
tnx!

I have just experienced the same broken behavior. We just updated to 64bit architecture and now my removespikes.pl utility script is no longer working. My search now continues to find a fix or alternative, unless someone has a quick answer for me!?

For anyone else that runs across this problem, the regex needs to be corrected because the 64bit versions do not have leading/trailing spaces around the values.

changes:

if (/\s\d\.\d+e.(\d+)\s/)
becomes:
if (/\s*\d\.\d+e.(\d+)\s*/)

and

if ( $dump[$lino]=~/\d\.\d+e.(\d+)\s/ )

becomes:

if ( $dump[$lino]=~/\d\.\d+e.(\d+)\s*/ )

Hope it helps!

Leave a Reply to chad Cancel reply

Your email address will not be published. Required fields are marked *