![]() ![]() |
hotsanic |
Subversion Repositories: |
Compare with Previous - Blame - Download
#!/usr/bin/env shif [ "$2" = "" ]; then num=30; else num=$2; fiDIR=$1;if [ "$DIR" = "" ]; then DIR="."; fiif [ ! "$(echo $DIR|grep "^[0-9]*$")" = "" ]; then num=$DIR; DIR=".";fiif [ ! -e $DIR ]; thenecho "no such directory \"$DIR\""exitfiif [ ! -e $DIR/rrd ]; thenecho "no database directory found in \"$DIR\""exitfiif [ $(ls $DIR/rrd | grep -c "\.rrd") -eq 0 ]; thenecho "no databases found in \"$DIR/rrd/\""exitfi# need BINPATH variable from main settings#BINPATH=""if [ "$BINPATH" = "" ] && [ -e ../../../settings ] ; then . ../../../settingselseif [ "$BINPATH" = "" ] && [ -e ../../settings ] ; then . ../../settingselseif [ "$BINPATH" = "" ] && [ -e ../settings ] ; then . ../settingselse if [ -e settings ] ; then . settings ; fifififiif [ "$BINPATH" = "" ]; thenecho "BINPATH variable not configured in main settings!"echo "Check installation or call me from somewhere inside HotSaNIC!"elsefor nn in $DIR/rrd/*; doecho "checking $nn"$BINPATH/rrdtool fetch $nn -s -$num AVERAGEecho;echodonefi