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

« back to all changes in this revision

Viewing changes to check_hpasm/check_hpasm-4.5.2/plugins-scripts/HP/Proliant/Component/CpuSubsystem/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::CpuSubsystem::SNMP;
2
 
our @ISA = qw(HP::Proliant::Component::CpuSubsystem
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
 
    runtime => $params{runtime},
13
 
    rawdata => $params{rawdata},
14
 
    cpus => [],
15
 
    blacklisted => 0,
16
 
    info => undef,
17
 
    extendedinfo => undef,
18
 
  };
19
 
  bless $self, $class;
20
 
  $self->init();
21
 
  return $self;
22
 
}
23
 
 
24
 
sub init {
25
 
  my $self = shift;
26
 
  my $snmpwalk = $self->{rawdata};
27
 
  # CPQSTDEQ-MIB
28
 
  my $oids = {
29
 
      cpqSeCpuEntry => '1.3.6.1.4.1.232.1.2.2.1.1',
30
 
      cpqSeCpuUnitIndex => '1.3.6.1.4.1.232.1.2.2.1.1.1',
31
 
      cpqSeCpuSlot => '1.3.6.1.4.1.232.1.2.2.1.1.2',
32
 
      cpqSeCpuName => '1.3.6.1.4.1.232.1.2.2.1.1.3',
33
 
      cpqSeCpuStatus => '1.3.6.1.4.1.232.1.2.2.1.1.6',
34
 
      cpqSeCpuStatusValue => {
35
 
          1 => "unknown",
36
 
          2 => "ok",
37
 
          3 => "degraded",
38
 
          4 => "failed",
39
 
          5 => "disabled",
40
 
      },
41
 
  };
42
 
 
43
 
  # INDEX { cpqSeCpuUnitIndex }
44
 
  foreach ($self->get_entries($oids, 'cpqSeCpuEntry')) {
45
 
    push(@{$self->{cpus}},
46
 
        HP::Proliant::Component::CpuSubsystem::Cpu->new(%{$_}));
47
 
  }
48
 
}
49
 
 
50
 
1;