~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/Scsi/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::Scsi::SNMP;
2
 
our @ISA = qw(HP::Proliant::Component::DiskSubsystem::Scsi
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
 
      cpqScsiCntlrEntry => '1.3.6.1.4.1.232.5.2.2.1.1',
30
 
      cpqScsiCntlrIndex => '1.3.6.1.4.1.232.5.2.2.1.1.1',
31
 
      cpqScsiCntlrBusIndex => '1.3.6.1.4.1.232.5.2.2.1.1.2',
32
 
      cpqScsiCntlrSlot => '1.3.6.1.4.1.232.5.2.2.1.1.6',
33
 
      cpqScsiCntlrStatus => '1.3.6.1.4.1.232.5.2.2.1.1.7',
34
 
      cpqScsiCntlrCondition => '1.3.6.1.4.1.232.5.2.2.1.1.12',
35
 
      cpqScsiCntlrHwLocation => '1.3.6.1.4.1.232.5.2.2.1.1.16',
36
 
      cpqScsiCntlrStatusValue => {
37
 
          1 => "other",
38
 
          2 => "ok",
39
 
          3 => "failed",
40
 
      },
41
 
      cpqScsiCntlrConditionValue => {
42
 
          1 => "other",
43
 
          2 => "ok",
44
 
          3 => "degraded",
45
 
          4 => "failed",
46
 
      }
47
 
  };
48
 
 
49
 
  # INDEX { cpqScsiCntlrIndex, cpqScsiCntlrBusIndex }
50
 
  foreach ($self->get_entries($oids, 'cpqScsiCntlrEntry')) {
51
 
    push(@{$self->{controllers}},
52
 
        HP::Proliant::Component::DiskSubsystem::Scsi::Controller->new(%{$_}));
53
 
  }
54
 
 
55
 
  $oids = {
56
 
      cpqScsiLogDrvEntry => '1.3.6.1.4.1.232.5.2.3.1.1',
57
 
      cpqScsiLogDrvCntlrIndex => '1.3.6.1.4.1.232.5.2.3.1.1.1',
58
 
      cpqScsiLogDrvBusIndex => '1.3.6.1.4.1.232.5.2.3.1.1.2',
59
 
      cpqScsiLogDrvIndex => '1.3.6.1.4.1.232.5.2.3.1.1.3',
60
 
      cpqScsiLogDrvFaultTol => '1.3.6.1.4.1.232.5.2.3.1.1.4',
61
 
      cpqScsiLogDrvStatus => '1.3.6.1.4.1.232.5.2.3.1.1.5',
62
 
      cpqScsiLogDrvSize => '1.3.6.1.4.1.232.5.2.3.1.1.6',
63
 
      cpqScsiLogDrvPhyDrvIDs => '1.3.6.1.4.1.232.5.2.3.1.1.7',
64
 
      cpqScsiLogDrvCondition => '1.3.6.1.4.1.232.5.2.3.1.1.8',
65
 
      cpqScsiLogDrvStatusValue => {
66
 
          1 => "other",
67
 
          2 => "ok",
68
 
          3 => "failed",
69
 
          4 => "unconfigured",
70
 
          5 => "recovering",
71
 
          6 => "readyForRebuild",
72
 
          7 => "rebuilding",
73
 
          8 => "wrongDrive",
74
 
          9 => "badConnect",
75
 
      },
76
 
      cpqScsiLogDrvConditionValue => {
77
 
          1 => "other",
78
 
          2 => "ok",
79
 
          3 => "degraded",
80
 
          4 => "failed",
81
 
      },
82
 
      cpqScsiLogDrvFaultTolValue => {
83
 
          1 => "other",
84
 
          2 => "none",
85
 
          3 => "mirroring",
86
 
          4 => "dataGuard",
87
 
          5 => "distribDataGuard",
88
 
      },
89
 
 
90
 
  };
91
 
  # INDEX { cpqScsiLogDrvCntlrIndex, cpqScsiLogDrvBusIndex, cpqScsiLogDrvIndex }
92
 
  foreach ($self->get_entries($oids, 'cpqScsiLogDrvEntry')) {
93
 
    push(@{$self->{logical_drives}},
94
 
        HP::Proliant::Component::DiskSubsystem::Scsi::LogicalDrive->new(%{$_}));
95
 
  }
96
 
 
97
 
  $oids = {
98
 
      cpqScsiPhyDrvEntry => '1.3.6.1.4.1.232.5.2.4.1.1',
99
 
      cpqScsiPhyDrvCntlrIndex => '1.3.6.1.4.1.232.5.2.4.1.1.1',
100
 
      cpqScsiPhyDrvBusIndex => '1.3.6.1.4.1.232.5.2.4.1.1.2',
101
 
      cpqScsiPhyDrvIndex => '1.3.6.1.4.1.232.5.2.4.1.1.3',
102
 
      cpqScsiPhyDrvStatus => '1.3.6.1.4.1.232.5.2.4.1.1.9',
103
 
      cpqScsiPhyDrvSize => '1.3.6.1.4.1.232.5.2.4.1.1.7',
104
 
      cpqScsiPhyDrvCondition => '1.3.6.1.4.1.232.5.2.4.1.1.26',
105
 
      cpqScsiPhyDrvConditionValue => {
106
 
          1 => "other",
107
 
          2 => "ok",
108
 
          3 => "degraded",
109
 
          4 => "failed",
110
 
      },
111
 
      cpqScsiPhyDrvStatusValue => {
112
 
          1 => "other",
113
 
          2 => "ok",
114
 
          3 => "failed",
115
 
          4 => "notConfigured",
116
 
          5 => "badCable",
117
 
          6 => "missingWasOk",
118
 
          7 => "missingWasFailed",
119
 
          8 => "predictiveFailure",
120
 
          9 => "missingWasPredictiveFailure",
121
 
          10 => "offline",
122
 
          11 => "missingWasOffline",
123
 
          12 => "hardError",
124
 
      },
125
 
  };
126
 
    
127
 
  # INDEX { cpqScsiPhyDrvCntlrIndex, cpqScsiPhyDrvBusIndex, cpqScsiPhyDrvIndex }
128
 
  foreach ($self->get_entries($oids, 'cpqScsiPhyDrvEntry')) {
129
 
    push(@{$self->{physical_drives}},
130
 
        HP::Proliant::Component::DiskSubsystem::Scsi::PhysicalDrive->new(%{$_}));
131
 
  }
132
 
 
133
 
}