]> git.uio.no Git - check_openmanage.git/blobdiff - check_openmanage
* version 3.5.0-beta18
[check_openmanage.git] / check_openmanage
index 73b405baa52221e2c54e8f0dada9d4c284e98679..65aac8fcff08366b749ee11ea5a7b1b914d857f5 100755 (executable)
@@ -49,13 +49,14 @@ use vars qw( $NAME $VERSION $AUTHOR $CONTACT $E_OK $E_WARNING $E_CRITICAL
 # If we don't have a TTY, the plugin is probably run by Nagios. In
 # that case, redirect all output to STDERR to STDOUT. Nagios ignores
 # output to STDERR.
-if (! isatty *STDOUT) {
-    open STDERR, '>&', 'STDOUT';
+if (! isatty(*STDOUT)) {
+    open STDERR, '>&', 'STDOUT'
+      or do { print "ERROR: Couldn't redirect STDERR to STDOUT\n"; exit 2; }
 }
 
 # Version and similar info
 $NAME    = 'check_openmanage';
-$VERSION = '3.5.0-beta9';
+$VERSION = '3.5.0-beta18';
 $AUTHOR  = 'Trond H. Amundsen';
 $CONTACT = 't.h.amundsen@usit.uio.no';
 
@@ -144,6 +145,7 @@ END_LICENSE
         'version'           => 0,
          'all'               => 0,
         'only'              => undef,
+        'omreport'          => undef,
         'port'              => 161, # default SNMP port
         'hostname'          => undef,
         'community'         => 'public',  # SMNP v1 or v2c
@@ -177,6 +179,7 @@ GetOptions('b|blacklist=s'      => \@{ $opt{blacklist} },
           'l|linebreak=s'      => \$opt{linebreak},
           'a|all'              => \$opt{all},
           'only=s'             => \$opt{only},
+          'omreport=s'         => \$opt{omreport},
           'port=i'             => \$opt{port},
           'H|hostname=s'       => \$opt{hostname},
           'C|community=s'      => \$opt{community},
@@ -602,21 +605,29 @@ sub snmp_detect_blade {
 # Locate the omreport binary
 #
 sub find_omreport {
+    # If user has specified path to omreport
+    if (defined $opt{omreport} and -x $opt{omreport}) {
+       $omreport = $opt{omreport};
+       return;
+    }
+
     # Possible full paths for omreport
     my @omreport_paths
       = (
         '/usr/bin/omreport',                            # default on Linux
         '/opt/dell/srvadmin/oma/bin/omreport.sh',       # alternate on Linux
         '/opt/dell/srvadmin/oma/bin/omreport',          # alternate on Linux
-        'c:\progra~1\dell\sysmgt\oma\bin\omreport.exe', # default on Windows
-        'c:\progra~2\dell\sysmgt\oma\bin\omreport.exe', # default on Windows x64
+        'C:\Program Files (x86)\Dell\SysMgt\oma\bin\omreport.exe', # default on Windows x64
+        'C:\Program Files\Dell\SysMgt\oma\bin\omreport.exe',       # default on Windows x32
+        'c:\progra~1\dell\sysmgt\oma\bin\omreport.exe', # 8bit legacy default on Windows x32
+        'c:\progra~2\dell\sysmgt\oma\bin\omreport.exe', # 8bit legacy default on Windows x64
        );
 
     # Find the one to use
   OMREPORT_PATH:
     foreach my $bin (@omreport_paths) {
        if (-x $bin) {
-           $omreport = $bin;
+           $omreport = qq{"$bin"};
            last OMREPORT_PATH;
        }
     }
@@ -867,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;
            }
        }
@@ -1052,7 +1063,7 @@ sub check_global {
        my $systemStateGlobalSystemStatus = '1.3.6.1.4.1.674.10892.1.200.10.1.2.1';
        my $result = $snmp_session->get_request(-varbindlist => [$systemStateGlobalSystemStatus]);
        if (!defined $result) {
-           printf "SNMP [systemStateGlobalSystemStatus]: %s\n", $snmp_error;
+           printf "SNMP ERROR [global]: %s\n", $snmp_error;
            exit $E_UNKNOWN;
        }
        $health = $status2nagios{$snmp_status{$result->{$systemStateGlobalSystemStatus}}};
@@ -1177,27 +1188,27 @@ sub check_controllers {
        # Special case: old firmware
        if (!blacklisted('ctrl_fw', $id) && defined $minfw) {
            chomp $firmware;
-           my $msg = sprintf q{Controller %d (%s): Firmware '%s' is out of date},
+           my $msg = sprintf q{Controller %d [%s]: Firmware '%s' is out of date},
              $id, $name, $firmware;
            report('storage', $msg, $E_WARNING, $nexus);
        }
        # Special case: old driver
        if (!blacklisted('ctrl_driver', $id) && defined $mindr) {
            chomp $driver;
-           my $msg = sprintf q{Controller %d (%s): Driver '%s' is out of date},
+           my $msg = sprintf q{Controller %d [%s]: Driver '%s' is out of date},
              $id, $name, $driver;
            report('storage', $msg, $E_WARNING, $nexus);
        }
        # Ok
        if ($status eq 'Ok' or ($status eq 'Non-Critical'
                                and (defined $minfw or defined $mindr))) {
-           my $msg = sprintf 'Controller %d (%s) is %s',
+           my $msg = sprintf 'Controller %d [%s] is %s',
              $id, $name, $state;
            report('storage', $msg, $E_OK, $nexus);
        }
         # Default
        else {
-           my $msg = sprintf 'Controller %d (%s) needs attention: %s',
+           my $msg = sprintf 'Controller %d [%s] needs attention: %s',
              $id, $name, $state;
            report('storage', $msg, $status2nagios{$status}, $nexus);
        }
@@ -1247,7 +1258,7 @@ sub check_physical_disks {
        my $result = $snmp_session->get_entries(-columns => [keys %pdisk_oid]);
 
        if (!defined $result) {
-           printf "SNMP [storage / pdisk]: %s.\n", $snmp_session->error;
+           printf "SNMP ERROR [storage / pdisk]: %s.\n", $snmp_session->error;
            $snmp_session->close;
            exit $E_UNKNOWN;
        }
@@ -1345,25 +1356,25 @@ sub check_physical_disks {
 
        # Special case: Failure predicted
        if ($status eq 'Non-Critical' and $fpred) {
-           my $msg = sprintf '%s (%s %s, %s) on controller %d needs attention: Failure Predicted',
+           my $msg = sprintf '%s [%s %s, %s] on ctrl %d needs attention: Failure Predicted',
              $name, $vendor, $product, $capacity, $ctrl;
            report('storage', $msg, $E_WARNING, $nexus);
        }
        # Special case: Rebuilding
        elsif ($state eq 'Rebuilding') {
-           my $msg = sprintf '%s (%s) on controller %d is %s%s',
+           my $msg = sprintf '%s [%s] on ctrl %d is %s%s',
              $name, $capacity, $ctrl, $state, $progr;
            report('storage', $msg, $E_WARNING, $nexus);
        }
        # Default
        elsif ($status ne 'Ok') {
-           my $msg =  sprintf '%s (%s %s, %s) on controller %d needs attention: %s',
+           my $msg =  sprintf '%s [%s %s, %s] on ctrl %d needs attention: %s',
              $name, $vendor, $product, $capacity, $ctrl, $state;
            report('storage', $msg, $status2nagios{$status}, $nexus);
        }
        # Ok
        else {
-           my $msg = sprintf '%s (%s) on controller %d is %s',
+           my $msg = sprintf '%s [%s] on ctrl %d is %s',
              $name, $capacity, $ctrl, $state;
            report('storage', $msg, $E_OK, $nexus);
        }
@@ -1379,6 +1390,7 @@ sub check_virtual_disks {
     return if $#controllers == -1;
 
     my $id     = undef;
+    my $name   = undef;
     my $nexus  = undef;
     my $dev    = undef;
     my $state  = undef;
@@ -1386,17 +1398,17 @@ sub check_virtual_disks {
     my $layout = undef;
     my $size   = undef;
     my $progr  = undef;
+    my $ctrl   = undef;
     my @output = ();
 
     if ($snmp) {
        my %vdisk_oid
          = (
-            '1.3.6.1.4.1.674.10893.1.20.140.1.1.1'  => 'virtualDiskNumber',
-            '1.3.6.1.4.1.674.10893.1.20.140.1.1.2'  => 'virtualDiskName',
             '1.3.6.1.4.1.674.10893.1.20.140.1.1.3'  => 'virtualDiskDeviceName',
             '1.3.6.1.4.1.674.10893.1.20.140.1.1.4'  => 'virtualDiskState',
             '1.3.6.1.4.1.674.10893.1.20.140.1.1.6'  => 'virtualDiskLengthInMB',
             '1.3.6.1.4.1.674.10893.1.20.140.1.1.13' => 'virtualDiskLayout',
+            '1.3.6.1.4.1.674.10893.1.20.140.1.1.17' => 'virtualDiskTargetID',
             '1.3.6.1.4.1.674.10893.1.20.140.1.1.20' => 'virtualDiskComponentStatus',
             '1.3.6.1.4.1.674.10893.1.20.140.1.1.21' => 'virtualDiskNexusID',
            );
@@ -1451,7 +1463,7 @@ sub check_virtual_disks {
   VDISK:
     foreach my $out (@output) {
        if ($snmp) {
-           $id     = $out->{virtualDiskNumber} - 1;
+           $id     = $out->{virtualDiskTargetID};
            $dev    = $out->{virtualDiskDeviceName};
            $state  = $vdisk_state{$out->{virtualDiskState}};
            $status = $snmp_status{$out->{virtualDiskComponentStatus}};
@@ -1459,6 +1471,8 @@ sub check_virtual_disks {
            $size   = sprintf '%.2f GB', $out->{virtualDiskLengthInMB} / 1024;
            $progr  = q{};  # can't get this from SNMP(?)
            $nexus  = convert_nexus($out->{virtualDiskNexusID});
+           $ctrl   = $nexus;  # We use the nexus id to get the controller id
+           $ctrl   =~ s{\A (\d+):\d+ \z}{$1}xms;
        }
        else {
            $id     = $out->{ID};
@@ -1470,6 +1484,7 @@ sub check_virtual_disks {
            $progr  = ' [' . $out->{Progress} . ']';
            $size   =~ s{\A (.*GB).* \z}{$1}xms;
            $nexus  = join q{:}, $out->{ctrl}, $id;
+           $ctrl   = $out->{ctrl};
        }
 
        next VDISK if blacklisted('vdisk', $nexus);
@@ -1477,20 +1492,20 @@ sub check_virtual_disks {
 
        # Special case: Regenerating
        if ($state eq 'Regenerating') {
-           my $msg = sprintf 'Logical drive %d "%s" (%s, %s) is %s%s',
-             $id, $dev, $layout, $size, $state, $progr;
+           my $msg = sprintf q{Logical drive %d '%s' [%s, %s] on ctrl %d is %s%s},
+             $id, $dev, $layout, $size, $ctrl, $state, $progr;
            report('storage', $msg, $E_WARNING, $nexus);
        }
        # Default
        elsif ($status ne 'Ok') {
-           my $msg = sprintf 'Logical drive %d "%s" (%s, %s) needs attention: %s',
-             $id, $dev, $layout, $size, $state;
+           my $msg = sprintf q{Logical drive %d '%s' [%s, %s] on ctrl %d needs attention: %s},
+             $id, $dev, $layout, $size, $ctrl, $state;
            report('storage', $msg, $status2nagios{$status}, $nexus);
        }
        # Ok
        else {
-           my $msg = sprintf 'Logical drive %d "%s" (%s, %s) is %s',
-             $id, $dev, $layout, $size, $state;
+           my $msg = sprintf q{Logical drive %d '%s' [%s, %s] on ctrl %d is %s},
+             $id, $dev, $layout, $size, $ctrl, $state;
            report('storage', $msg, $E_OK, $nexus);
        }
     }
@@ -1516,8 +1531,6 @@ sub check_cache_battery {
     if ($snmp) {
        my %bat_oid
          = (
-            '1.3.6.1.4.1.674.10893.1.20.130.15.1.1'  => 'batteryNumber',
-            '1.3.6.1.4.1.674.10893.1.20.130.15.1.2'  => 'batteryName',
             '1.3.6.1.4.1.674.10893.1.20.130.15.1.4'  => 'batteryState',
             '1.3.6.1.4.1.674.10893.1.20.130.15.1.6'  => 'batteryComponentStatus',
             '1.3.6.1.4.1.674.10893.1.20.130.15.1.9'  => 'batteryNexusID',
@@ -1574,7 +1587,6 @@ sub check_cache_battery {
   BATTERY:
     foreach my $out (@output) {
        if ($snmp) {
-           $id     = $out->{batteryNumber} - 1;
            $state  = $bat_state{$out->{batteryState}};
            $status = $snmp_status{$out->{batteryComponentStatus}};
            $learn  = exists $out->{batteryLearnState}
@@ -1583,6 +1595,8 @@ sub check_cache_battery {
              ? $bat_pred_cap{$out->{batteryPredictedCapacity}} : undef;
            $ctrl   = $out->{batteryConnectionControllerNumber} - 1;
            $nexus  = convert_nexus($out->{batteryNexusID});
+           $id     = $nexus;
+           $id     =~ s{\A \d+:(\d+) \z}{$1}xms;
        }
        else {
            $id     = $out->{'ID'};
@@ -1598,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)',
@@ -1659,7 +1683,7 @@ sub check_connectors {
         my $result = $snmp_session->get_entries(-columns => [keys %conn_oid]);
 
         if (!defined $result) {
-            printf "SNMP [storage / channel]: %s.\n", $snmp_session->error;
+            printf "SNMP ERROR [storage / channel]: %s.\n", $snmp_session->error;
             $snmp_session->close;
             exit $E_UNKNOWN;
         }
@@ -1719,7 +1743,7 @@ sub check_connectors {
 
         next CHANNEL if blacklisted('conn', $nexus);
 
-       my $msg = sprintf '%s (%s) on controller %d is %s',
+       my $msg = sprintf '%s [%s] on controller %d is %s',
          $name, $type, $ctrl, $state;
         report('storage', $msg, $status2nagios{$status}, $nexus);
     }
@@ -1737,6 +1761,7 @@ sub check_enclosures {
     my $state    = undef;
     my $status   = undef;
     my $firmware = undef;
+    my $ctrl     = undef;
     my @output   = ();
 
     if ($snmp) {
@@ -1784,6 +1809,8 @@ sub check_enclosures {
            $firmware = exists $out->{enclosureFirmwareVersion}
              ? $out->{enclosureFirmwareVersion} : 'N/A';
            $nexus    = convert_nexus($out->{enclosureNexusID});
+           $ctrl     = $nexus;
+           $ctrl     =~ s{\A (\d+):.* \z}{$1}xms;
         }
         else {
             $id       = $out->{ID};
@@ -1793,6 +1820,7 @@ sub check_enclosures {
            $firmware = $out->{'Firmware Version'} ne 'Not Applicable'
              ? $out->{'Firmware Version'} : 'N/A';
            $nexus    = join q{:}, $out->{ctrl}, $id;
+           $ctrl     = $out->{ctrl};
         }
 
         $name     =~ s{\s+\z}{}xms; # remove trailing whitespace
@@ -1810,8 +1838,8 @@ sub check_enclosures {
 
         next ENCLOSURE if blacklisted('encl', $nexus);
 
-       my $msg = sprintf 'Enclosure %s (%s) is %s',
-         $nexus, $name, $state;
+       my $msg = sprintf 'Enclosure %s [%s] on controller %d is %s',
+         $nexus, $name, $ctrl, $state;
         report('storage', $msg, $status2nagios{$status}, $nexus);
     }
     return;
@@ -1902,13 +1930,13 @@ sub check_enclosure_fans {
 
        # Default
        if ($status ne 'Ok') {
-           my $msg = sprintf '%s in enclosure %s (%s) needs attention: %s',
+           my $msg = sprintf '%s in enclosure %s [%s] needs attention: %s',
              $name, $encl_id, $encl_name, $state;
            report('storage', $msg, $status2nagios{$status}, $nexus);
        }
        # Ok
        else {
-           my $msg = sprintf '%s in enclosure %s (%s) is %s (speed=%s)',
+           my $msg = sprintf '%s in enclosure %s [%s] is %s (speed=%s)',
              $name, $encl_id, $encl_name, $state, $speed;
            report('storage', $msg, $E_OK, $nexus);
        }
@@ -1996,13 +2024,13 @@ sub check_enclosure_pwr {
 
        # Default
        if ($status ne 'Ok') {
-           my $msg = sprintf '%s in enclosure %s (%s) needs attention: %s',
+           my $msg = sprintf '%s in enclosure %s [%s] needs attention: %s',
              $name, $encl_id, $encl_name, $state;
            report('storage', $msg, $status2nagios{$status}, $nexus);
        }
        # Ok
        else {
-           my $msg = sprintf '%s in enclosure %s (%s) is %s',
+           my $msg = sprintf '%s in enclosure %s [%s] is %s',
              $name, $encl_id, $encl_name, $state;
            report('storage', $msg, $E_OK, $nexus);
        }
@@ -2106,13 +2134,13 @@ sub check_enclosure_temp {
 
        # Default
        if ($status ne 'Ok') {
-           my $msg = sprintf '%s in enclosure %s (%s) is %s at %s (%s max)',
+           my $msg = sprintf '%s in enclosure %s [%s] is %s C at %s (%s max)',
              $name, $encl_id, $encl_name, $state, $reading, $max_crit;
            report('storage', $msg, $status2nagios{$status}, $nexus);
        }
        # Ok
        else {
-           my $msg = sprintf '%s in enclosure %s (%s): %s (%s max)',
+           my $msg = sprintf '%s in enclosure %s [%s]: %s C (%s max)',
              $name, $encl_id, $encl_name, $reading, $max_crit;
            report('storage', $msg, $E_OK, $nexus);
        }
@@ -2209,13 +2237,13 @@ sub check_enclosure_emms {
 
        # Default
        if ($status ne 'Ok') {
-           my $msg = sprintf '%s in enclosure %s (%s) needs attention: %s',
+           my $msg = sprintf '%s in enclosure %s [%s] needs attention: %s',
              $name, $encl_id, $encl_name, $state;
            report('storage', $msg, $status2nagios{$status}, $nexus);
        }
        # Ok
        else {
-           my $msg = sprintf '%s in enclosure %s (%s) is %s',
+           my $msg = sprintf '%s in enclosure %s [%s] is %s',
              $name, $encl_id, $encl_name, $state;
            report('storage', $msg, $E_OK, $nexus);
        }
@@ -2248,7 +2276,7 @@ sub check_memory {
        my $result = $snmp_session->get_entries(-columns => [keys %dimm_oid]);
 
        if (!defined $result) {
-           printf "SNMP [memory]: %s.\n", $snmp_session->error;
+           printf "SNMP ERROR [memory]: %s.\n", $snmp_session->error;
            $snmp_session->close;
            exit $E_UNKNOWN;
        }
@@ -2314,11 +2342,11 @@ sub check_memory {
        if ($status ne 'Ok') {
            my $msg = undef;
            if (scalar @failures == 0) {
-               $msg = sprintf 'Memory module %d (%s, %s) needs attention (%s)',
+               $msg = sprintf 'Memory module %d [%s, %s] needs attention (%s)',
                  $index, $location, $size, $status;
            }
            else {
-               $msg = sprintf 'Memory module %d (%s, %s) needs attention: %s',
+               $msg = sprintf 'Memory module %d [%s, %s] needs attention: %s',
                  $index, $location, $size, (join q{, }, @failures);
            }
 
@@ -2326,7 +2354,7 @@ sub check_memory {
        }
        # Ok
        else {
-           my $msg = sprintf 'Memory module %d (%s, %s) is %s',
+           my $msg = sprintf 'Memory module %d [%s, %s] is %s',
              $index, $location, $size, $status;
            report('chassis', $msg, $E_OK, $index);
        }
@@ -2363,7 +2391,7 @@ sub check_fans {
            return 0;
        }
        elsif (!$blade && !defined $result) {
-           printf "SNMP [cooling]: %s.\n", $snmp_session->error;
+           printf "SNMP ERROR [cooling]: %s.\n", $snmp_session->error;
            $snmp_session->close;
            exit $E_UNKNOWN;
        }
@@ -2404,13 +2432,13 @@ sub check_fans {
        $count{fan}++;
 
        if ($status ne 'Ok') {
-           my $msg = sprintf 'Chassis fan %d (%s) needs attention: %s',
+           my $msg = sprintf 'Chassis fan %d [%s] needs attention: %s',
              $index, $location, $status;
            my $err = $snmp ? $probestatus2nagios{$status} : $status2nagios{$status};
            report('chassis', $msg, $err, $index);
        }
        else {
-           my $msg = sprintf 'Chassis fan %d (%s): %s',
+           my $msg = sprintf 'Chassis fan %d [%s]: %s',
              $index, $location, $reading;
            report('chassis', $msg, $E_OK, $index);
        }
@@ -2531,12 +2559,12 @@ sub check_powersupplies {
        $count{power}++;
 
        if ($status ne 'Ok') {
-           my $msg = sprintf 'Power Supply %d (%s) needs attention: %s',
+           my $msg = sprintf 'Power Supply %d [%s] needs attention: %s',
              $index, $type, $state;
            report('chassis', $msg, $status2nagios{$status}, $index);
        }
        else {
-           my $msg = sprintf 'Power Supply %d (%s): %s',
+           my $msg = sprintf 'Power Supply %d [%s]: %s',
              $index, $type, $state;
            report('chassis', $msg, $E_OK, $index);
        }
@@ -2587,7 +2615,7 @@ sub check_temperatures {
        my $result = $snmp_session->get_table(-baseoid => $temperatureProbeTable);
 
        if (!defined $result) {
-           printf "SNMP [temperatures]: %s.\n", $snmp_session->error;
+           printf "SNMP ERROR [temperatures]: %s.\n", $snmp_session->error;
            $snmp_session->close;
            exit $E_UNKNOWN;
        }
@@ -2649,56 +2677,63 @@ sub check_temperatures {
            # First check according to custom thresholds
            if (exists $crit_threshold{$index}{max} and $reading > $crit_threshold{$index}{max}) {
                # Custom critical MAX
-               my $msg = sprintf 'Temperature Probe %d (%s) reads %d C (custom max=%d)',
+               my $msg = sprintf 'Temperature Probe %d [%s] reads %d C (custom max=%d)',
                  $index, $location, $reading, $crit_threshold{$index}{max};
                report('chassis', $msg, $E_CRITICAL, $index);
            }
            elsif (exists $warn_threshold{$index}{max} and $reading > $warn_threshold{$index}{max}) {
                # Custom warning MAX
-               my $msg = sprintf 'Temperature Probe %d (%s) reads %d C (custom max=%d)',
+               my $msg = sprintf 'Temperature Probe %d [%s] reads %d C (custom max=%d)',
                  $index, $location, $reading, $warn_threshold{$index}{max};
                report('chassis', $msg, $E_WARNING, $index);
            }
            elsif (exists $crit_threshold{$index}{min} and $reading < $crit_threshold{$index}{min}) {
                # Custom critical MIN
-               my $msg = sprintf 'Temperature Probe %d (%s) reads %d C (custom min=%d)',
+               my $msg = sprintf 'Temperature Probe %d [%s] reads %d C (custom min=%d)',
                  $index, $location, $reading, $crit_threshold{$index}{min};
                report('chassis', $msg, $E_CRITICAL, $index);
            }
            elsif (exists $warn_threshold{$index}{min} and $reading < $warn_threshold{$index}{min}) {
                # Custom warning MIN
-               my $msg = sprintf 'Temperature Probe %d (%s) reads %d C (custom min=%d)',
+               my $msg = sprintf 'Temperature Probe %d [%s] reads %d C (custom min=%d)',
                  $index, $location, $reading, $warn_threshold{$index}{min};
                report('chassis', $msg, $E_WARNING, $index);
            }
            elsif ($status ne 'Ok' and $max_crit ne '[N/A]' and $reading > $max_crit) {
-               my $msg = sprintf 'Temperature Probe %d (%s) is critically high at %d C',
+               my $msg = sprintf 'Temperature Probe %d [%s] is critically high at %d C',
                  $index, $location, $reading;
                my $err = $snmp ? $probestatus2nagios{$status} : $status2nagios{$status};
                report('chassis', $msg, $err, $index);
            }
            elsif ($status ne 'Ok' and $max_warn ne '[N/A]' and $reading > $max_warn) {
-               my $msg = sprintf 'Temperature Probe %d (%s) is too high at %d C',
+               my $msg = sprintf 'Temperature Probe %d [%s] is too high at %d C',
                  $index, $location, $reading;
                my $err = $snmp ? $probestatus2nagios{$status} : $status2nagios{$status};
                report('chassis', $msg, $err, $index);
            }
            elsif ($status ne 'Ok' and $min_crit ne '[N/A]' and $reading < $min_crit) {
-               my $msg = sprintf 'Temperature Probe %d (%s) is critically low at %d C',
+               my $msg = sprintf 'Temperature Probe %d [%s] is critically low at %d C',
                  $index, $location, $reading;
                my $err = $snmp ? $probestatus2nagios{$status} : $status2nagios{$status};
                report('chassis', $msg, $err, $index);
            }
            elsif ($status ne 'Ok' and $min_warn ne '[N/A]' and $reading < $min_warn) {
-               my $msg = sprintf 'Temperature Probe %d (%s) is too low at %d C',
+               my $msg = sprintf 'Temperature Probe %d [%s] is too low at %d C',
                  $index, $location, $reading;
                my $err = $snmp ? $probestatus2nagios{$status} : $status2nagios{$status};
                report('chassis', $msg, $err, $index);
            }
            # Ok
            else {
-               my $msg = sprintf 'Temperature Probe %d (%s) reads %d C (min=%s/%s, max=%s/%s)',
-                 $index, $location, $reading, $min_warn, $min_crit, $max_warn, $max_crit;
+               my $msg = sprintf 'Temperature Probe %d [%s] reads %d C',
+                 $index, $location, $reading;
+               if ($min_warn eq '[N/A]' and $min_crit eq '[N/A]') {
+                   $msg .= sprintf ' (max=%s/%s)', $max_warn, $max_crit;
+               }
+               else {
+                   $msg .= sprintf ' (min=%s/%s, max=%s/%s)',
+                     $min_warn, $min_crit, $max_warn, $max_crit;
+               }                   
                my $err = $snmp ? $probestatus2nagios{$status} : $status2nagios{$status};
                report('chassis', $msg, $err, $index);
            }
@@ -2758,7 +2793,7 @@ sub check_processors {
        }
 
        if (!defined $result) {
-           printf "SNMP [processors]: %s.\n", $snmp_session->error;
+           printf "SNMP ERROR [processors]: %s.\n", $snmp_session->error;
            $snmp_session->close;
            exit $E_UNKNOWN;
        }
@@ -2882,7 +2917,7 @@ sub check_volts {
         my $result = $snmp_session->get_table(-baseoid => $voltageProbeTable);
 
        if (!defined $result) {
-           printf "SNMP [voltage probes]: %s.\n", $snmp_session->error;
+           printf "SNMP ERROR [voltage]: %s.\n", $snmp_session->error;
            $snmp_session->close;
            exit $E_UNKNOWN;
        }
@@ -2919,7 +2954,7 @@ sub check_volts {
        next VOLT if blacklisted('volt', $index);
        $count{volt}++;
 
-       my $msg = sprintf 'Voltage sensor %d (%s) is %s',
+       my $msg = sprintf 'Voltage sensor %d [%s] is %s',
          $index, $location, $reading;
        my $err = $snmp ? $probestatus2nagios{$status} : $status2nagios{$status};
        report('chassis', $msg, $err, $index);
@@ -2982,7 +3017,7 @@ sub check_batteries {
        next BATTERY if blacklisted('bp', $index);
        $count{bat}++;
 
-       my $msg = sprintf 'Battery probe %d (%s) is %s',
+       my $msg = sprintf 'Battery probe %d [%s] is %s',
          $index, $location, $reading;
        report('chassis', $msg, $status2nagios{$status}, $index);
     }
@@ -3103,11 +3138,11 @@ 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}++;
 
-       my $msg = sprintf 'Amperage probe %d (%s) reads %s %s',
+       my $msg = sprintf 'Amperage probe %d [%s] reads %s %s',
          $index, $location, $reading, $unit, $status;
        report('chassis', $msg, $status2nagios{$status}, $index);
 
@@ -3266,7 +3301,7 @@ sub check_esmlog_health {
        my $systemStateEventLogStatus = '1.3.6.1.4.1.674.10892.1.200.10.1.41.1';
        my $result = $snmp_session->get_request(-varbindlist => [$systemStateEventLogStatus]);
        if (!defined $result) {
-           my $msg = sprintf 'SNMP ERROR getting systemStateEventLogStatus OID: %s',
+           my $msg = sprintf 'SNMP ERROR [esmhealth]: %s',
              $snmp_session->error;
            report('other', $msg, $E_UNKNOWN);
        }
@@ -3286,11 +3321,11 @@ sub check_esmlog_health {
     # fill grade of the log is more than 80% and the log should be
     # cleared
     if ($health eq 'Ok') {
-       my $msg = sprintf 'ESM log is health is OK (less than 80%% full)';
+       my $msg = sprintf 'ESM log health is Ok (less than 80%% full)';
        report('other', $msg, $E_OK);
     }
     elsif ($health eq 'Critical') {
-       my $msg = sprintf 'ESM log is 100%% full!';
+       my $msg = sprintf 'ESM log is 100%% full';
        report('other', $msg, $status2nagios{$health});
     }
     else {