1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 10:39:53 +00:00

dhcp-pool: field name may not start with number, prefix them with "_"

Also include pool range "from_ip - to_ip" to field label
This commit is contained in:
Kim B. Heino 2021-04-01 16:35:23 +03:00 committed by Lars Kruse
parent 341de2c2b9
commit 43f5d31c21

View file

@ -69,9 +69,9 @@ elsif ( defined $ARGV[0] and $ARGV[0] eq "config" ) {
foreach $start (keys %pools) {
$label = ip2string($start);
$label =~ s/\./\_/g;
print "$label.label Pool ".ip2string($start)."\n";
print "$label.warning 75\n";
print "$label.critical 100\n";
print "_$label.label Pool " . ip2string($start) . " - " . ip2string($start + $pools{$start} - 1) . "\n";
print "_$label.warning 75\n";
print "_$label.critical 100\n";
}
}
else {
@ -96,7 +96,7 @@ else {
}
$label = ip2string($start);
$label =~ s/\./\_/g;
print "$label.value ".sprintf("%.1f", 100*($size-$free)/$size)."\n";
print "_$label.value ".sprintf("%.1f", 100*($size-$free)/$size)."\n";
}
}