Projet

Général

Profil

Révision a3f989a9

IDa3f989a9f2e31badd4d75c19df94e2c92ec05bea

Ajouté par Antoine Beaupré il y a plus de 13 ans

get missing availability values from relayctl, if necessary

Voir les différences:

plugins/relayd
130 130
}
131 131
close($log) or warn "failed to close pipe: $!";
132 132

  
133
# get missing availability values from relayctl, if necessary
134
for my $host (@hosts) {
135
	my $ran = 0;
136
 	if (!defined $avail{$host} && !$ran) {
137
		open(my $status, "relayctl show summary|") or die "can't open relayctl: $!";
138
		while (<$status>) {
139
			if (/([\w\.]+)\s+(\d+\.\d+)%/) {
140
				print "found spare value: $2 for $1\n" if defined $ENV{MUNIN_DEBUG};
141
				$avail{$1} = $2 unless defined($avail{$1});
142
			}
143
		}
144
		close $status or die "can't close pipe: $!";
145
		$ran = 1;
146
	}
147
}
148

  
133 149
print "multigraph relayd_avail\n\n";
134 150
for my $host (@hosts) {
135 151
  	print "$host.value " . ($avail{$host} || 'NaN'). "\n";

Formats disponibles : Unified diff