jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [branches/] [HotSaNIC-0.5.0-pre6/] [tools/] [checkdbs.sh] - Blame information for rev 18

 

Line No. Rev Author Line
11simandl#!/usr/bin/env sh
2 
3if [ "$2" = "" ]; then num=30; else num=$2; fi
4 
5DIR=$1;
6if [ "$DIR" = "" ]; then DIR="."; fi
7 
8if [ ! "$(echo $DIR|grep "^[0-9]*$")" = "" ]; then num=$DIR; DIR=".";fi
9 
10if [ ! -e $DIR ]; then
11 echo "no such directory \"$DIR\""
12 exit
13 fi
14 
15if [ ! -e $DIR/rrd ]; then
16 echo "no database directory found in \"$DIR\""
17 exit
18 fi
19 
20if [ $(ls $DIR/rrd | grep -c "\.rrd") -eq 0 ]; then
21 echo "no databases found in \"$DIR/rrd/\""
22 exit
23 fi
24 
25# need BINPATH variable from main settings
26#
27BINPATH=""
28if [ "$BINPATH" = "" ] && [ -e ../../../settings ] ; then . ../../../settings
29else
30 if [ "$BINPATH" = "" ] && [ -e ../../settings ] ; then . ../../settings
31 else
32 if [ "$BINPATH" = "" ] && [ -e ../settings ] ; then . ../settings
33 else if [ -e settings ] ; then . settings ; fi
34 fi
35 fi
36fi
37 
38if [ "$BINPATH" = "" ]; then
39echo "BINPATH variable not configured in main settings!"
40echo "Check installation or call me from somewhere inside HotSaNIC!"
41else
42 for nn in $DIR/rrd/*; do
43 echo "checking $nn"
44 $BINPATH/rrdtool fetch $nn -s -$num AVERAGE
45 echo;echo
46 done
47 fi

Powered by WebSVN 2.2.1