~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.2/plugins-scripts/HP/Proliant/Component/DiskSubsystem/Scsi/SNMP.pm

  • Committer: Package Import Robot
  • Author(s): Bernd Zeimetz, Bernd Zeimetz, Jan Wagner, Evgeni Golov
  • Date: 2013-06-14 20:53:49 UTC
  • Revision ID: package-import@ubuntu.com-20130614205349-34xiy38pm1hzpjoi
Tags: 7.20130614
[ Bernd Zeimetz ]
* [036816ff] Merge pull request #15 from evgeni/master
  check_packages should find security updates on the official security mirror too
* [658a2e93] Add check_checksums nagios plugin.
* [9d5d2056] Updating check_raid.
* [e3ec1293] Updating check_ssl_cert to 1.14.6
* [779543ef] Updating check_hpasm to 4.6.3.2
* [0c838ee9] Updating check_multipath to 0.1.9
* [bec11251] Updating check_whois to 1.13
* [8e0a65d0] Refreshing patches.
* [c0b88cdb] Auto update of debian/copyright
* [59648a17] Fix src link for check_hpasm
* [8c242d0f] Support pre-Wheezy versions of coretutils in check_checksums.
* [7d3d2a06] Update release date in changelog (gah!).
* [768e463b] Merge pull request #16 from evgeni/master
  check_libs: ignore /var/lib/postgresql/ and /var/log/
* [2b9aace5] Bumping standards-Verison, no changes needed.

[ Jan Wagner ]
* [3bb873e4] disable epn for check_rbl

[ Evgeni Golov ]
* [2a7ab4b8] check_libs: ignore /var/spool/

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
}