Révision 2ecac880
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 | ||
|---|---|---|
| 47 | 47 |
my %stations; |
| 48 | 48 |
# number of signals sent per station |
| 49 | 49 |
my %signals; |
| 50 |
my $count; |
|
| 50 | 51 |
|
| 51 | 52 |
sub autoconf |
| 52 | 53 |
{
|
| ... | ... | |
| 72 | 73 |
print "graph_total Total\n"; |
| 73 | 74 |
print "graph_category AMR\n"; |
| 74 | 75 |
|
| 75 |
my $first = 1;
|
|
| 76 |
$count = 0;
|
|
| 76 | 77 |
foreach my $station (sort keys %stations) {
|
| 77 | 78 |
my $name = clean_fieldname('station power ' . $station);
|
| 78 |
printf "%s.label station %d\n", $name, $station;
|
|
| 79 |
printf "%s.label station %d\n", $name, $count;
|
|
| 79 | 80 |
printf "%s.type COUNTER\n", $name; |
| 80 |
if ($first) {
|
|
| 81 |
printf "%s.draw AREA\n", $name; |
|
| 82 |
$first = 0; |
|
| 81 |
if ($count++) {
|
|
| 82 |
printf "%s.draw STACK\n", $name; |
|
| 83 | 83 |
} |
| 84 | 84 |
else {
|
| 85 |
printf "%s.draw STACK\n", $name;
|
|
| 85 |
printf "%s.draw AREA\n", $name;
|
|
| 86 | 86 |
} |
| 87 | 87 |
printf "%s.min 0\n", $name; |
| 88 | 88 |
} |
| ... | ... | |
| 94 | 94 |
print "graph_scale no\n"; |
| 95 | 95 |
print "graph_category AMR\n"; |
| 96 | 96 |
|
| 97 |
my $first = 0;
|
|
| 97 |
$count = 0;
|
|
| 98 | 98 |
foreach my $station (sort keys %stations) {
|
| 99 | 99 |
my $name = clean_fieldname('station meter ' . $station);
|
| 100 |
printf "%s.label station %d\n", $name, $station;
|
|
| 100 |
printf "%s.label station %d\n", $name, $count++;
|
|
| 101 | 101 |
printf "%s.type GAUGE\n", $name; |
| 102 | 102 |
printf "%s.min 0\n", $name; |
| 103 | 103 |
} |
| ... | ... | |
| 115 | 115 |
print "graph_vlabel signals / \${graph_period}\n";
|
| 116 | 116 |
print "graph_period minute\n"; |
| 117 | 117 |
print "graph_category AMR\n"; |
| 118 |
$count = 0; |
|
| 118 | 119 |
foreach my $station (sort keys %stations) {
|
| 119 | 120 |
my $name = clean_fieldname('station signals ' . $station);
|
| 120 |
printf "%s.label station %d\n", $name, $station;
|
|
| 121 |
printf "%s.label station %d\n", $name, $count++;
|
|
| 121 | 122 |
printf "%s.type ABSOLUTE\n", $name; |
| 122 | 123 |
} |
| 123 | 124 |
|
Formats disponibles : Unified diff