1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-09-19 00:53:19 +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"; print "graph_scale no\n";
} }
open(my $mdstat, "/proc/mdstat");
my $text;
{ {
local( $/, *MDSTAT ) ; local($/);
open (MDSTAT, "/proc/mdstat") or exit 1; $text = <$mdstat>;
#open (MDSTAT, "/etc/munin/plugins/sample.failed") or exit 1; }
my $text = <MDSTAT>; close($mdstat);
close MDSTAT;
# Should look like "active raid1 sda1[0] sdc1[2] sdb1[1]" # Should look like "active raid1 sda1[0] sdc1[2] sdb1[1]"
# Interestingly, swap is presented as "active (auto-read-only)" # Interestingly, swap is presented as "active (auto-read-only)"
@ -75,7 +76,6 @@ if ( $ARGV[0] and $ARGV[0] eq "config" ) {
} }
$text = $'; $text = $';
} }
}
exit 0; exit 0;