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:
parent
c4eb877198
commit
2e0acaca2b
1 changed files with 46 additions and 46 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue