1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 02:51:03 +00:00

refactoring - replace TAB with 8 spaces, use lexical variable for file handle

* reduce indentation of local($/)
This commit is contained in:
Ken-ichi Mito 2015-05-04 14:56:30 +09:00
parent c4eb877198
commit 2e0acaca2b

View file

@ -29,12 +29,13 @@ if ( $ARGV[0] and $ARGV[0] eq "config" ) {
print "graph_scale no\n";
}
open(my $mdstat, "/proc/mdstat");
my $text;
{
local( $/, *MDSTAT ) ;
open (MDSTAT, "/proc/mdstat") or exit 1;
#open (MDSTAT, "/etc/munin/plugins/sample.failed") or exit 1;
my $text = <MDSTAT>;
close MDSTAT;
local($/);
$text = <$mdstat>;
}
close($mdstat);
# Should look like "active raid1 sda1[0] sdc1[2] sdb1[1]"
# Interestingly, swap is presented as "active (auto-read-only)"
@ -75,7 +76,6 @@ if ( $ARGV[0] and $ARGV[0] eq "config" ) {
}
$text = $';
}
}
exit 0;