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:
parent
9860b09758
commit
2ecac880e9
1 changed files with 10 additions and 9 deletions
|
@ -47,6 +47,7 @@ my $logfile = $LOGDIR .'/'. $LOGFILE;
|
||||||
my %stations;
|
my %stations;
|
||||||
# number of signals sent per station
|
# number of signals sent per station
|
||||||
my %signals;
|
my %signals;
|
||||||
|
my $count;
|
||||||
|
|
||||||
sub autoconf
|
sub autoconf
|
||||||
{
|
{
|
||||||
|
@ -72,17 +73,16 @@ sub config
|
||||||
print "graph_total Total\n";
|
print "graph_total Total\n";
|
||||||
print "graph_category AMR\n";
|
print "graph_category AMR\n";
|
||||||
|
|
||||||
my $first = 1;
|
$count = 0;
|
||||||
foreach my $station (sort keys %stations) {
|
foreach my $station (sort keys %stations) {
|
||||||
my $name = clean_fieldname('station power ' . $station);
|
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;
|
printf "%s.type COUNTER\n", $name;
|
||||||
if ($first) {
|
if ($count++) {
|
||||||
printf "%s.draw AREA\n", $name;
|
printf "%s.draw STACK\n", $name;
|
||||||
$first = 0;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
printf "%s.draw STACK\n", $name;
|
printf "%s.draw AREA\n", $name;
|
||||||
}
|
}
|
||||||
printf "%s.min 0\n", $name;
|
printf "%s.min 0\n", $name;
|
||||||
}
|
}
|
||||||
|
@ -94,10 +94,10 @@ sub config
|
||||||
print "graph_scale no\n";
|
print "graph_scale no\n";
|
||||||
print "graph_category AMR\n";
|
print "graph_category AMR\n";
|
||||||
|
|
||||||
my $first = 0;
|
$count = 0;
|
||||||
foreach my $station (sort keys %stations) {
|
foreach my $station (sort keys %stations) {
|
||||||
my $name = clean_fieldname('station meter ' . $station);
|
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.type GAUGE\n", $name;
|
||||||
printf "%s.min 0\n", $name;
|
printf "%s.min 0\n", $name;
|
||||||
}
|
}
|
||||||
|
@ -115,9 +115,10 @@ sub config
|
||||||
print "graph_vlabel signals / \${graph_period}\n";
|
print "graph_vlabel signals / \${graph_period}\n";
|
||||||
print "graph_period minute\n";
|
print "graph_period minute\n";
|
||||||
print "graph_category AMR\n";
|
print "graph_category AMR\n";
|
||||||
|
$count = 0;
|
||||||
foreach my $station (sort keys %stations) {
|
foreach my $station (sort keys %stations) {
|
||||||
my $name = clean_fieldname('station signals ' . $station);
|
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;
|
printf "%s.type ABSOLUTE\n", $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue