]> git.uio.no Git - check_openmanage.git/commitdiff
Raise a warning if a physical drive is uncertified
authortrondham <trondham@e53b7cee-c147-0410-b3a0-ae4c1fa63963>
Mon, 14 Feb 2011 15:00:22 +0000 (15:00 +0000)
committertrondham <trondham@e53b7cee-c147-0410-b3a0-ae4c1fa63963>
Mon, 14 Feb 2011 15:00:22 +0000 (15:00 +0000)
git-svn-id: svn+ssh://vcs-usit.uio.no/svnroot/usit-unix-intern/trunk/usit-nagios-plugins/trondham/check_openmanage@19414 e53b7cee-c147-0410-b3a0-ae4c1fa63963

check_openmanage

index f3698df695541cc204618a71d92641f0d8b2c810..65be4dfea97bd104219418a667646010e3a83735 100755 (executable)
@@ -1333,6 +1333,7 @@ sub check_physical_disks {
     my $media    = undef;  # media type (e.g. HDD, SSD)
     my $bus      = undef;  # bus protocol (e.g. SAS, SATA)
     my $spare    = undef;  # spare state (e.g. global hotspare)
+    my $cert     = undef;  # if drive is certified or not
     my @output  = ();
 
     if ($snmp) {
@@ -1352,6 +1353,7 @@ sub check_physical_disks {
             '1.3.6.1.4.1.674.10893.1.20.130.4.1.26' => 'arrayDiskNexusID',
             '1.3.6.1.4.1.674.10893.1.20.130.4.1.31' => 'arrayDiskSmartAlertIndication',
             '1.3.6.1.4.1.674.10893.1.20.130.4.1.35' => 'arrayDiskMediaType',
+            '1.3.6.1.4.1.674.10893.1.20.130.4.1.36' => 'arrayDiskDellCertified',
             '1.3.6.1.4.1.674.10893.1.20.130.5.1.7'  => 'arrayDiskEnclosureConnectionControllerNumber',
             '1.3.6.1.4.1.674.10893.1.20.130.6.1.7'  => 'arrayDiskChannelConnectionControllerNumber',
            );
@@ -1461,6 +1463,7 @@ sub check_physical_disks {
            $spare    = get_hashval($out->{arrayDiskSpareState}, \%spare_state) || q{};
            $bus      = get_hashval($out->{arrayDiskBusType}, \%bus_type);
            $media    = get_hashval($out->{arrayDiskMediaType}, \%media_type);
+           $cert     = $out->{arrayDiskDellCertified} || 1;
            $capacity = exists $out->{arrayDiskLengthInMB}
              ? $out->{arrayDiskLengthInMB} * 1024**2 : -1;
 
@@ -1491,12 +1494,19 @@ sub check_physical_disks {
            $media    = get_nonempty_string('Media', $out, undef);
            $bus      = get_nonempty_string('Bus Protocol', $out, undef);
            $spare    = get_nonempty_string('Hot Spare', $out, q{});
+            $cert     = get_nonempty_string('Certified', $out, 1);
            $ctrl     = $out->{ctrl};
            $capacity = get_nonempty_string('Capacity', $out, q{});
            $capacity =~ s{\A .*? \((\d+) \s bytes\) \z}{$1}xms;
            if ($capacity eq 'Unavailable') {
                $capacity = -1;
            }
+           if ($cert eq 'Yes' or $cert eq 'Not Applicable') {
+               $cert = 1;
+           }
+           else {
+               $cert = 0;
+           }
        }
 
        $count{pdisk}++;
@@ -1554,6 +1564,12 @@ sub check_physical_disks {
              $name, $vendor, $product, $capacity, $ctrl, $state, $progr;
            report('storage', $msg, $E_WARNING, $nexus);
        }
+       # Special case: Uncertified disk
+       elsif ($status eq 'Non-Critical' and !$cert) {
+           my $msg = sprintf '%s [%s %s, %s] on ctrl %d is Not Certified',
+             $name, $vendor, $product, $capacity, $ctrl;
+           report('storage', $msg, $E_WARNING, $nexus);
+       }
        # Default
        elsif ($status ne 'Ok') {
            my $msg =  sprintf '%s [%s %s, %s] on ctrl %d needs attention: %s',