From 2ecac880e90b503e1e55f0251b632e91f78fa9d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Beaupr=C3=A9?= Date: Fri, 21 Mar 2014 08:07:58 -0400 Subject: [PATCH] anonymise labels data is still stored with the full identifiers so this change is backwards compatible but at least we are not retransmiting data off the airwaves and it is anonymised in some way --- plugins/amr/amr.pl | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/plugins/amr/amr.pl b/plugins/amr/amr.pl index d8b254f7..8adbe6c8 100755 --- a/plugins/amr/amr.pl +++ b/plugins/amr/amr.pl @@ -47,6 +47,7 @@ my $logfile = $LOGDIR .'/'. $LOGFILE; my %stations; # number of signals sent per station my %signals; +my $count; sub autoconf { @@ -72,17 +73,16 @@ sub config print "graph_total Total\n"; print "graph_category AMR\n"; - my $first = 1; + $count = 0; foreach my $station (sort keys %stations) { my $name = clean_fieldname('station power ' . $station); - printf "%s.label station %d\n", $name, $station; + printf "%s.label station %d\n", $name, $count; printf "%s.type COUNTER\n", $name; - if ($first) { - printf "%s.draw AREA\n", $name; - $first = 0; + if ($count++) { + printf "%s.draw STACK\n", $name; } else { - printf "%s.draw STACK\n", $name; + printf "%s.draw AREA\n", $name; } printf "%s.min 0\n", $name; } @@ -94,10 +94,10 @@ sub config print "graph_scale no\n"; print "graph_category AMR\n"; - my $first = 0; + $count = 0; foreach my $station (sort keys %stations) { my $name = clean_fieldname('station meter ' . $station); - printf "%s.label station %d\n", $name, $station; + printf "%s.label station %d\n", $name, $count++; printf "%s.type GAUGE\n", $name; printf "%s.min 0\n", $name; } @@ -115,9 +115,10 @@ sub config print "graph_vlabel signals / \${graph_period}\n"; print "graph_period minute\n"; print "graph_category AMR\n"; + $count = 0; foreach my $station (sort keys %stations) { my $name = clean_fieldname('station signals ' . $station); - printf "%s.label station %d\n", $name, $station; + printf "%s.label station %d\n", $name, $count++; printf "%s.type ABSOLUTE\n", $name; }