~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/Ide/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::Ide::SNMP;
 
2
our @ISA = qw(HP::Proliant::Component::DiskSubsystem::Ide
 
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
  # CPQIDE-MIB
 
28
  my $oids = {
 
29
      cpqIdeControllerEntry => '1.3.6.1.4.1.232.14.2.3.1.1',
 
30
      cpqIdeControllerIndex => '1.3.6.1.4.1.232.14.2.3.1.1.1',
 
31
      cpqIdeControllerOverallCondition => '1.3.6.1.4.1.232.14.2.3.1.1.2',
 
32
      cpqIdeControllerModel => '1.3.6.1.4.1.232.14.2.3.1.1.3',
 
33
      cpqIdeControllerSlot => '1.3.6.1.4.1.232.14.2.3.1.1.5',
 
34
      cpqIdeControllerOverallConditionValue => {
 
35
          1 => "other",
 
36
          2 => "ok",
 
37
          3 => "degraded",
 
38
          4 => "failed",
 
39
      },
 
40
  };
 
41
 
 
42
  # INDEX { cpqIdeControllerIndex }
 
43
  foreach ($self->get_entries($oids, 'cpqIdeControllerEntry')) {
 
44
    push(@{$self->{controllers}},
 
45
        HP::Proliant::Component::DiskSubsystem::Ide::Controller->new(%{$_}));
 
46
  }
 
47
 
 
48
  $oids = {
 
49
      cpqIdeLogicalDriveEntry => '1.3.6.1.4.1.232.14.2.6.1.1',
 
50
      cpqIdeLogicalDriveControllerIndex => '1.3.6.1.4.1.232.14.2.6.1.1.1',
 
51
      cpqIdeLogicalDriveIndex => '1.3.6.1.4.1.232.14.2.6.1.1.2',
 
52
      cpqIdeLogicalDriveRaidLevel => '1.3.6.1.4.1.232.14.2.6.1.1.3',
 
53
      cpqIdeLogicalDriveCapacity => '1.3.6.1.4.1.232.14.2.6.1.1.4',
 
54
      cpqIdeLogicalDriveStatus => '1.3.6.1.4.1.232.14.2.6.1.1.5',
 
55
      cpqIdeLogicalDriveCondition => '1.3.6.1.4.1.232.14.2.6.1.1.6',
 
56
      cpqIdeLogicalDriveDiskIds => '1.3.6.1.4.1.232.14.2.6.1.1.7',
 
57
      cpqIdeLogicalDriveSpareIds => '1.3.6.1.4.1.232.14.2.6.1.1.9',
 
58
      cpqIdeLogicalDriveRebuildingDisk => '1.3.6.1.4.1.232.14.2.6.1.1.10',
 
59
      cpqIdeLogicalDriveRaidLevelValue => {
 
60
          1 => "other",
 
61
          2 => "raid0",
 
62
          3 => "raid1",
 
63
          4 => "raid0plus1",
 
64
      },
 
65
      cpqIdeLogicalDriveStatusValue => {
 
66
          1 => "other",
 
67
          2 => "ok",
 
68
          3 => "degraded",
 
69
          4 => "rebuilding",
 
70
          5 => "failed",
 
71
      },
 
72
      cpqIdeLogicalDriveConditionValue => {
 
73
          1 => "other",
 
74
          2 => "ok",
 
75
          3 => "degraded",
 
76
          4 => "failed",
 
77
      },
 
78
  };
 
79
  # INDEX { cpqIdeLogicalDriveControllerIndex, cpqIdeLogicalDriveIndex }
 
80
  foreach ($self->get_entries($oids, 'cpqIdeLogicalDriveEntry')) {
 
81
    push(@{$self->{logical_drives}},
 
82
        HP::Proliant::Component::DiskSubsystem::Ide::LogicalDrive->new(%{$_}));
 
83
  }
 
84
 
 
85
  $oids = {
 
86
      cpqIdeAtaDiskEntry => '1.3.6.1.4.1.232.14.2.4.1.1',
 
87
      cpqIdeAtaDiskControllerIndex => '1.3.6.1.4.1.232.14.2.4.1.1.1',
 
88
      cpqIdeAtaDiskIndex => '1.3.6.1.4.1.232.14.2.4.1.1.2',
 
89
      cpqIdeAtaDiskModel => '1.3.6.1.4.1.232.14.2.4.1.1.3',
 
90
      cpqIdeAtaDiskStatus => '1.3.6.1.4.1.232.14.2.4.1.1.6',
 
91
      cpqIdeAtaDiskCondition => '1.3.6.1.4.1.232.14.2.4.1.1.7',
 
92
      cpqIdeAtaDiskCapacity => '1.3.6.1.4.1.232.14.2.4.1.1.8',
 
93
      cpqIdeAtaDiskLogicalDriveMember => '1.3.6.1.4.1.232.14.2.4.1.1.13',
 
94
      cpqIdeAtaDiskIsSpare => '1.3.6.1.4.1.232.14.2.4.1.1.14',
 
95
      cpqIdeAtaDiskStatusValue => {
 
96
          1 => "other",
 
97
          2 => "ok",
 
98
          3 => "smartError",
 
99
          4 => "failed",
 
100
      },
 
101
      cpqIdeAtaDiskConditionValue => {
 
102
          1 => "other",
 
103
          2 => "ok",
 
104
          3 => "degraded",
 
105
          4 => "failed",
 
106
      },
 
107
  };
 
108
  # INDEX { cpqIdeAtaDiskControllerIndex, cpqIdeAtaDiskIndex }
 
109
  foreach ($self->get_entries($oids, 'cpqIdeAtaDiskEntry')) {
 
110
    push(@{$self->{physical_drives}},
 
111
        HP::Proliant::Component::DiskSubsystem::Ide::PhysicalDrive->new(%{$_}));
 
112
  }
 
113
 
 
114
}