2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

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
This commit is contained in:
Antoine Beaupré 2014-03-21 08:07:58 -04:00
parent 9860b09758
commit 2ecac880e9

View File

@ -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;
}