[nagiosplug] contrib/check_linux_raid.pl: Fix whitespace errors
"Nagios Plugin Development" <[email protected]> Sat, 17 Aug 2013 22:50:24 +0000
| Newsgroups | gmane.network.nagios.plugins.cvs |
|---|---|
| Message-ID | <[email protected]> |
Module: nagiosplug Branch: master Commit: f73e9f7b22f9e0992ea43ad1ded87d781aef43e0 Author: Holger Weiss <[email protected]> Date: Sun Aug 18 00:47:21 2013 +0200 URL: http://nagiosplug.git.sf.net/git/gitweb.cgi?p=nagiosplug/nagiosplug;a=commit;h=f73e9f7 contrib/check_linux_raid.pl: Fix whitespace errors Use tabs instead of spaces for indentation. --- contrib/check_linux_raid.pl | 29 ++++++++++++++--------------- 1 files changed, 14 insertions(+), 15 deletions(-) diff --git a/contrib/check_linux_raid.pl b/contrib/check_linux_raid.pl index 73e7fd2..6650a42 100644 --- a/contrib/check_linux_raid.pl +++ b/contrib/check_linux_raid.pl @@ -28,8 +28,8 @@ use utils qw(%ERRORS); # die with an error if we're not on Linux if ($^O ne 'linux') { - print "This plugin only applicable on Linux.\n"; - exit $ERRORS{'UNKNOWN'}; + print "This plugin only applicable on Linux.\n"; + exit $ERRORS{'UNKNOWN'}; } sub max_state($$){ @@ -66,10 +66,10 @@ while(defined $nextdev){ $recovery{$device} = $1; ($finish{$device}) = /finish=(.*?min)/; $device=undef; - } elsif (/resync =\s+(.*?)\s/) { - $resyncing{$device} = $1; - ($finish{$device}) = /finish=(.*?min)/; - $device=undef; + } elsif (/resync =\s+(.*?)\s/) { + $resyncing{$device} = $1; + ($finish{$device}) = /finish=(.*?min)/; + $device=undef; } elsif (/^\s*$/) { $device=undef; } @@ -100,14 +100,14 @@ foreach my $k (sort keys %devices){ $code = max_state($code, "CRITICAL"); } } elsif ($status{$k} =~ /U+/) { - if (defined $resyncing{$k}) { - $msg .= sprintf " %s status=%s, resync=%s, finish=%s.", - $devices{$k}, $status{$k}, $resyncing{$k}, $finish{$k}; - $code = max_state($code, "WARNING"); - } else { - $msg .= sprintf " %s status=%s.", $devices{$k}, $status{$k}; - $code = max_state($code, "OK"); - } + if (defined $resyncing{$k}) { + $msg .= sprintf " %s status=%s, resync=%s, finish=%s.", + $devices{$k}, $status{$k}, $resyncing{$k}, $finish{$k}; + $code = max_state($code, "WARNING"); + } else { + $msg .= sprintf " %s status=%s.", $devices{$k}, $status{$k}; + $code = max_state($code, "OK"); + } } else { if ($active{$k}) { $msg .= sprintf " %s active with no status information.", @@ -123,4 +123,3 @@ foreach my $k (sort keys %devices){ print $code, $msg, "\n"; exit ($ERRORS{$code}); - ------------------------------------------------------------------------------ Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk