dsa-check-statusfile: port to python3
[mirror/dsa-nagios.git] / dsa-nagios-checks / checks / dsa-check-raid-aacraid
index 40e9a25..3e7375b 100755 (executable)
@@ -121,7 +121,7 @@ while ($ctrl <= $numcontrollers) {
                        my $status = $1;
                        if ($status eq 'Not Installed') {
                                next;
-                       } elsif ($status ne 'Optimal') {
+                       } elsif ($status ne 'Optimal' && $status ne 'ZMM Optimal') {
                                record('WARNING');
                        };
                        push @{$status{$status}}, 'Battery';
@@ -139,5 +139,9 @@ while ($ctrl <= $numcontrollers) {
 if ( -e 'UcliEvt.log' ) {
        unlink('UcliEvt.log') or die ("Cannot unlink UcliEvt.log: $!\n");
 }
+
+# Need to chdir out of tempdir in order to rm it in new perl
+chdir ('/') or die ("Cannot chdir /: $!\n");
+
 print "$EXITCODE: ", join(" --- ", @resultstr), "\n";
 exit $CODE{$EXITCODE};