]> git.uio.no Git - check_openmanage.git/blobdiff - check_openmanage
* version 3.5.0-beta18
[check_openmanage.git] / check_openmanage
index ec0c7107b4987f41b8acb180784fc72f706f9476..65aac8fcff08366b749ee11ea5a7b1b914d857f5 100755 (executable)
@@ -56,7 +56,7 @@ if (! isatty(*STDOUT)) {
 
 # Version and similar info
 $NAME    = 'check_openmanage';
-$VERSION = '3.5.0-beta14';
+$VERSION = '3.5.0-beta18';
 $AUTHOR  = 'Trond H. Amundsen';
 $CONTACT = 't.h.amundsen@usit.uio.no';
 
@@ -627,7 +627,7 @@ sub find_omreport {
   OMREPORT_PATH:
     foreach my $bin (@omreport_paths) {
        if (-x $bin) {
-           $omreport = $bin;
+           $omreport = qq{"$bin"};
            last OMREPORT_PATH;
        }
     }
@@ -878,7 +878,7 @@ sub blacklisted {
 
     if (defined $blacklist{$name}) {
        foreach my $comp (@{ $blacklist{$name} }) {
-           if (defined $id and $comp eq $id) {
+           if (defined $id and ($comp eq $id or $comp eq 'ALL')) {
                $ret = 1;
            }
        }
@@ -1612,22 +1612,32 @@ sub check_cache_battery {
 
        # Special case: Charging
        if ($state eq 'Charging') {
+           next BATTERY if blacklisted('bat_charge', $nexus);
            my $msg = sprintf 'Cache battery %d in controller %d is %s (%s) [probably harmless]',
              $id, $ctrl, $state, $pred;
            report('storage', $msg, $E_WARNING, $nexus);
        }
        # Special case: Learning (battery learns its capacity)
        elsif ($state eq 'Learning') {
+           next BATTERY if blacklisted('bat_charge', $nexus);
            my $msg = sprintf 'Cache battery %d in controller %d is %s (%s) [probably harmless]',
              $id, $ctrl, $state, $learn;
            report('storage', $msg, $E_WARNING, $nexus);
        }
        # Special case: Power Low (first part of recharge cycle)
        elsif ($state eq 'Power Low') {
+           next BATTERY if blacklisted('bat_charge', $nexus);
            my $msg = sprintf 'Cache battery %d in controller %d is %s [probably harmless]',
              $id, $ctrl, $state;
            report('storage', $msg, $E_WARNING, $nexus);
        }
+       # Special case: Degraded and Non-Critical (usually part of recharge cycle)
+       elsif ($state eq 'Degraded' && $status eq 'Non-Critical') {
+           next BATTERY if blacklisted('bat_charge', $nexus);
+           my $msg = sprintf 'Cache battery %d in controller %d is %s (%s) [probably harmless]',
+             $id, $ctrl, $state, $status;
+           report('storage', $msg, $E_WARNING, $nexus);
+       }
        # Default
        elsif ($status ne 'Ok') {
            my $msg = sprintf 'Cache battery %d in controller %d needs attention: %s (%s)',
@@ -3128,7 +3138,7 @@ sub check_pwrmonitoring {
            $max_crit =~ s{\A (\d+.*?)\s+[a-zA-Z]+ \s*\z}{$1}xms;
        }
 
-       next AMP if blacklisted('pm', $index);
+       next AMP if blacklisted('amp', $index);
        next AMP if $index !~ m{\A \d+ \z}xms;
        $count{amp}++;