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

« back to all changes in this revision

Viewing changes to check_hpasm/check_hpasm-4.6.3/plugins-scripts/HP/Proliant/Component/DiskSubsystem/Fca/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::Fca::SNMP;
 
2
our @ISA = qw(HP::Proliant::Component::DiskSubsystem::Fca
 
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
  # CPQFCA-MIB
 
28
  my $oids = {
 
29
      cpqFcaHostCntlrEntry => '1.3.6.1.4.1.232.16.2.7.1.1',
 
30
      cpqFcaHostCntlrIndex => '1.3.6.1.4.1.232.16.2.7.1.1.1',
 
31
      cpqFcaHostCntlrSlot => '1.3.6.1.4.1.232.16.2.7.1.1.2',
 
32
      cpqFcaHostCntlrModel => '1.3.6.1.4.1.232.16.2.7.1.1.3',
 
33
      cpqFcaHostCntlrStatus => '1.3.6.1.4.1.232.16.2.7.1.1.4',
 
34
      cpqFcaHostCntlrCondition => '1.3.6.1.4.1.232.16.2.7.1.1.5',
 
35
      cpqFcaHostCntlrOverallCondition => '1.3.6.1.4.1.232.16.2.7.1.1.8',
 
36
      cpqFcaHostCntlrModelValue => {
 
37
          1 => "other",
 
38
          2 => "fchc-p",
 
39
          3 => "fchc-e",
 
40
          4 => "fchc64",
 
41
          5 => "sa-sam",
 
42
          6 => "fca-2101",
 
43
          7 => "sw64-33",
 
44
          8 => "fca-221x",
 
45
          9 => "dpfcmc",
 
46
      },
 
47
      cpqFcaHostCntlrStatusValue => {
 
48
          1 => "other",
 
49
          2 => "ok",
 
50
          3 => "failed",
 
51
          4 => "shutdown",
 
52
          5 => "loopDegraded",
 
53
          6 => "loopFailed",
 
54
      },
 
55
      cpqFcaHostCntlrConditionValue => {
 
56
          1 => "other",
 
57
          2 => "ok",
 
58
          3 => "degraded",
 
59
          4 => "failed",
 
60
      },
 
61
      cpqFcaHostCntlrOverallConditionValue => {
 
62
          1 => "other",
 
63
          2 => "ok",
 
64
          3 => "degraded",
 
65
          4 => "failed",
 
66
      }, # cntrl + alle associated storage boxes
 
67
  };
 
68
 
 
69
  # INDEX { cpqFcaHostCntlrIndex }
 
70
  foreach ($self->get_entries($oids, 'cpqFcaHostCntlrEntry')) {
 
71
    push(@{$self->{host_controllers}},
 
72
        HP::Proliant::Component::DiskSubsystem::Fca::HostController->new(%{$_}));
 
73
  }
 
74
 
 
75
  $oids = {
 
76
      cpqFcaCntlrEntry => '1.3.6.1.4.1.232.16.2.2.1.1',
 
77
      cpqFcaCntlrBoxIndex => '1.3.6.1.4.1.232.16.2.2.1.1.1',
 
78
      cpqFcaCntlrBoxIoSlot => '1.3.6.1.4.1.232.16.2.2.1.1.2',
 
79
      cpqFcaCntlrModel => '1.3.6.1.4.1.232.16.2.2.1.1.3',
 
80
      cpqFcaCntlrStatus => '1.3.6.1.4.1.232.16.2.2.1.1.5',
 
81
      cpqFcaCntlrCondition => '1.3.6.1.4.1.232.16.2.2.1.1.6',
 
82
      cpqFcaCntlrModelValue => {
 
83
        1 => "other",
 
84
        2 => "fibreArray",
 
85
        3 => "msa1000",
 
86
        4 => "smartArrayClusterStorage",
 
87
        5 => "hsg80",
 
88
        6 => "hsv110", 
 
89
        7 => "msa500g2", 
 
90
        8 => "msa20",
 
91
      },
 
92
      cpqFcaCntlrStatusValue => {
 
93
          1 => "other",
 
94
          2 => "ok",
 
95
          3 => "failed",
 
96
          4 => "offline",
 
97
          4 => "redundantPathOffline",
 
98
      },
 
99
      cpqFcaCntlrConditionValue => {
 
100
          1 => "other",
 
101
          2 => "ok",
 
102
          3 => "degraded",
 
103
          4 => "failed",
 
104
      },
 
105
  };
 
106
 
 
107
  # INDEX { cpqFcaCntlrBoxIndex, cpqFcaCntlrBoxIoSlot }
 
108
  foreach ($self->get_entries($oids, 'cpqFcaCntlrEntry')) {
 
109
    push(@{$self->{controllers}},
 
110
        HP::Proliant::Component::DiskSubsystem::Fca::Controller->new(%{$_}));
 
111
  }
 
112
 
 
113
  $oids = {
 
114
      cpqFcaAccelEntry => '1.3.6.1.4.1.232.16.2.2.2.1',
 
115
      cpqFcaAccelBoxIndex => '1.3.6.1.4.1.232.16.2.2.2.1.1',
 
116
      cpqFcaAccelBoxIoSlot => '1.3.6.1.4.1.232.16.2.2.2.1.2',
 
117
      cpqFcaAccelStatus => '1.3.6.1.4.1.232.16.2.2.2.1.3',
 
118
      cpqFcaAccelErrCode => '1.3.6.1.4.1.232.16.2.2.2.1.5',
 
119
      cpqFcaAccelBatteryStatus => '1.3.6.1.4.1.232.16.2.2.2.1.6',
 
120
      cpqFcaAccelCondition => '1.3.6.1.4.1.232.16.2.2.2.1.9',
 
121
      cpqFcaAccelStatusValue => {
 
122
          1 => "other",
 
123
          2 => "invalid",
 
124
          3 => "enabled",
 
125
          4 => "tmpDisabled",
 
126
          5 => "permDisabled",
 
127
      },
 
128
      cpqFcaAccelErrCodeValue => {
 
129
          1 => 'other',
 
130
          2 => 'invalid',
 
131
          3 => 'badConfig',
 
132
          4 => 'lowBattery',
 
133
          5 => 'disableCmd',
 
134
          6 => 'noResources',
 
135
          7 => 'notConnected',
 
136
          8 => 'badMirrorData',
 
137
          9 => 'readErr',
 
138
          10 => 'writeErr',
 
139
          11 => 'configCmd',
 
140
          12 => 'expandInProgress',
 
141
          13 => 'snapshotInProgress',
 
142
          14 => 'redundantLowBattery',
 
143
          15 => 'redundantSizeMismatch',
 
144
          16 => 'redundantCacheFailure',
 
145
          17 => 'excessiveEccErrors',
 
146
          19 => 'postEccErrors',
 
147
      },
 
148
      cpqFcaAccelBatteryStatusValue => {
 
149
          1 => 'other',
 
150
          2 => 'ok',
 
151
          3 => 'recharging',
 
152
          4 => 'failed',
 
153
          5 => 'degraded',
 
154
          6 => 'notPresent',
 
155
      },
 
156
      cpqFcaAccelConditionValue => {
 
157
          1 => "other",
 
158
          2 => "ok",
 
159
          3 => "degraded",
 
160
          4 => "failed",
 
161
      },
 
162
  };
 
163
 
 
164
  # INDEX { cpqFcaAccelBoxIndex, cpqFcaAccelBoxIoSlot }
 
165
  foreach ($self->get_entries($oids, 'cpqFcaAccelEntry')) {
 
166
    push(@{$self->{accelerators}},
 
167
        HP::Proliant::Component::DiskSubsystem::Fca::Accelerator->new(%{$_}));
 
168
  }
 
169
 
 
170
  $oids = {
 
171
      cpqFcaLogDrvEntry => '1.3.6.1.4.1.232.16.2.3.1.1',
 
172
      cpqFcaLogDrvBoxIndex => '1.3.6.1.4.1.232.16.2.3.1.1.1',
 
173
      cpqFcaLogDrvIndex => '1.3.6.1.4.1.232.16.2.3.1.1.2',
 
174
      cpqFcaLogDrvFaultTol => '1.3.6.1.4.1.232.16.2.3.1.1.3',
 
175
      cpqFcaLogDrvStatus => '1.3.6.1.4.1.232.16.2.3.1.1.4',
 
176
      cpqFcaLogDrvPercentRebuild => '1.3.6.1.4.1.232.16.2.3.1.1.6',
 
177
      cpqFcaLogDrvSize => '1.3.6.1.4.1.232.16.2.3.1.1.9',
 
178
      cpqFcaLogDrvPhyDrvIDs => '1.3.6.1.4.1.232.16.2.3.1.1.10',
 
179
      cpqFcaLogDrvCondition => '1.3.6.1.4.1.232.16.2.3.1.1.11',
 
180
      cpqFcaLogDrvFaultTolValue => {
 
181
          1 => 'other',
 
182
          2 => 'none',
 
183
          3 => 'mirroring',
 
184
          4 => 'dataGuard',
 
185
          5 => 'distribDataGuard',
 
186
          7 => 'advancedDataGuard',
 
187
      },
 
188
      cpqFcaLogDrvStatusValue => {
 
189
          1 => 'other',
 
190
          2 => 'ok',
 
191
          3 => 'failed',
 
192
          4 => 'unconfigured',
 
193
          5 => 'recovering',
 
194
          6 => 'readyForRebuild',
 
195
          7 => 'rebuilding',
 
196
          8 => 'wrongDrive',
 
197
          9 => 'badConnect',
 
198
          10 => 'overheating',
 
199
          11 => 'shutdown',
 
200
          12 => 'expanding',
 
201
          13 => 'notAvailable',
 
202
          14 => 'queuedForExpansion',
 
203
          15 => 'hardError',
 
204
      },
 
205
      cpqFcaLogDrvConditionValue => {
 
206
          1 => 'other',
 
207
          2 => 'ok',
 
208
          3 => 'degraded',
 
209
          4 => 'failed',
 
210
      },
 
211
  };
 
212
 
 
213
  # INDEX { cpqFcaLogDrvBoxIndex, cpqFcaLogDrvIndex }
 
214
  foreach ($self->get_entries($oids, 'cpqFcaLogDrvEntry')) {
 
215
    push(@{$self->{logical_drives}},
 
216
        HP::Proliant::Component::DiskSubsystem::Fca::LogicalDrive->new(%{$_}));
 
217
  }
 
218
 
 
219
  $oids = {
 
220
      cpqFcaPhyDrvEntry => '1.3.6.1.4.1.232.16.2.5.1.1',
 
221
      cpqFcaPhyDrvBoxIndex => '1.3.6.1.4.1.232.16.2.5.1.1.1',
 
222
      cpqFcaPhyDrvIndex => '1.3.6.1.4.1.232.16.2.5.1.1.2',
 
223
      cpqFcaPhyDrvModel => '1.3.6.1.4.1.232.16.2.5.1.1.3',
 
224
      cpqFcaPhyDrvBay => '1.3.6.1.4.1.232.16.2.5.1.1.5',
 
225
      cpqFcaPhyDrvStatus => '1.3.6.1.4.1.232.16.2.5.1.1.6',
 
226
      cpqFcaPhyDrvCondition => '1.3.6.1.4.1.232.16.2.5.1.1.31',
 
227
      cpqFcaPhyDrvSize => '1.3.6.1.4.1.232.16.2.5.1.1.38',
 
228
      cpqFcaPhyDrvBusNumber => '1.3.6.1.4.1.232.16.2.5.1.1.42',
 
229
      cpqFcaPhyDrvStatusValue => {
 
230
          1 => 'other',
 
231
          2 => 'unconfigured',
 
232
          3 => 'ok',
 
233
          4 => 'threshExceeded',
 
234
          5 => 'predictiveFailure',
 
235
          6 => 'failed',
 
236
      },
 
237
      cpqFcaPhyDrvConditionValue => {
 
238
          1 => 'other',
 
239
          2 => 'ok',
 
240
          3 => 'degraded',
 
241
          4 => 'failed',
 
242
      },
 
243
  };
 
244
 
 
245
  # INDEX { cpqFcaPhyDrvBoxIndex, cpqFcaPhyDrvIndex }
 
246
  foreach ($self->get_entries($oids, 'cpqFcaPhyDrvEntry')) {
 
247
    push(@{$self->{physical_drives}},
 
248
        HP::Proliant::Component::DiskSubsystem::Fca::PhysicalDrive->new(%{$_}));
 
249
  }
 
250
 
 
251
  $oids = {
 
252
      cpqFcaMibRevMajor => '1.3.6.1.4.1.232.16.1.1.0',
 
253
      cpqFcaMibRevMinor => '1.3.6.1.4.1.232.16.1.2.0',
 
254
      cpqFcaMibCondition => '1.3.6.1.4.1.232.16.1.3.0',
 
255
      cpqFcaMibConditionValue => {
 
256
          1 => 'other',
 
257
          2 => 'ok',
 
258
          3 => 'degraded',
 
259
          4 => 'failed',
 
260
      },
 
261
  };
 
262
  $self->{global_status} =
 
263
      HP::Proliant::Component::DiskSubsystem::Fca::GlobalStatus->new(
 
264
          runtime => $self->{runtime},
 
265
          cpqFcaMibCondition => 
 
266
            SNMP::Utils::get_object_value($snmpwalk,
 
267
                $oids->{cpqFcaMibCondition}, $oids->{cpqFcaMibConditionValue})
 
268
      );
 
269
}