projects
/
mirror
/
dsa-nagios.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
old jerea is gone, new jerea lives
[mirror/dsa-nagios.git]
/
dsa-nagios-checks
/
checks
/
dsa-check-raid-megactl
diff --git
a/dsa-nagios-checks/checks/dsa-check-raid-megactl
b/dsa-nagios-checks/checks/dsa-check-raid-megactl
index
ae7a78c
..
2443f24
100755
(executable)
--- a/
dsa-nagios-checks/checks/dsa-check-raid-megactl
+++ b/
dsa-nagios-checks/checks/dsa-check-raid-megactl
@@
-10,6
+10,10
@@
my @ok;
my @cmd = ('sudo', 'megactl', '-Hv', '2>&1');
my @output = `@cmd`;
my @cmd = ('sudo', 'megactl', '-Hv', '2>&1');
my @output = `@cmd`;
+if ($? != 0) {
+ print "WARNING: Exec failed!\n";
+ exit 2;
+}
for my $line (@output) {
if ($line =~ /^(\w+)\s+/) {
for my $line (@output) {
if ($line =~ /^(\w+)\s+/) {
@@
-87,12
+91,12
@@
if (@errs) {
print "CRITICAL: ";
print @errs;
print "\n";
print "CRITICAL: ";
print @errs;
print "\n";
- exit
1
;
+ exit
2
;
} elsif (@warn) {
print "WARNING: ";
print @warn;
print "\n";
} elsif (@warn) {
print "WARNING: ";
print @warn;
print "\n";
- exit
2
;
+ exit
1
;
}
unless (@ok) {
push @ok, "All devices OK";
}
unless (@ok) {
push @ok, "All devices OK";