1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

fix both display of incidents and usage of existing stats

we were not using the right key
This commit is contained in:
Antoine Beaupré 2012-03-21 15:32:03 -04:00
parent 03302b38aa
commit acd97175b6

View file

@ -146,7 +146,9 @@ save_state($pos);
# get missing availability values from relayctl, if necessary
for my $host (@hosts) {
my $ran = 0;
if (!defined $avail{$host} && !$ran) {
my $clean = clean_fieldname($host);
$clean = clean_fieldname('host'.$host) unless ($clean ne '_');
if (!defined $avail{$clean} && !$ran) {
open(my $status, "relayctl show summary|") or die "can't open relayctl: $!";
while (<$status>) {
if (/([\w\.]+)\s+(\d+\.\d+)%/) {
@ -163,12 +165,12 @@ print "multigraph relayd_avail\n";
for my $host (@hosts) {
my $clean = clean_fieldname($host);
$clean = clean_fieldname('host'.$host) unless ($clean ne '_');
print "$clean.value " . ($avail{$host} || 'NaN'). "\n";
print "$clean.value " . ($avail{$clean} || 'NaN'). "\n";
}
print "multigraph relayd_incidents\n";
for my $host (@hosts) {
my $clean = clean_fieldname($host);
$clean = clean_fieldname('host'.$host) unless ($clean ne '_');
print "$clean.value " . ($down{$host} || 0). "\n";
print "$clean.value " . ($down{$clean} || 0). "\n";
}