~ubuntu-branches/ubuntu/trusty/nagios-plugins-contrib/trusty-proposed

« back to all changes in this revision

Viewing changes to check_hpasm/check_hpasm-4.5.2/plugins-scripts/HP/Proliant/Component/DiskSubsystem/Sas/SNMP.pm

  • Committer: Package Import Robot
  • Author(s): Bernd Zeimetz
  • Date: 2013-05-21 22:11:50 UTC
  • mfrom: (5.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130521221150-k5bda5v5euvt7wg9
Tags: 6.20130521
* [e68c82e1] check_raid: do not run hpacucli if cciss_vol_status is available.
* [4a1c57e8] Also support tw-cli as additional name for the 3ware binary.
  Thanks to Dennis Hoppe
* [eb5e1c7c] Add /run/ to the check_libs ignore file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
package HP::Proliant::Component::DiskSubsystem::Sas::SNMP;
2
 
our @ISA = qw(HP::Proliant::Component::DiskSubsystem::Sas
3
 
    HP::Proliant::Component::SNMP);
4
 
 
5
 
use strict;
6
 
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
7
 
 
8
 
sub new {
9
 
  my $class = shift;
10
 
  my %params = @_;
11
 
  my $self = { 
12
 
    controllers => [],
13
 
    accelerators => [],
14
 
    physical_drives => [],
15
 
    logical_drives => [],
16
 
    spare_drives => [],
17
 
    blacklisted => 0,
18
 
  };
19
 
  bless $self, $class;
20
 
  return $self;
21
 
}
22
 
 
23
 
sub init {
24
 
  my $self = shift;
25
 
  my $snmpwalk = $self->{rawdata};
26
 
 
27
 
  # CPQSCSI-MIB
28
 
  my $oids = {
29
 
      cpqSasHbaEntry => "1.3.6.1.4.1.232.5.5.1.1.1",
30
 
      cpqSasHbaIndex => "1.3.6.1.4.1.232.5.5.1.1.1.1",
31
 
      cpqSasHbaLocation => "1.3.6.1.4.1.232.5.5.1.1.1.2",
32
 
      cpqSasHbaSlot  => "1.3.6.1.4.1.232.5.5.1.1.1.6",
33
 
      cpqSasHbaStatus  => "1.3.6.1.4.1.232.5.5.1.1.1.4",
34
 
      cpqSasHbaStatusValue => {
35
 
          1 => "other",
36
 
          2 => "ok",
37
 
          3 => "failed",
38
 
      },
39
 
      cpqSasHbaCondition  => "1.3.6.1.4.1.232.5.5.1.1.1.5",
40
 
      cpqSasHbaConditionValue => {
41
 
          1 => "other",
42
 
          2 => "ok", 
43
 
          3 => "degraded", 
44
 
          4 => "failed",
45
 
      },
46
 
  };
47
 
 
48
 
  # INDEX { cpqSasHbaIndex } 
49
 
  foreach ($self->get_entries($oids, 'cpqSasHbaEntry')) {
50
 
    push(@{$self->{controllers}},
51
 
        HP::Proliant::Component::DiskSubsystem::Sas::Controller->new(%{$_}));
52
 
  }
53
 
 
54
 
  $oids = {
55
 
      cpqSasLogDrvEntry => "1.3.6.1.4.1.232.5.5.3.1.1",
56
 
      cpqSasLogDrvHbaIndex => "1.3.6.1.4.1.232.5.5.3.1.1.1",
57
 
      cpqSasLogDrvIndex => "1.3.6.1.4.1.232.5.5.3.1.1.2",
58
 
      cpqSasLogDrvStatus => "1.3.6.1.4.1.232.5.5.3.1.1.4",
59
 
      cpqSasLogDrvCondition => "1.3.6.1.4.1.232.5.5.3.1.1.5",
60
 
      cpqSasLogDrvRebuildingPercent => "1.3.6.1.4.1.232.5.5.3.1.1.12",
61
 
      cpqSasLogDrvRaidLevel => "1.3.6.1.4.1.232.5.5.3.1.1.3",
62
 
      cpqSasLogDrvRaidLevelValue => {
63
 
          1 => "other",
64
 
          2 => "raid0",
65
 
          3 => "raid1",
66
 
          4 => "raid0plus1",
67
 
          5 => "raid5",
68
 
          6 => "raid15",
69
 
          7 => "volume",
70
 
      },
71
 
      cpqSasLogDrvConditionValue => {
72
 
          1 => "other",
73
 
          2 => "ok",
74
 
          3 => "degraded",
75
 
          4 => "failed",
76
 
      },
77
 
      cpqSasLogDrvStatusValue => {
78
 
          1 => "other",
79
 
          2 => "ok",
80
 
          3 => "degraded",
81
 
          4 => "rebuilding",
82
 
          5 => "failed",
83
 
          6 => "offline",
84
 
      }
85
 
  };
86
 
  # INDEX { cpqSasLogDrvCntlrIndex, cpqSasLogDrvIndex }
87
 
  foreach ($self->get_entries($oids, 'cpqSasLogDrvEntry')) {
88
 
    push(@{$self->{logical_drives}},
89
 
        HP::Proliant::Component::DiskSubsystem::Sas::LogicalDrive->new(%{$_}));
90
 
  }
91
 
 
92
 
  $oids = {
93
 
      cpqSasPhyDrvEntry => "1.3.6.1.4.1.232.5.5.2.1.1",
94
 
      cpqSasPhyDrvHbaIndex => "1.3.6.1.4.1.232.5.5.2.1.1.1",
95
 
      cpqSasPhyDrvIndex => "1.3.6.1.4.1.232.5.5.2.1.1.2",
96
 
      cpqSasPhyDrvLocationString => "1.3.6.1.4.1.232.5.5.2.1.1.3",
97
 
      cpqSasPhyDrvStatus => "1.3.6.1.4.1.232.5.5.2.1.1.5",
98
 
      cpqSasPhyDrvSize => "1.3.6.1.4.1.232.5.5.2.1.1.8",
99
 
      cpqSasPhyDrvCondition => "1.3.6.1.4.1.232.5.5.2.1.1.6",
100
 
      cpqSasPhyDrvConditionValue => {
101
 
          1 => "other",
102
 
          2 => "ok",
103
 
          3 => "degraded",
104
 
          4 => "failed",
105
 
      },
106
 
      cpqSasPhyDrvStatusValue => {
107
 
          1 => "other",
108
 
          2 => "ok",
109
 
          3 => "predictiveFailure",
110
 
          4 => "offline",
111
 
          5 => "failed",
112
 
          6 => "missingWasOk",
113
 
          7 => "missingWasPredictiveFailure",
114
 
          8 => "missingWasOffline",
115
 
          9 => "missingWasFailed",
116
 
      },
117
 
  };
118
 
    
119
 
  # INDEX { cpqPhyLogDrvCntlrIndex, cpqSasPhyDrvIndex }
120
 
  foreach ($self->get_entries($oids, 'cpqSasPhyDrvEntry')) {
121
 
    push(@{$self->{physical_drives}},
122
 
        HP::Proliant::Component::DiskSubsystem::Sas::PhysicalDrive->new(%{$_}));
123
 
  }
124
 
 
125
 
}