Skip to content

Spare drive is not recognized #34

@teanva

Description

@teanva

SNMPv2-SMI::enterprises.232.3.2.5.1.1.6.0.0 = INTEGER: 2
SNMPv2-SMI::enterprises.232.3.2.5.1.1.6.0.1 = INTEGER: 2
SNMPv2-SMI::enterprises.232.3.2.5.1.1.6.0.2 = INTEGER: 2
SNMPv2-SMI::enterprises.232.3.2.5.1.1.6.0.3 = INTEGER: 2
SNMPv2-SMI::enterprises.232.3.2.5.1.1.6.0.4 = INTEGER: 2
SNMPv2-SMI::enterprises.232.3.2.5.1.1.6.0.5 = INTEGER: 2
SNMPv2-SMI::enterprises.232.3.2.5.1.1.6.0.6 = INTEGER: 10
SNMPv2-SMI::enterprises.232.3.2.5.1.1.6.0.7 = INTEGER: 2

./check_hpasm:
CRITICAL - physical drive 0:6 is value_10, System: 'proliant dl360 gen10'

./check_hpasm -v:
physical drive 0:0 is ok
physical drive 0:1 is ok
physical drive 0:2 is ok
physical drive 0:3 is ok
physical drive 0:4 is ok
physical drive 0:5 is ok
physical drive 0:6 is value_10
physical drive 0:7 is ok

Fix:

cpqDaPhyDrvStatusValue => {
          1 => "other",
          2 => "ok",
          3 => "failed",
          4 => "predictiveFailure",
          5 => "erasing",
          6 => "eraseDone",
          7 => "eraseQueued",
          8 => "ssdWearOut",
          9 => "notAuthenticated",
						
      },

sub check {
  my $self = shift;
  $self->blacklist('dapd', $self->{name});
  $self->add_info(
      sprintf "physical drive %s is %s",
          $self->{name}, $self->{cpqDaPhyDrvStatus});
  if ($self->{cpqDaPhyDrvStatus} ne 'ok') {
    $self->add_message(CRITICAL,
        sprintf "physical drive %s is %s",
            $self->{name}, $self->{cpqDaPhyDrvStatus});
  }
}

->

cpqDaPhyDrvStatusValue => {
          1 => "other",
          2 => "ok",
          3 => "failed",
          4 => "predictiveFailure",
          5 => "erasing",
          6 => "eraseDone",
          7 => "eraseQueued",
          8 => "ssdWearOut",
          9 => "notAuthenticated",
          10 => "spare",
      },


sub check {
  my $self = shift;
  $self->blacklist('dapd', $self->{name});
  $self->add_info(
      sprintf "physical drive %s is %s",
          $self->{name}, $self->{cpqDaPhyDrvStatus});
  if (($self->{cpqDaPhyDrvStatus} ne 'ok') && ($self->{cpqDaPhyDrvStatus} ne 'spare')) {
    $self->add_message(CRITICAL,
        sprintf "physical drive %s is %s",
            $self->{name}, $self->{cpqDaPhyDrvStatus});
  }
}

./check_hpasm:
OK - System: 'proliant dl360 gen10'

./check_hpasm -v:
physical drive 0:0 is ok
physical drive 0:1 is ok
physical drive 0:2 is ok
physical drive 0:3 is ok
physical drive 0:4 is ok
physical drive 0:5 is ok
physical drive 0:6 is spare
physical drive 0:7 is ok

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions