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