mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-25 18:38:30 +00:00
Adds rebuild status
This commit is contained in:
parent
2b6d4bc48e
commit
27d5ca531a
1 changed files with 20 additions and 5 deletions
|
@ -5,7 +5,7 @@
|
||||||
# Plugin to monitor RAID status
|
# Plugin to monitor RAID status
|
||||||
#
|
#
|
||||||
# Results are % of healthy drives in a raid device
|
# Results are % of healthy drives in a raid device
|
||||||
#
|
# and % rebuilt of devices that are resyncing.
|
||||||
#
|
#
|
||||||
#%# family=contrib
|
#%# family=contrib
|
||||||
#%# capabilities=autoconf
|
#%# capabilities=autoconf
|
||||||
|
@ -30,7 +30,7 @@ if ( $ARGV[0] and $ARGV[0] eq "config" )
|
||||||
print "graph_category disk\n";
|
print "graph_category disk\n";
|
||||||
print "graph_info This graph monitors RAID disk health. Values are percentage of healthy drives in each raid group. Degraded devices are marked Critical.\n";
|
print "graph_info This graph monitors RAID disk health. Values are percentage of healthy drives in each raid group. Degraded devices are marked Critical.\n";
|
||||||
print "graph_args --base 1000 -l 0\n";
|
print "graph_args --base 1000 -l 0\n";
|
||||||
print "graph_vlabel % healthy\n";
|
print "graph_vlabel % healthy/rebuilt\n";
|
||||||
print "graph_scale no\n";
|
print "graph_scale no\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,11 +51,28 @@ if ( $ARGV[0] and $ARGV[0] eq "config" )
|
||||||
print "$dev.info $type $members\n";
|
print "$dev.info $type $members\n";
|
||||||
# 100: means less than 100
|
# 100: means less than 100
|
||||||
print "$dev.critical 100:\n";
|
print "$dev.critical 100:\n";
|
||||||
|
print $dev, "_rebuild.label $dev rebuilt\n";
|
||||||
|
print $dev, "_rebuild.info $type\n";
|
||||||
|
print $dev, "_rebuild.critical 100:\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
my $pct = 100 * $nact / $nmem;
|
my $pct = 100 * $nact / $nmem;
|
||||||
|
my $rpct = 100;
|
||||||
|
if ( $pct < 100 )
|
||||||
|
{
|
||||||
|
my $output = `/sbin/mdadm -D /dev/$dev | grep Rebuild`;
|
||||||
|
if( $output =~ /([0-9]+)% complete/ )
|
||||||
|
{
|
||||||
|
$rpct = $1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$rcpt = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
print "$dev.value $pct\n";
|
print "$dev.value $pct\n";
|
||||||
|
print $dev, "_rebuild.value $rpct\n";
|
||||||
}
|
}
|
||||||
$text = $';
|
$text = $';
|
||||||
}
|
}
|
||||||
|
@ -63,5 +80,3 @@ if ( $ARGV[0] and $ARGV[0] eq "config" )
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
||||||
# vim:syntax=perl
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue