mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 14:16:00 +00:00
get missing availability values from relayctl, if necessary
This commit is contained in:
parent
cd70960d1e
commit
a3f989a9f2
1 changed files with 16 additions and 0 deletions
|
@ -130,6 +130,22 @@ while (<$log>) {
|
||||||
}
|
}
|
||||||
close($log) or warn "failed to close pipe: $!";
|
close($log) or warn "failed to close pipe: $!";
|
||||||
|
|
||||||
|
# get missing availability values from relayctl, if necessary
|
||||||
|
for my $host (@hosts) {
|
||||||
|
my $ran = 0;
|
||||||
|
if (!defined $avail{$host} && !$ran) {
|
||||||
|
open(my $status, "relayctl show summary|") or die "can't open relayctl: $!";
|
||||||
|
while (<$status>) {
|
||||||
|
if (/([\w\.]+)\s+(\d+\.\d+)%/) {
|
||||||
|
print "found spare value: $2 for $1\n" if defined $ENV{MUNIN_DEBUG};
|
||||||
|
$avail{$1} = $2 unless defined($avail{$1});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
close $status or die "can't close pipe: $!";
|
||||||
|
$ran = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print "multigraph relayd_avail\n\n";
|
print "multigraph relayd_avail\n\n";
|
||||||
for my $host (@hosts) {
|
for my $host (@hosts) {
|
||||||
print "$host.value " . ($avail{$host} || 'NaN'). "\n";
|
print "$host.value " . ($avail{$host} || 'NaN'). "\n";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue