From a7c2b63dbe21ccd1961073cbbdbaff99671b7bdf Mon Sep 17 00:00:00 2001 From: Vincent Riquer Date: Sun, 1 Feb 2015 22:17:10 +0100 Subject: [PATCH] use $rrdfile everywhere --- add | 8 ++++---- import | 10 +++++----- index | 2 +- lib/readold | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/add b/add index b6c6c07..0ec4325 100755 --- a/add +++ b/add @@ -64,13 +64,13 @@ do ds="${ds//ds[/}" ds="${ds//]*/}" datasets+=("$ds") -done < <(rrdtool info ingress.rrd |grep index) +done < <(rrdtool info "$rrdfile" |grep index) for ds in ${dsnames[@]} do if [[ ! ${datasets[@]} =~ $ds ]] then - cp -f ingress.rrd ingress.rrd.bak_add_$ds - ./dsaddtor.pl ingress.rrd $ds GAUGE $((48*60*60)) 0 NaN + cp -f "$rrdfile" "$rrdfile".bak_add_$ds + ./dsaddtor.pl "$rrdfile" $ds GAUGE $((48*60*60)) 0 NaN fi done data=N @@ -82,7 +82,7 @@ do done echo ${POST["innovator"]} > .innovator -rrdtool update ingress.rrd -t $template "$data" +rrdtool update "$rrdfile" -t $template "$data" if [ -n "$CACHE_DIR" ] then diff --git a/import b/import index 237f222..209b126 100755 --- a/import +++ b/import @@ -66,20 +66,20 @@ then ds="${ds//ds[/}" ds="${ds//]*/}" datasets+=("$ds") - done < <(rrdtool info ingress.rrd |grep index) + done < <(rrdtool info "$rrdfile" |grep index) for ds in ${dsnames[@]} do if [[ ! ${datasets[@]} =~ $ds ]] then - cp -f ingress.rrd ingress.rrd.bak_add_$ds - ./dsaddtor.pl ingress.rrd $ds GAUGE $((48*60*60)) 0 NaN + cp -f "$rrdfile" "$rrdfile".bak_add_$ds + ./dsaddtor.pl "$rrdfile" $ds GAUGE $((48*60*60)) 0 NaN fi done while read date hour data do data=$(date -d "$date $hour" +%s):${data// /:} - rrdtool update ingress.rrd -t $template "$data" 2>&1 + rrdtool update "$rrdfile" -t $template "$data" 2>&1 done <<<"${POST["data"]}" if [ -n "$CACHE_DIR" ] @@ -106,7 +106,7 @@ else EOHTML if ! [ -w "$rrdfile" ] then - rrdtool create ingress.rrd -s $((60*60)) \ + rrdtool create "$rrdfile" -s $((60*60)) \ DS:AP:GAUGE:$((2*24*60*60)):0:NaN \ DS:Explorer:GAUGE:$((48*60*60)):0:NaN \ DS:Seer:GAUGE:$((48*60*60)):0:NaN \ diff --git a/index b/index index 97b8e2b..6569ee5 100755 --- a/index +++ b/index @@ -376,7 +376,7 @@ then
- First + First -Y -M -W diff --git a/lib/readold b/lib/readold index af8f41e..9bdb849 100644 --- a/lib/readold +++ b/lib/readold @@ -18,6 +18,6 @@ readold() { done ) } < <( - rrdtool fetch -s "$when" ingress.rrd AVERAGE | sed '/: nan/d' + rrdtool fetch -s "$when" "$rrdfile" AVERAGE | sed '/: nan/d' ) }