1 | 1 | simandl | #!/usr/bin/env sh |
2 | | | |
3 | | | . ../../settings |
4 | | | |
5 | | | FIRSTFILE=`ls rrd/|head -n 1` |
6 | | | |
7 | | | if [ `$BINPATH/rrdtool info rrd/$FIRSTFILE|grep -c msrefused` -eq 0 ]; then |
8 | | | |
9 | | | echo "old-style databases found, update necessary."; |
10 | | | |
11 | | | # update databases if needed |
12 | | | # |
13 | | | FILES=`ls rrd` |
14 | | | for nn in $FILES; do |
15 | | | echo "updating $nn" |
16 | | | $BINPATH/rrdtool dump rrd/$nn | ../../tools/rrdtool_add_ds.pl 1 nan GAUGE > rrd/temp.xml |
17 | | | $BINPATH/rrdtool restore rrd/temp.xml rrd/temp.rrd |
18 | | | rm -f rrd/temp.xml |
19 | | | $BINPATH/rrdtool tune rrd/temp.rrd -r refused:crefused -r ds1:msrefused |
20 | | | mv -f rrd/temp.rrd rrd/$nn |
21 | | | done |
22 | | | fi |
23 | | | |