forked from neclimdul/CactiWMI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added fix.sh which is to strip out spikes from rrd files. Requires ma…
…nual configuration but only needs to be run once to fix the rrd file. Fixes issue #6
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|