~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/Sas/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::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
 
}