Skip to content

Commit

Permalink
Added fix.sh which is to strip out spikes from rrd files. Requires ma…
Browse files Browse the repository at this point in the history
…nual configuration but only needs to be run once to fix the rrd file. Fixes issue #6
  • Loading branch information
claymen committed Mar 13, 2009
1 parent 5a54ee2 commit f04e8a8
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tools/fix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh

# Replace your rrd file name below so that it picks the correct files.
# Duplicate the rrdtool tune options to suit your data source name you wish to strip out spikes.
# Default value should suit most situations but feel free to adjust it further.

for file in `ls | grep your_rrd_name_here`;
do
echo Fixing $file
echo Backing up $file
mv $file ./old/
echo Tuning $file
# EDIT START
rrdtool tune ./old/$file --maximum ClosedSessions:500000
rrdtool tune ./old/$file --maximum OpenedSessions:500000
# EDIT END
echo Dumping $file
rrdtool dump ./old/$file > hax.temp
echo Restoring $file
rrdtool restore -r hax.temp $file
echo Cleaning up temp files
rm hax.temp
echo Fixing permissions
chown cacti:cacti $file
echo Done!
echo -e '\n\n\n'
done;

0 comments on commit f04e8a8

Please sign in to comment.