[-]
[+]
|
Added |
nagios-plugins-hpasm.changes
|
|
[-]
[+]
|
Changed |
nagios-plugins-hpasm.spec
^
|
|
[-]
[+]
|
Changed |
check_hpasm-4.3.tar.bz2/ChangeLog
^
|
@@ -2,6 +2,30 @@
# Changelog of the check_hpasm plugin #
#######################################
+4.3 2011-10-14
+- add monitoring of IML events (Thanks Klaus)
+ esp. Memory initialization error... The OS may not have access to all of the memory installed in the system
+
+4.2.5
+- G2 series of X1660 storage systems are now correctly detected. (Thanks Andre Zaborowski)
+- blacklisting for SAS controller & disks was added (Thanks Jewi)
+
+4.2.4.1 2011-08-09
+- dimm output of G7 hpasmcli (under Solaris) is now handled (Thanks Ron Waffle)
+
+4.2.4 2011-07-21
+add a check for asr (Thanks Ingmar Verheij http://www.ingmarverheij.com/)
+
+4.2.3 2011-07-21
+- add a global temperature check when no temperature sensors are found
+- check power converters if no fault tolerant power supplies are found
+
+4.2.2.1 2011-04-17
+- fix a bug when a wrong --hostname was used (Thanks Wim Savenberg)
+
+4.2.2 2011-01-21
+- add support for msa500 and hpasmcli (Thanks Kalle Andersson)
+
4.2.1.1
- added support for x1** nas storage, which was detected as storage but in fact is like a proliant (Thanks Maik Schulz)
|
[-]
[+]
|
Changed |
check_hpasm-4.3.tar.bz2/configure
^
|
@@ -1,7 +1,7 @@
#! /bin/sh
# From configure.in .
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for check_hpasm 4.2.1.1.
+# Generated by GNU Autoconf 2.59 for check_hpasm 4.3.
#
# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
@@ -268,8 +268,8 @@
# Identity of this package.
PACKAGE_NAME='check_hpasm'
PACKAGE_TARNAME='check_hpasm'
-PACKAGE_VERSION='4.2.1.1'
-PACKAGE_STRING='check_hpasm 4.2.1.1'
+PACKAGE_VERSION='4.3'
+PACKAGE_STRING='check_hpasm 4.3'
PACKAGE_BUGREPORT=''
ac_default_prefix=/usr/local/nagios
@@ -722,7 +722,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures check_hpasm 4.2.1.1 to adapt to many kinds of systems.
+\`configure' configures check_hpasm 4.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -788,7 +788,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of check_hpasm 4.2.1.1:";;
+ short | recursive ) echo "Configuration of check_hpasm 4.3:";;
esac
cat <<\_ACEOF
@@ -904,7 +904,7 @@
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-check_hpasm configure 4.2.1.1
+check_hpasm configure 4.3
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -918,7 +918,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by check_hpasm $as_me 4.2.1.1, which was
+It was created by check_hpasm $as_me 4.3, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1561,7 +1561,7 @@
# Define the identity of the package.
PACKAGE='check_hpasm'
- VERSION='4.2.1.1'
+ VERSION='4.3'
cat >>confdefs.h <<_ACEOF
@@ -2091,6 +2091,9 @@
if test x"$enable_hpacucli" = xyes ; then
HPACUCLI=1
+elif test x"$enable_hpacucli" = xmaybe ; then
+ HPACUCLI=2
+
else
HPACUCLI=0
@@ -2595,7 +2598,7 @@
} >&5
cat >&5 <<_CSEOF
-This file was extended by check_hpasm $as_me 4.2.1.1, which was
+This file was extended by check_hpasm $as_me 4.3, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -2650,7 +2653,7 @@
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-check_hpasm config.status 4.2.1.1
+check_hpasm config.status 4.3
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
|
[-]
[+]
|
Changed |
check_hpasm-4.3.tar.bz2/configure.in
^
|
@@ -1,7 +1,7 @@
dnl Process this file with autoconf to produce a configure script.
AC_REVISION ($Revision: 1.150 $)
AC_PREREQ(2.58)
-AC_INIT(check_hpasm,4.2.1.1)
+AC_INIT(check_hpasm,4.3)
AM_INIT_AUTOMAKE([1.9 tar-pax])
AC_CANONICAL_HOST
@@ -83,6 +83,8 @@
if test x"$enable_hpacucli" = xyes ; then
AC_SUBST(HPACUCLI, 1)
+elif test x"$enable_hpacucli" = xmaybe ; then
+ AC_SUBST(HPACUCLI, 2)
else
AC_SUBST(HPACUCLI, 0)
fi
|
[-]
[+]
|
Changed |
check_hpasm-4.3.tar.bz2/plugins-scripts/HP/Proliant.pm
^
|
@@ -30,6 +30,8 @@
$self->analyze_temperatures();
$self->analyze_memory_subsystem();
$self->analyze_disk_subsystem();
+ $self->analyze_asr_subsystem();
+ $self->analyze_event_subsystem();
$self->auto_blacklist();
$self->check_cpus();
$self->check_powersupplies();
@@ -37,6 +39,8 @@
$self->check_temperatures();
$self->check_memory_subsystem();
$self->check_disk_subsystem();
+ $self->check_asr_subsystem();
+ $self->check_event_subsystem();
}
}
@@ -127,6 +131,26 @@
);
}
+sub analyze_asr_subsystem {
+ my $self = shift;
+ $self->{components}->{asr_subsystem} =
+ HP::Proliant::Component::AsrSubsystem->new(
+ rawdata => $self->{rawdata},
+ method => $self->{method},
+ runtime => $self->{runtime},
+ );
+}
+
+sub analyze_event_subsystem {
+ my $self = shift;
+ $self->{components}->{event_subsystem} =
+ HP::Proliant::Component::EventSubsystem->new(
+ rawdata => $self->{rawdata},
+ method => $self->{method},
+ runtime => $self->{runtime},
+ );
+}
+
sub check_cpus {
my $self = shift;
$self->{components}->{cpu_subsystem}->check();
@@ -173,6 +197,20 @@
if $self->{components}->{disk_subsystem}->{summary};
}
+sub check_asr_subsystem {
+ my $self = shift;
+ $self->{components}->{asr_subsystem}->check();
+ $self->{components}->{asr_subsystem}->dump()
+ if $self->{runtime}->{options}->{verbose} >= 2;
+}
+
+sub check_event_subsystem {
+ my $self = shift;
+ $self->{components}->{event_subsystem}->check();
+ $self->{components}->{event_subsystem}->dump()
+ if $self->{runtime}->{options}->{verbose} >= 2;
+}
+
sub auto_blacklist() {
my $self = shift;
if ($self->{product} =~ /380 g6/) {
@@ -239,74 +277,103 @@
$self->{runtime}->{plugin}->opts->hpasmcli : '/sbin/hpasmcli';
# check if this exists at all
# descend the directory
- if ($< != 0) {
- $hpasmcli = "sudo ".$hpasmcli;
+ if ($self->{runtime}->{plugin}->opts->hpasmcli &&
+ -e $self->{runtime}->{plugin}->opts->hpasmcli) {
+ $hpasmcli = $self->{runtime}->{plugin}->opts->hpasmcli;
+ } elsif (-e '/sbin/hpasmcli') {
+ $hpasmcli = '/sbin/hpasmcli';
+ } else {
+ $hpasmcli = undef;
}
- $self->trace(2, sprintf "calling %s\n", $hpasmcli);
- $self->check_daemon();
- if (! $self->{runtime}->{plugin}->check_messages()) {
- $self->check_hpasm_client($hpasmcli);
+ if ($hpasmcli) {
+ if ($< != 0) {
+ close STDIN;
+ $hpasmcli = "sudo -S ".$hpasmcli;
+ }
+ $self->trace(2, sprintf "calling %s\n", $hpasmcli);
+ $self->check_daemon();
if (! $self->{runtime}->{plugin}->check_messages()) {
- foreach my $component (qw(server fans temp dimm powersupply)) {
- if (open HPASMCLI, "$hpasmcli -s \"show $component\"|") {
- my @output = <HPASMCLI>;
- close HPASMCLI;
- $self->{rawdata} .= join("\n", map {
- $component.' '.$_;
- } @output);
- }
- }
- if ($self->{runtime}->{options}->{hpacucli}) {
- #1 oder 0. pfad selber finden
- my $hpacucli = undef;
- if (-e '/usr/sbin/hpacucli') {
- $hpacucli = '/usr/sbin/hpacucli';
- } elsif (-e '/usr/local/sbin/hpacucli') {
- $hpacucli = '/usr/local/sbin/hpacucli';
- } else {
- $hpacucli = $hpasmcli;
- $hpacucli =~ s/^sudo\s*//;
- $hpacucli =~ s/hpasmcli/hpacucli/;
- $hpacucli = -e $hpacucli ? $hpacucli : undef;
+ $self->check_hpasm_client($hpasmcli);
+ if (! $self->{runtime}->{plugin}->check_messages()) {
+ foreach my $component (qw(server fans temp dimm powersupply iml)) {
+ if (open HPASMCLI, "$hpasmcli -s \"show $component\"|") {
+ my @output = <HPASMCLI>;
+ close HPASMCLI;
+ $self->{rawdata} .= join("\n", map {
+ $component.' '.$_;
+ } @output);
+ }
}
- if ($hpacucli) {
- if ($< != 0) {
- $hpacucli = "sudo ".$hpacucli;
+ if ($self->{runtime}->{options}->{hpacucli}) {
+ #1 oder 0. pfad selber finden
+ my $hpacucli = undef;
+ if (-e '/usr/sbin/hpacucli') {
+ $hpacucli = '/usr/sbin/hpacucli';
+ } elsif (-e '/usr/local/sbin/hpacucli') {
+ $hpacucli = '/usr/local/sbin/hpacucli';
+ } else {
+ $hpacucli = $hpasmcli;
+ $hpacucli =~ s/^sudo\s*//;
+ $hpacucli =~ s/hpasmcli/hpacucli/;
+ $hpacucli = -e $hpacucli ? $hpacucli : undef;
}
- $self->trace(2, sprintf "calling %s\n", $hpacucli);
- $self->check_hpacu_client($hpacucli);
- if (! $self->{runtime}->{plugin}->check_messages()) {
- if (open HPACUCLI, "$hpacucli ctrl all show config 2>&1|") {
- my @output = <HPACUCLI>;
- close HPACUCLI;
- $self->{rawdata} .= join("\n", map {
- 'config '.$_;
- } @output);
+ if ($hpacucli) {
+ if ($< != 0) {
+ close STDIN;
+ $hpacucli = "sudo -S ".$hpacucli;
}
- if (open HPACUCLI, "$hpacucli ctrl all show status 2>&1|") {
- my @output = <HPACUCLI>;
- close HPACUCLI;
- $self->{rawdata} .= join("\n", map {
- 'status '.$_;
- } @output);
+ $self->trace(2, sprintf "calling %s\n", $hpacucli);
+ $self->check_hpacu_client($hpacucli);
+ if (! $self->{runtime}->{plugin}->check_messages()) {
+ if (open HPACUCLI, "$hpacucli ctrl all show config 2>&1|") {
+ my @output = <HPACUCLI>;
+ close HPACUCLI;
+ $self->{rawdata} .= join("\n", map {
+ 'config '.$_;
+ } @output);
+ }
+ if (open HPACUCLI, "$hpacucli ctrl all show status 2>&1|") {
+ my @output = <HPACUCLI>;
+ close HPACUCLI;
+ $self->{rawdata} .= join("\n", map {
+ 'status '.$_;
+ } @output);
+ }
+ } elsif ($self->{runtime}->{options}->{hpacucli} == 2) {
+ # we probably don't have sudo-privileges, but we were compiled with
+ # --enable-hpacucli=maybe
+ # so we cover it up in silence
+ $self->remove_message(UNKNOWN);
+ $self->trace(2, sprintf "calling %s seems to have failed, but nobody cares\n", $hpacucli);
}
- }
- } else {
- if ($self->{runtime}->{options}->{noinstlevel} eq 'ok') {
- $self->add_message(OK,
- 'hpacucli is not installed. let\'s hope the best...');
} else {
- $self->add_message(
- uc $self->{runtime}->{options}->{noinstlevel},
- 'hpacucli is not installed.');
+ if ($self->{runtime}->{options}->{noinstlevel} eq 'ok') {
+ $self->add_message(OK,
+ 'hpacucli is not installed. let\'s hope the best...');
+ } else {
+ $self->add_message(
+ uc $self->{runtime}->{options}->{noinstlevel},
+ 'hpacucli is not installed.');
+ }
}
}
}
}
+ } else {
+ if ($self->{runtime}->{options}->{noinstlevel} eq 'ok') {
+ $self->add_message(OK,
+ 'hpasm is not installed, i can only guess');
+ $self->{noinst_hint} = 1;
+ } else {
+ $self->add_message(
+ uc $self->{runtime}->{options}->{noinstlevel},
+ 'hpasmcli is not installed.');
+ }
}
}
}
+
sub check_daemon {
my $self = shift;
my $multiproc_os_signatures_files = {
@@ -341,9 +408,9 @@
}
}
if ($numcliprocs == 1) {
- $self->add_message(UNKNOWN, 'another hpasmdcli is running');
+ $self->add_message(UNKNOWN, 'another hpasmcli is running');
} elsif ($numcliprocs > 1) {
- $self->add_message(UNKNOWN, 'hanging hpasmdcli processes');
+ $self->add_message(UNKNOWN, 'hanging hpasmcli processes');
}
}
}
@@ -488,6 +555,7 @@
my $cpqIdeComponent = "1.3.6.1.4.1.232.14";
my $cpqFcaComponent = "1.3.6.1.4.1.232.16.2";
my $cpqSiComponent = "1.3.6.1.4.1.232.2.2";
+ my $cpqHeAsr = "1.3.6.1.4.1.232.6.2.5";
$session->translate;
my $response = {}; #break the walk up in smaller pieces
my $tic = time; my $tac = $tic;
@@ -601,7 +669,22 @@
$self->trace(2, sprintf "%03d seconds for walk cpqFcaComponent (%d oids)",
$tac - $tic, scalar(keys %{$response8}));
$tic = time;
- $session->close;
+
+ # Walk for ASR
+ $tic = time;
+ my $response9 = $session->get_table(
+ -maxrepetitions => 1,
+ -baseoid => $cpqHeAsr);
+ if (scalar (keys %{$response9}) == 0) {
+ $self->trace(2, sprintf "maxrepetitions failed. fallback");
+ $response9 = $session->get_table(
+ -baseoid => $cpqHeAsr);
+ }
+ $tac = time;
+ $self->trace(2, sprintf "%03d seconds for walk $cpqHeAsr (%d oids)",
+ $tac - $tic, scalar(keys %{$response9}));
+ $session->close();
+
map { $response->{$_} = $response1->{$_} } keys %{$response1};
map { $response->{$_} = $response2p->{$_} } keys %{$response2p};
map { $response->{$_} = $response2f->{$_} } keys %{$response2f};
@@ -613,6 +696,7 @@
map { $response->{$_} = $response6->{$_} } keys %{$response6};
map { $response->{$_} = $response7->{$_} } keys %{$response7};
map { $response->{$_} = $response8->{$_} } keys %{$response8};
+ map { $response->{$_} = $response9->{$_} } keys %{$response9};
map { $response->{$_} =~ s/^\s+//; $response->{$_} =~ s/\s+$//; }
keys %$response;
$self->{rawdata} = $response;
|
[-]
[+]
|
Added |
check_hpasm-4.3.tar.bz2/plugins-scripts/HP/Proliant/Component/AsrSubsystem
^
|
+(directory)
|
[-]
[+]
|
Added |
check_hpasm-4.3.tar.bz2/plugins-scripts/HP/Proliant/Component/AsrSubsystem.pm
^
|
@@ -0,0 +1,45 @@
+package HP::Proliant::Component::AsrSubsystem;
+our @ISA = qw(HP::Proliant::Component);
+
+use strict;
+use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
+
+sub new {
+ my $class = shift;
+ my %params = @_;
+ my $self = {
+ runtime => $params{runtime},
+ rawdata => $params{rawdata},
+ method => $params{method},
+ condition => $params{condition},
+ status => $params{status},
+ temperatures => [],
+ blacklisted => 0,
+ info => undef,
+ extendedinfo => undef,
+ };
+ bless $self, $class;
+ if ($self->{method} eq 'snmp') {
+ return HP::Proliant::Component::AsrSubsystem::SNMP->new(%params);
+ } elsif ($self->{method} eq 'cli') {
+ return HP::Proliant::Component::AsrSubsystem::CLI->new(%params);
+ } else {
+ die "unknown method";
+ }
+ return $self;
+}
+
+sub check {
+ my $self = shift;
+ my $errorfound = 0;
+ $self->add_info('checking ASR');
+ $self->overall_check();
+}
+
+sub dump {
+ my $self = shift;
+}
+
+
+1;
+
|
[-]
[+]
|
Added |
check_hpasm-4.3.tar.bz2/plugins-scripts/HP/Proliant/Component/AsrSubsystem/CLI.pm
^
|
@@ -0,0 +1,32 @@
+package HP::Proliant::Component::AsrSubsystem::CLI;
+our @ISA = qw(HP::Proliant::Component::AsrSubsystem);
+
+use strict;
+use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
+
+sub new {
+ my $class = shift;
+ my %params = @_;
+ my $self = {
+ runtime => $params{runtime},
+ rawdata => $params{rawdata},
+ blacklisted => 0,
+ info => undef,
+ extendedinfo => undef,
+ };
+ bless $self, $class;
+ $self->init(%params);
+ return $self;
+}
+
+sub init {
+ my $self = shift;
+ my %params = @_;
+}
+
+sub overall_check {
+ my $self = shift;
+ my %params = @_;
+}
+
+1;
|
[-]
[+]
|
Added |
check_hpasm-4.3.tar.bz2/plugins-scripts/HP/Proliant/Component/AsrSubsystem/SNMP.pm
^
|
@@ -0,0 +1,66 @@
+package HP::Proliant::Component::AsrSubsystem::SNMP;
+our @ISA = qw(HP::Proliant::Component::AsrSubsystem
+ HP::Proliant::Component::SNMP);
+
+use strict;
+use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
+
+sub new {
+ my $class = shift;
+ my %params = @_;
+ my $self = {
+ runtime => $params{runtime},
+ rawdata => $params{rawdata},
+ blacklisted => 0,
+ info => undef,
+ extendedinfo => undef,
+ };
+ bless $self, $class;
+ $self->overall_init(%params);
+ return $self;
+}
+
+sub overall_init {
+ my $self = shift;
+ my %params = @_;
+ my $snmpwalk = $params{rawdata};
+ my $cpqHeAsrStatus = "1.3.6.1.4.1.232.6.2.5.1.0";
+ my $cpqHeAsrStatusValue = {
+ 1 => "other",
+ 2 => "notAvailable",
+ 3 => "disabled",
+ 4 => "enabled",
+ };
+ my $cpqHeAsrCondition = "1.3.6.1.4.1.232.6.2.5.17.0";
+ my $cpqHeAsrConditionValue = {
+ 1 => "other",
+ 2 => "ok",
+ 3 => "degraded",
+ 4 => "failed",
+ };
+ $self->{asrcondition} = lc SNMP::Utils::get_object_value(
+ $snmpwalk, $cpqHeAsrCondition,
+ $cpqHeAsrConditionValue);
+ $self->{asrstatus} = lc SNMP::Utils::get_object_value(
+ $snmpwalk, $cpqHeAsrStatus,
+ $cpqHeAsrStatusValue);
+}
+
+sub overall_check {
+ my $self = shift;
+ my $result = 0;
+ $self->blacklist('asr', '');
+ if ($self->{asrstatus} and $self->{asrstatus} eq "enabled") {
+ my $info = sprintf 'ASR overall condition is %s', $self->{asrcondition};
+ if ($self->{asrcondition} eq "degraded") {
+ $self->add_message(WARNING, $info);
+ } elsif ($self->{asrcondition} eq "failed") {
+ $self->add_message(CRITICAL, $info);
+ }
+ $self->add_info($info);
+ } else {
+ $self->add_info('This system does not have ASR.');
+ }
+}
+
+1;
|
[-]
[+]
|
Changed |
check_hpasm-4.3.tar.bz2/plugins-scripts/HP/Proliant/Component/DiskSubsystem/Da/CLI.pm
^
|
@@ -45,6 +45,13 @@
$tmpcntl->{$slot}->{cpqDaCntlrIndex} = $cntlindex;
$tmpcntl->{$slot}->{cpqDaCntlrModel} = $1;
$tmpcntl->{$slot}->{cpqDaCntlrSlot} = $slot;
+ } elsif (/(MSA[\s\w]+)\s+in\s+(\w+)/) {
+ $incontroller = 1;
+ $slot = $2;
+ $cntlindex++;
+ $tmpcntl->{$slot}->{cpqDaCntlrIndex} = $cntlindex;
+ $tmpcntl->{$slot}->{cpqDaCntlrModel} = $1;
+ $tmpcntl->{$slot}->{cpqDaCntlrSlot} = $slot;
} elsif (/Controller Status: (\w+)/) {
$tmpcntl->{$slot}->{cpqDaCntlrBoardCondition} = lc $1;
$tmpcntl->{$slot}->{cpqDaCntlrCondition} = lc $1;
@@ -88,6 +95,10 @@
$slot = $2;
$cntlindex++;
$pdriveindex = 1;
+ } elsif (/(MSA[\s\w]+)\s+in\s+(\w+)/) {
+ $slot = $2;
+ $cntlindex++;
+ $pdriveindex = 1;
} elsif (/logicaldrive\s+(.+?)\s+\((.*)\)/) {
# logicaldrive 1 (683.5 GB, RAID 5, OK)
# logicaldrive 1 (683.5 GB, RAID 5, OK)
@@ -105,6 +116,7 @@
} elsif (/physicaldrive\s+(.+?)\s+\((.*)\)/) {
# physicaldrive 2:0 (port 2:id 0 , Parallel SCSI, 36.4 GB, OK)
# physicaldrive 2I:1:6 (port 2I:box 1:bay 6, SAS, 146 GB, OK)
+ # physicaldrive 1:1 (box 1:bay 1, Parallel SCSI, 146 GB, OK)
my $name = $1;
my($location, $type, $size, $status) = split(/,/, $2);
$status =~ s/^\s+//g;
@@ -117,6 +129,7 @@
$location{box} ||= 0;
$location{id} ||= $pdriveindex;
$location{bay} ||= $location{id};
+ $location{port} ||= $location{bay};
$tmppd->{$slot}->{$name}->{name} = lc $name;
$tmppd->{$slot}->{$name}->{cpqDaPhyDrvCntlrIndex} = $cntlindex;
$tmppd->{$slot}->{$name}->{cpqDaPhyDrvIndex} = $location{id};
@@ -131,6 +144,7 @@
$tmppd->{$slot}->{$name}->{$_} =~ s/\s+$//g;
$tmppd->{$slot}->{$name}->{$_} = lc $tmppd->{$slot}->{$name}->{$_};
}
+ $pdriveindex++;
}
}
@@ -189,6 +203,7 @@
my $info = shift;
return 1 if $info =~ /Parallel SCSI/;
return 1 if $info =~ /Smart Array/; # Trond: works fine on E200i, P400, E400
+ return 1 if $info =~ /MSA500/;
#return 1 if $info =~ /Smart Array (5|6)/;
#return 1 if $info =~ /Smart Array P400i/; # snmp sagt Da, trotz SAS in cli
#return 1 if $info =~ /Smart Array P410i/; # dto
|
[-]
[+]
|
Changed |
check_hpasm-4.3.tar.bz2/plugins-scripts/HP/Proliant/Component/DiskSubsystem/Sas.pm
^
|
@@ -69,6 +69,7 @@
sub check {
my $self = shift;
+ $self->blacklist('saco', $self->{cpqSasHbaSlot});
if ($self->{cpqSasHbaCondition} eq 'other') {
if (scalar(@{$self->{physical_drives}})) {
$self->add_message(CRITICAL,
@@ -154,6 +155,7 @@
sub check {
my $self = shift;
+ $self->blacklist('sald', $self->{name});
if ($self->{cpqSasLogDrvCondition} ne "ok") {
if ($self->{cpqSasLogDrvStatus} =~
/rebuild|recovering|expanding|queued/) {
@@ -211,6 +213,7 @@
sub check {
my $self = shift;
+ $self->blacklist('sapd', $self->{name});
if ($self->{cpqSasPhyDrvCondition} ne 'ok') {
$self->add_message(CRITICAL,
sprintf "physical drive %s is %s",
|
[-]
[+]
|
Added |
check_hpasm-4.3.tar.bz2/plugins-scripts/HP/Proliant/Component/EventSubsystem
^
|
+(directory)
|
[-]
[+]
|
Added |
check_hpasm-4.3.tar.bz2/plugins-scripts/HP/Proliant/Component/EventSubsystem.pm
^
|
@@ -0,0 +1,200 @@
+package HP::Proliant::Component::EventSubsystem;
+our @ISA = qw(HP::Proliant::Component);
+
+use strict;
+use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
+
+sub new {
+ my $class = shift;
+ my %params = @_;
+ my $self = {
+ runtime => $params{runtime},
+ rawdata => $params{rawdata},
+ method => $params{method},
+ condition => $params{condition},
+ status => $params{status},
+ events => [],
+ blacklisted => 0,
+ info => undef,
+ extendedinfo => undef,
+ };
+ bless $self, $class;
+ if ($self->{method} eq 'snmp') {
+ return HP::Proliant::Component::EventSubsystem::SNMP->new(%params);
+ } elsif ($self->{method} eq 'cli') {
+ return HP::Proliant::Component::EventSubsystem::CLI->new(%params);
+ } else {
+ die "unknown method";
+ }
+ return $self;
+}
+
+sub check {
+ my $self = shift;
+ my $errorfound = 0;
+ $self->add_info('checking events');
+ if (scalar (@{$self->{events}}) == 0) {
+ #$self->overall_check();
+ $self->add_info('no events found');
+ } else {
+ foreach (sort { $a->{cpqHeEventLogEntryNumber} <=> $b->{cpqHeEventLogEntryNumber}}
+ @{$self->{events}}) {
+ $_->check($self->{warningtime}, $self->{criticaltime});
+ }
+ }
+}
+
+sub dump {
+ my $self = shift;
+ foreach (@{$self->{events}}) {
+ $_->dump();
+ }
+}
+
+
+package HP::Proliant::Component::EventSubsystem::Event;
+our @ISA = qw(HP::Proliant::Component::EventSubsystem);
+
+use strict;
+use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
+
+{
+ our $interesting_events = {
+ # POST Error: 201-Memory Error Multi-bit error occurred during memory initialization, Board 1, Bank B. Bank containing DIMM(s) has been disabled..
+ # POST Error: 201-Memory Error Single-bit error occured during memory initialization, Board 1, DIMM 1. Bank containing DIMM(s) has been disabled..
+ # POST Error: 207-Memory initialization error on Memory Board 5 DIMM 7. The operating system may not have access to all of the memory installed in the system..
+ # POST Error: 207-Invalid Memory Configuration-Mismatched DIMMs within DIMM Bank Memory in Bank A Not Utilized..
+ 'POST Messages' => [
+ '201-Memory', '207-Memory'
+ ],
+ };
+}
+
+sub new {
+ my $class = shift;
+ my %params = @_;
+ my $self = {
+ runtime => $params{runtime},
+ cpqHeEventLogEntryNumber => $params{cpqHeEventLogEntryNumber},
+ cpqHeEventLogEntrySeverity => lc $params{cpqHeEventLogEntrySeverity},
+ cpqHeEventLogEntryClass => $params{cpqHeEventLogEntryClass},
+ cpqHeEventLogEntryCount => $params{cpqHeEventLogEntryCount} || 1,
+ cpqHeEventLogInitialTime => $params{cpqHeEventLogInitialTime},
+ cpqHeEventLogUpdateTime => $params{cpqHeEventLogUpdateTime},
+ cpqHeEventLogErrorDesc => $params{cpqHeEventLogErrorDesc},
+ blacklisted => 0,
+ info => undef,
+ extendedinfo => undef,
+ };
+ if (! $self->{cpqHeEventLogInitialTime}) {
+ $self->{cpqHeEventLogInitialTime} = $self->{cpqHeEventLogUpdateTime};
+ }
+ #
+ #
+ #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ # |warn |crit |now
+ #
+ #<----- ignore -------><----- warning ------><---------- critical --------->
+ #
+ # If we have --eventrange <warnlookback>/<critlookback>
+ # Very young events are shown as critical
+ # If the event gets older, it is shown as warning
+ # At some time, the event is no longer shown
+ # Without --eventrange the event is shown as critical until you manually repair it
+ if ($params{runtime}->{options}->{eventrange}) {
+ my ($warningrange, $criticalrange) = split(/\//, $params{runtime}->{options}->{eventrange});
+ if (! $criticalrange) {
+ $criticalrange = $warningrange;
+ }
+ if ($criticalrange =~ /^(\d+)[s]*$/) {
+ $criticalrange = $1;
+ } elsif ($criticalrange =~ /^(\d+)m$/) {
+ $criticalrange = $1 * 60;
+ } elsif ($criticalrange =~ /^(\d+)h$/) {
+ $criticalrange = $1 * 3600;
+ } elsif ($criticalrange =~ /^(\d+)d$/) {
+ $criticalrange = $1 * 3600 * 24;
+ } else {
+ die "range has to be <number>[smhd]";
+ }
+ if ($warningrange =~ /^(\d+)[s]*$/) {
+ $warningrange = $1;
+ } elsif ($warningrange =~ /^(\d+)m$/) {
+ $warningrange = $1 * 60;
+ } elsif ($warningrange =~ /^(\d+)h$/) {
+ $warningrange = $1 * 3600;
+ } elsif ($warningrange =~ /^(\d+)d$/) {
+ $warningrange = $1 * 3600 * 24;
+ } else {
+ die "range has to be <number>[smhd]";
+ }
+ $self->{warningtime} = time - $warningrange;
+ $self->{criticaltime} = time - $criticalrange;
+ } else {
+ $self->{warningtime} = 0;
+ $self->{criticaltime} = 0;
+ }
+ bless $self, $class;
+ return $self;
+}
+
+sub check {
+ my $self = shift;
+ $self->blacklist('evt', $self->{cpqHeEventLogEntryNumber});
+ # only check severity "critical" and "caution"
+ # optional: only check interesting events
+ # POST events only if they date maximum from reboot-5min
+ # younger than critical? -> critical
+ #
+ my $uptime = do { local (@ARGV, $/) = "/proc/uptime"; my $x = <>; close ARGV; $x };
+ # also watch 10 minutes of booting before the operating system starts ticking
+ my $boottime = time - int((split(/\s+/, $uptime))[0]) - 600;
+ $self->add_info(sprintf "Event: %d Added: %s Class: (%s) %s %s",
+ $self->{cpqHeEventLogEntryNumber},
+ $self->{cpqHeEventLogUpdateTime},
+ $self->{cpqHeEventLogEntryClass},
+ $self->{cpqHeEventLogEntrySeverity},
+ $self->{cpqHeEventLogErrorDesc});
+ if ($self->{cpqHeEventLogEntrySeverity} eq "caution" ||
+ $self->{cpqHeEventLogEntrySeverity} eq "critical") {
+ if ($self->{cpqHeEventLogUpdateTime} >= $boottime) {
+ foreach my $class (keys %{$HP::Proliant::Component::EventSubsystem::Event::interesting_events}) {
+ foreach my $pattern (@{$HP::Proliant::Component::EventSubsystem::Event::interesting_events->{$class}}) {
+ if ($self->{cpqHeEventLogErrorDesc} =~ /$pattern/) {
+ if ($self->{cpqHeEventLogUpdateTime} < $self->{warningtime}) {
+ # you didn't care for this problem too long.
+ # don't say i didn't warn you.
+ if (0) {
+ # auto-ack?
+ }
+ } elsif ($self->{cpqHeEventLogUpdateTime} < $self->{criticaltime}) {
+ $self->add_message(WARNING, $self->{info});
+ } else {
+ $self->add_message(CRITICAL, $self->{info});
+ }
+ }
+ }
+ }
+ }
+ } else {
+ # info, repair...
+ }
+}
+
+sub dump {
+ my $self = shift;
+ printf "[EVENT_%s]\n", $self->{cpqHeEventLogEntryNumber};
+ foreach (qw(cpqHeEventLogEntryNumber cpqHeEventLogEntrySeverity
+ cpqHeEventLogEntryCount cpqHeEventLogInitialTime
+ cpqHeEventLogUpdateTime cpqHeEventLogErrorDesc)) {
+ if ($_ =~ /.*Time$/) {
+ printf "%s: %s\n", $_, scalar localtime $self->{$_};
+ } else {
+ printf "%s: %s\n", $_, $self->{$_};
+ }
+ }
+ printf "info: %s\n\n", $self->{info};
+}
+
+1;
+
|
[-]
[+]
|
Added |
check_hpasm-4.3.tar.bz2/plugins-scripts/HP/Proliant/Component/EventSubsystem/CLI.pm
^
|
@@ -0,0 +1,90 @@
+package HP::Proliant::Component::EventSubsystem::CLI;
+our @ISA = qw(HP::Proliant::Component::EventSubsystem);
+
+use strict;
+use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
+use Time::Local;
+
+sub new {
+ my $class = shift;
+ my %params = @_;
+ my $self = {
+ runtime => $params{runtime},
+ rawdata => $params{rawdata},
+ events => [],
+ blacklisted => 0,
+ info => undef,
+ extendedinfo => undef,
+ };
+ bless $self, $class;
+ $self->init(%params);
+ return $self;
+}
+
+
+sub init {
+ my $self = shift;
+ my %params = @_;
+ my %tmpevent = (
+ runtime => $params{runtime},
+ );
+ my $inblock = 0;
+ foreach (grep(/^iml/, split(/\n/, $self->{rawdata}))) {
+ s/^iml\s*//g;
+ if (/^Event:\s+(\d+)\s+[\w]+:\s+(\d+)\/(\d+)\/(\d+)\s+(\d+):(\d+)/) {
+ # Event: 31 Added: 09/22/2011 05:11
+ # 1 2 3 4 5 6
+ $tmpevent{cpqHeEventLogEntryNumber} = $1;
+ if ($4 == 0) {
+ # Event: 29 Added: 00/00/0000 00:00
+ $tmpevent{cpqHeEventLogUpdateTime} = 0;
+ } else {
+ $tmpevent{cpqHeEventLogUpdateTime} = timelocal(0, $6, $5, $3, $2 - 1, $4);
+ }
+ $inblock = 1;
+ } elsif (/^(\w+):\s+(.*?)\s+\-\s+(.*)/) {
+ $tmpevent{cpqHeEventLogEntrySeverity} = $1;
+ $tmpevent{cpqHeEventLogEntryClass} = $2;
+ $tmpevent{cpqHeEventLogErrorDesc} = $3;
+ if ($tmpevent{cpqHeEventLogErrorDesc} =~ /.*?:\s+(\d+)/) {
+ $tmpevent{cpqHeEventLogEntryCode} = $1;
+ } else {
+ $tmpevent{cpqHeEventLogEntryCode} = 0;
+ }
+ } elsif (/^\s*$/) {
+ if ($inblock) {
+ $inblock = 0;
+ push(@{$self->{events}},
+ HP::Proliant::Component::EventSubsystem::Event->new(%tmpevent));
+ %tmpevent = (
+ runtime => $params{runtime},
+ );
+ }
+ }
+ }
+ if ($inblock) {
+ push(@{$self->{events}},
+ HP::Proliant::Component::EventSubsystem::Event->new(%tmpevent));
+ }
+ # repair dates
+ my $lasttime = 0;
+ for my $event (reverse @{$self->{events}}) {
+ if ($event->{cpqHeEventLogUpdateTime} != 0) {
+ $lasttime = $event->{cpqHeEventLogUpdateTime};
+ } else {
+ $event->{cpqHeEventLogUpdateTime} = $lasttime;
+ }
+ }
+ # maybe the most recent events had zero timestamps.
+ # fill them up with timestamps from the past.
+ for my $event (@{$self->{events}}) {
+ if ($event->{cpqHeEventLogUpdateTime} != 0) {
+ $lasttime = $event->{cpqHeEventLogUpdateTime};
+ } else {
+ $event->{cpqHeEventLogUpdateTime} = $lasttime;
+ }
+ }
+}
+
+1;
+
|
[-]
[+]
|
Added |
check_hpasm-4.3.tar.bz2/plugins-scripts/HP/Proliant/Component/EventSubsystem/SNMP.pm
^
|
@@ -0,0 +1,169 @@
+package HP::Proliant::Component::EventSubsystem::SNMP;
+our @ISA = qw(HP::Proliant::Component::EventSubsystem
+ HP::Proliant::Component::SNMP);
+
+use strict;
+use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
+use Time::Local;
+
+sub new {
+ my $class = shift;
+ my %params = @_;
+ my $self = {
+ runtime => $params{runtime},
+ rawdata => $params{rawdata},
+ events => [],
+ blacklisted => 0,
+ info => undef,
+ extendedinfo => undef,
+ };
+ bless $self, $class;
+ $self->overall_init(%params);
+ $self->init(%params);
+ return $self;
+}
+
+sub overall_init {
+ my $self = shift;
+ my %params = @_;
+ my $snmpwalk = $params{rawdata};
+ # overall
+ my $cpqHeEventLogSupported = '1.3.6.1.4.1.232.6.2.11.1';
+ my $cpqHeEventLogSupportedValue = {
+ 1 => 'other',
+ 2 => 'notSupported',
+ 3 => 'supported',
+ 4 => 'clear',
+ };
+ my $cpqHeEventLogCondition = '1.3.6.1.4.1.232.6.2.11.2';
+ my $cpqHeEventLogConditionValue = {
+ 1 => 'other',
+ 2 => 'ok',
+ 3 => 'degraded',
+ 4 => 'failed',
+ };
+ $self->{eventstatus} = lc SNMP::Utils::get_object_value(
+ $snmpwalk, $cpqHeEventLogCondition,
+ $cpqHeEventLogSupportedValue);
+}
+
+sub init {
+ my $self = shift;
+ my %params = @_;
+ my $snmpwalk = $self->{rawdata};
+ my $oids = {
+ cpqHeEventLogEntry => "1.3.6.1.4.1.232.6.2.11.3.1",
+ cpqHeEventLogEntryNumber => "1.3.6.1.4.1.232.6.2.11.3.1.1",
+ cpqHeEventLogEntrySeverity => "1.3.6.1.4.1.232.6.2.11.3.1.2",
+ cpqHeEventLogEntryClass => "1.3.6.1.4.1.232.6.2.11.3.1.3",
+ cpqHeEventLogEntryCode => "1.3.6.1.4.1.232.6.2.11.3.1.4",
+ cpqHeEventLogEntryCount => "1.3.6.1.4.1.232.6.2.11.3.1.5",
+ cpqHeEventLogInitialTime => "1.3.6.1.4.1.232.6.2.11.3.1.6",
+ cpqHeEventLogUpdateTime => "1.3.6.1.4.1.232.6.2.11.3.1.7",
+ cpqHeEventLogErrorDesc => "1.3.6.1.4.1.232.6.2.11.3.1.8",
+
+ cpqHeEventLogEntryClassValue => {
+ # 2 Fan Failure (Fan 1, Location I/O Board)
+ # Internal Storage System Overheating (Slot 0, Zone 1, Location Storage, Temperature Unknown)
+ # System Fans Not Redundant (Location I/O Board)
+ # MY MUSTARD: only critical events should lead to an alert, if at all. The caution events mean "loss of redundancy".
+ # We monitor temperatures and fan status anyway.
+ #2 => "",
+ # 3 Corrected Memory Error threshold exceeded (System Memory, Memory Module 1)
+ # Uncorrectable Memory Error detected by ROM-based memory validation (Board 1, Memory Module 4)
+ # MY MUSTARD: threshold exceeded is caution. Uncorrectable errors are critical. Both should be detected anyway.
+ 3 => "Main Memory",
+ # 4 Accelerator Cache Memory Parity Error (Socket 1)
+ #4 => "",
+ # 5 Processor Correctable error threshold exceeded (Board 0, Processor 2)
+ #5 => "",
+ # 6 Unrecoverable Intermodule Bus error (Error code 0x00000000)
+ #6 => "",
+ # 8 PCI Bus Error (Slot 0, Bus 0, Device 0, Function 0)
+ 8 => "PCI Bus",
+ # 10 1720-S.M.A.R.T. Hard Drive Detects Imminent Failure
+ # POST Error: 201-Memory Error Multi-bit error occurred during memory initialization, Board 1, Bank B. Bank containing DIMM(s) has been disabled..
+ # POST Error: 201-Memory Error Single-bit error occured during memory initialization, Board 1, DIMM 1. Bank containing DIMM(s) has been disabled..
+ # POST Error: 207-Memory Configuration Warning - memory boards should be installed sequentially.
+ # POST Error: 210-Memory Board Failure on board 4.
+ # POST Error: 210-Memory Board Power Fault on board 3.
+ # POST Error: 207-Memory initialization error on Memory Board 5 DIMM 7. The operating system may not have access to all of the memory installed in the system.. # POST Error: 207-Invalid Memory Configuration-Mismatched DIMMs within DIMM Bank Memory in Bank A Not Utilized..
+ 10 => "POST Messages",
+ 11 => "Power Subsystem",
+ 13 => "ASR",
+ # 14 Automatic Operating System Shutdown Initiated Due to Overheat Condition
+ # Automatic Operating System Shutdown Initiated Due to Fan Failure
+ # Blue Screen Trap (BugCheck, STOP: 0x00000050 (0x9CB2C5B4, 0x00000001, 0x00000004, 0x00000000))
+ # Operating System failure (BugCheck, STOP: 0x000000AB (0x00000005, 0x00000488, 0x00000000, 0x00000002))
+ 14 => "OS Class",
+ # 15 Unknown Event (Class 15, Code 255)
+ #15 => "",
+ # 17 Network Adapter Link Down (Slot 0, Port 4)
+ # Network Adapters Redundancy Reduced (Slot 0, Port 1)
+ 17 => "Network Adapter",
+ # 19 Drive Array Device Failure (Slot 0, Bus 2, Bay 4)
+ # Internal SAS Enclosure Device Failure (Bay 1, Box 1, Port 2I, Slot 1)
+ #19 => "",
+ # 20 An Unrecoverable System Error (NMI) has occurred
+ # Unrecoverable System Error has occurred (Error code 0x01AE0E2F, 0x00000000)
+ 20 => "Unrecoverable System Error",
+ # 32 ROM flashed (New version: 01/09/2008)
+ 32 => "System Revision",
+ # 33 IML Cleared (Administrator)
+ # IML cleared through HP ProLiant Health Agent (cmahealthd)
+ # Insight Diagnostics Note: Physisches Festplattenlaufwerk 5, Controller Steckplatz 0-Diagnosis: Fehlgeschlagen
+ 33 => "Maintenance Note",
+ # 34 New Chassis Connected (Enclosure Address 27AC)
+ # Loss Of Chassis Connectivity (Enclosure Serial Number 8004******)
+ # Server Blade Enclosure Server Blade Inserted (Slot 16, Enclosure Address 0000)
+ #34 => "",
+ },
+ cpqHeEventLogEntrySeverityValue => {
+ 2 => "informational",
+ 3 => "infoWithAlert",
+ 6 => "repaired",
+ 9 => "caution",
+ 15 => "critical",
+ },
+ # Time
+ # 07 D8 09 02 11 11
+ };
+ # INDEX { cpqHeEventLogEntryNumber }
+ foreach ($self->get_entries($oids, 'cpqHeEventLogEntry')) {
+ if ($_->{cpqHeEventLogInitialTime} =~ /^(([0-9a-fA-F]{2})( [0-9a-fA-F]{2})*)\s*$/) {
+ $_->{cpqHeEventLogInitialTime} =~ s/ //;
+ my ($year, $month, $day, $hour, $min) = map { hex($_) } split(/\s+/, $_->{cpqHeEventLogInitialTime});
+ $_->{cpqHeEventLogInitialTime} = timelocal(0, $min, $hour, $day, $month - 1, $year);
+ }
+ if ($_->{cpqHeEventLogUpdateTime} =~ /^(([0-9a-fA-F]{2})( [0-9a-fA-F]{2})*)\s*$/) {
+ $_->{cpqHeEventLogUpdateTime} =~ s/ //;
+ my ($year, $month, $day, $hour, $min) = map { hex($_) } split(/\s+/, $_->{cpqHeEventLogUpdateTime});
+ $_->{cpqHeEventLogUpdateTime} = timelocal(0, $min, $hour, $day, $month - 1, $year);
+ }
+ if ($_->{cpqHeEventLogErrorDesc} =~ /^(([0-9a-fA-F]{2})(\s+[0-9a-fA-F]{2})*)\s*$/) {
+ $_->{cpqHeEventLogErrorDesc} = join "", map { chr($_) } map { if (hex($_) > 127) { 20; } else { hex($_) } } split(/\s+/, $_->{cpqHeEventLogErrorDesc});
+ }
+ push(@{$self->{events}},
+ HP::Proliant::Component::EventSubsystem::Event->new(%{$_}));
+ }
+}
+
+sub overall_check {
+ my $self = shift;
+ my $result = 0;
+ $self->blacklist('oe', '');
+ if ($self->{eventstatus}) {
+ if ($self->{eventstatus} eq "ok") {
+ $result = 0;
+ $self->add_info('eventlog system is ok');
+ } else {
+ $result = 0;
+ $self->add_info(sprintf "eventlog system is %s", $self->{eventstatus});
+ }
+ } else {
+ $result = 0;
+ $self->add_info('no event status found');
+ }
+}
+
+1;
|
[-]
[+]
|
Changed |
check_hpasm-4.3.tar.bz2/plugins-scripts/HP/Proliant/Component/MemorySubsystem/CLI.pm
^
|
@@ -55,6 +55,22 @@
runtime => $params{runtime},
);
}
+ } elsif (/(\d+)\s+(\d+)\s+(\w+)\s+(0x\w+)\s+(0x\w+)\s+(\d+[MGT]B)\s+(\d+MHz)\s+(\w+)/) {
+ $tmpdimm{cartridge} = $1;
+ $tmpdimm{module} = $2;
+ $tmpdimm{status} = lc $3 eq 'yes' ? 'present' :
+ lc $3 eq 'no' ? 'notPresent' : 'other';
+ my $formfactor = $4;
+ my $memorytype = $5;
+ my $memorysize = $6;
+ my $memoryspeed = $7;
+ $tmpdimm{condition} = lc $8 =~ /degraded/ ? 'degraded' :
+ lc $8 eq 'ok' ? 'ok' : lc $8 =~ /n\/a/ ? 'n/a' : 'other';
+ $memorysize =~ /(\d+)([MGT]B)/;
+ $tmpdimm{size} = $1 * (lc $2 eq 'mb' ? 1024*1024 :
+ lc $2 eq 'gb' ? 1024*1024*1024 : 1);
+ push(@{$self->{dimms}},
+ HP::Proliant::Component::MemorySubsystem::Dimm->new(%tmpdimm));
}
}
if ($inblock) {
|
[-]
[+]
|
Changed |
check_hpasm-4.3.tar.bz2/plugins-scripts/HP/Proliant/Component/PowersupplySubsystem.pm
^
|
@@ -109,13 +109,21 @@
sub dump {
my $self = shift;
- printf "[PS_%s]\n", $self->{cpqHeFltTolPowerSupplyBay};
- foreach (qw(cpqHeFltTolPowerSupplyBay cpqHeFltTolPowerSupplyChassis
- cpqHeFltTolPowerSupplyPresent cpqHeFltTolPowerSupplyCondition
- cpqHeFltTolPowerSupplyRedundant)) {
- printf "%s: %s\n", $_, $self->{$_};
+ if (exists $self->{cpqHeFltTolPowerSupplyBay}) {
+ printf "[PS_%s]\n", $self->{cpqHeFltTolPowerSupplyBay};
+ foreach (qw(cpqHeFltTolPowerSupplyBay cpqHeFltTolPowerSupplyChassis
+ cpqHeFltTolPowerSupplyPresent cpqHeFltTolPowerSupplyCondition
+ cpqHeFltTolPowerSupplyRedundant)) {
+ printf "%s: %s\n", $_, $self->{$_};
+ }
+ } elsif (exists $self->{cpqHePowerConvChassis}) {
+ printf "[PS_%s]\n", ($self->{cpqHePowerConvChassis} ? $self->{cpqHePowerConvChassis}.":" : "").$self->{cpqHePowerConvIndex};
+ foreach (qw(cpqHePowerConvIndex cpqHePowerConvPresent cpqHePowerConvRedundant cpqHePowerConvCondition)) {
+ printf "%s: %s\n", $_, $self->{$_};
+ }
}
printf "info: %s\n\n", $self->{info};
}
+
1;
|
[-]
[+]
|
Changed |
check_hpasm-4.3.tar.bz2/plugins-scripts/HP/Proliant/Component/PowersupplySubsystem/SNMP.pm
^
|
@@ -58,7 +58,7 @@
$oids = {
cpqHePowerConvEntry => "1.3.6.1.4.1.232.6.2.13.3.1",
- cpqHePowerConvChassis => "1.3.6.1.4.1.232.6.2.13.3.1",
+ cpqHePowerConvChassis => "1.3.6.1.4.1.232.6.2.13.3.1.1",
cpqHePowerConvIndex => "1.3.6.1.4.1.232.6.2.13.3.1.2",
cpqHePowerConvPresent => "1.3.6.1.4.1.232.6.2.13.3.1.3",
cpqHePowerConvRedundant => "1.3.6.1.4.1.232.6.2.13.3.1.6",
@@ -83,10 +83,10 @@
};
# INDEX { cpqHePowerConvChassis cpqHePowerConvIndex }
- #foreach ($self->get_entries($oids, 'cpqHePowerConvEntry')) {
- #push(@{$self->{powersupplies}},
- # HP::Proliant::Component::PowersupplySubsystem::Powersupply->new(%{$_}));
- #}
+ foreach ($self->get_entries($oids, 'cpqHePowerConvEntry')) {
+ push(@{$self->{powersupplies}},
+ HP::Proliant::Component::PowersupplySubsystem::Powersupply->new(%{$_}));
+ }
# keine ahnung, was man damit machen kann
}
|
[-]
[+]
|
Changed |
check_hpasm-4.3.tar.bz2/plugins-scripts/HP/Proliant/Component/TemperatureSubsystem.pm
^
|
@@ -120,6 +120,12 @@
$self->{cpqHeTemperature}, $self->{cpqHeTemperatureUnits},
$self->{cpqHeTemperatureThreshold});
$self->add_message(CRITICAL, $self->{info});
+ } elsif ($self->{cpqHeTemperature} < 0) {
+ # #21 SCSI_BACKPLANE_ZONE -1C/31F 60C/140F OK - can't be true
+ $self->add_info(sprintf "%d %s temperature too low (%d%s)",
+ $self->{cpqHeTemperatureIndex}, $self->{cpqHeTemperatureLocale},
+ $self->{cpqHeTemperature}, $self->{cpqHeTemperatureUnits});
+ $self->add_message(CRITICAL, $self->{info});
} else {
$self->add_info(sprintf "%d %s temperature is %d%s (%d max)",
$self->{cpqHeTemperatureIndex}, $self->{cpqHeTemperatureLocale},
|
[-]
[+]
|
Changed |
check_hpasm-4.3.tar.bz2/plugins-scripts/HP/Proliant/Component/TemperatureSubsystem/CLI.pm
^
|
@@ -26,7 +26,7 @@
my $tempcnt = 1;
foreach (grep(/^temp/, split(/\n/, $params{rawdata}))) {
s/^temp\s*//g;
- if (/^#(\d+)\s+([\w_\/\-#]+)\s+(\d+)C\/(\d+)F\s+(\d+)C\/(\d+)F/) {
+ if (/^#(\d+)\s+([\w_\/\-#]+)\s+(-*\d+)C\/(\d+)F\s+(\d+)C\/(\d+)F/) {
my %params = ();
$params{runtime} = $self->{runtime};
$params{cpqHeTemperatureChassis} = 1;
|
[-]
[+]
|
Changed |
check_hpasm-4.3.tar.bz2/plugins-scripts/HP/Proliant/Component/TemperatureSubsystem/SNMP.pm
^
|
@@ -17,10 +17,28 @@
extendedinfo => undef,
};
bless $self, $class;
+ $self->overall_init(%params);
$self->init(%params);
return $self;
}
+sub overall_init {
+ my $self = shift;
+ my %params = @_;
+ my $snmpwalk = $params{rawdata};
+ # overall
+ my $cpqHeThermalTempStatus = '1.3.6.1.4.1.232.6.2.6.3.0';
+ my $cpqHeThermalTempStatusValue = {
+ 1 => 'other',
+ 2 => 'ok',
+ 3 => 'degraded',
+ 4 => 'failed',
+ };
+ $self->{tempstatus} = lc SNMP::Utils::get_object_value(
+ $snmpwalk, $cpqHeThermalTempStatus,
+ $cpqHeThermalTempStatusValue);
+}
+
sub init {
my $self = shift;
my %params = @_;
@@ -62,4 +80,29 @@
}
}
+sub overall_check {
+ my $self = shift;
+ my $result = 0;
+ $self->blacklist('ots', '');
+ if ($self->{tempstatus}) {
+ if ($self->{tempstatus} eq "ok") {
+ $result = 0;
+ $self->add_info('all temp sensors are within normal operating range');
+ } elsif ($self->{tempstatus} eq "degraded") {
+ $result = 1;
+ $self->add_info('a temp sensor is outside of normal operating range');
+ } elsif ($self->{tempstatus} eq "failed") {
+ $result = 2;
+ $self->add_info('a temp sensor detects a condition that could permanently
+damage the system');
+ } elsif ($self->{tempstatus} eq "other") {
+ $result = 0;
+ $self->add_info('temp sensing is not supported by this system or driver');
+ }
+ } else {
+ $result = 0;
+ $self->add_info('no global temp status found');
+ }
+}
+
1;
|
[-]
[+]
|
Changed |
check_hpasm-4.3.tar.bz2/plugins-scripts/HP/Server.pm
^
|
@@ -38,7 +38,9 @@
} elsif ($self->{productname} =~ /PROLIANT 4LEE/) {
bless $self, 'HP::Storage';
$self->trace(3, 'using HP::Storage');
- } elsif ($self->{productname} =~ /X\d+ Network Storage/) {
+ } elsif ($self->{productname} =~ /X\d+[\s\w]* Network Storage/) {
+ # HP X1600 Network Storage System
+ # HP X1600 G2 Network Storage System
bless $self, 'HP::Proliant::SNMP';
$self->trace(3, 'using HP::Proliant::SNMP');
} elsif ($self->{productname} =~ /Storage/) { # fake
@@ -88,18 +90,31 @@
close WALK;
} else {
open(MESS, $self->{runtime}->{plugin}->opts->snmpwalk);
+ my $in_hex_string = 0;
+ my $hex_oid = 0;
while(<MESS>) {
- # SNMPv2-SMI::enterprises.232.6.2.6.7.1.3.1.4 = INTEGER: 6
- if (/^.*?\.(232\.[\d\.]+) = .*?: (\-*\d+)/) {
+ chomp;
+ if ($in_hex_string && /^(([0-9a-fA-F]{2})( [0-9a-fA-F]{2})*)\s*$/) {
+ $response->{$hex_oid} .= " ".$1;
+ } elsif (/^.*?\.(232\.[\d\.]+) = .*?: (\-*\d+)\s*$/) {
+ # SNMPv2-SMI::enterprises.232.6.2.6.7.1.3.1.4 = INTEGER: 6
$response->{'1.3.6.1.4.1.'.$1} = $2;
+ $in_hex_string = 0;
} elsif (/^.*?\.(232\.[\d\.]+) = .*?: "(.*?)"/) {
$response->{'1.3.6.1.4.1.'.$1} = $2;
$response->{'1.3.6.1.4.1.'.$1} =~ s/\s+$//;
- } if (/^.*?\.(232\.[\d\.]+) = (\-*\d+)/) {
+ $in_hex_string = 0;
+ } elsif (/^.*?\.(232\.[\d\.]+) = (\-*\d+)/) {
$response->{'1.3.6.1.4.1.'.$1} = $2;
+ $in_hex_string = 0;
} elsif (/^.*?\.(232\.[\d\.]+) = "(.*?)"/) {
$response->{'1.3.6.1.4.1.'.$1} = $2;
$response->{'1.3.6.1.4.1.'.$1} =~ s/\s+$//;
+ $in_hex_string = 0;
+ } elsif (/^.*?\.(232\.[\d\.]+) = Hex-STRING: (.*)/) {
+ $response->{'1.3.6.1.4.1.'.$1} = $2;
+ $in_hex_string = 1;
+ $hex_oid = '1.3.6.1.4.1.'.$1;
}
}
close MESS;
@@ -141,7 +156,7 @@
my ($session, $error) = Net::SNMP->session(%params);
$self->{session} = $session;
if (! defined $session) {
- $self->{plugin}->add_message(CRITICAL, 'cannot create session object');
+ $self->add_message(CRITICAL, 'cannot create session object (maybe wrong hostname)');
$self->trace(1, Data::Dumper::Dumper(\%params));
} else {
my $sysUpTime = '1.3.6.1.2.1.1.3.0';
@@ -291,6 +306,13 @@
}
}
+sub remove_message {
+ my $self = shift;
+ my $level = shift;
+ my $message = shift;
+ $self->{runtime}->{plugin}->remove_message($level) ;
+}
+
sub has_failed {
my $self = shift;
return $self->{failed};
|
[-]
[+]
|
Changed |
check_hpasm-4.3.tar.bz2/plugins-scripts/Makefile.am
^
|
@@ -14,6 +14,9 @@
EXTRA_MODULES=\
Nagios/MiniPlugin.pm \
HP/SNMP/Utils.pm \
+ HP/Proliant/Component/EventSubsystem.pm \
+ HP/Proliant/Component/EventSubsystem/CLI.pm \
+ HP/Proliant/Component/EventSubsystem/SNMP.pm \
HP/Proliant/Component/PowersupplySubsystem.pm \
HP/Proliant/Component/PowersupplySubsystem/CLI.pm \
HP/Proliant/Component/PowersupplySubsystem/SNMP.pm \
@@ -29,6 +32,9 @@
HP/Proliant/Component/MemorySubsystem/CLI.pm \
HP/Proliant/Component/MemorySubsystem/SNMP.pm \
HP/Proliant/Component/MemorySubsystem.pm \
+ HP/Proliant/Component/AsrSubsystem/CLI.pm \
+ HP/Proliant/Component/AsrSubsystem/SNMP.pm \
+ HP/Proliant/Component/AsrSubsystem.pm \
HP/Proliant/Component/SNMP.pm \
HP/Proliant/Component/DiskSubsystem/Da/CLI.pm \
HP/Proliant/Component/DiskSubsystem/Da/SNMP.pm \
|
[-]
[+]
|
Changed |
check_hpasm-4.3.tar.bz2/plugins-scripts/Makefile.in
^
|
@@ -138,6 +138,9 @@
EXTRA_MODULES = \
Nagios/MiniPlugin.pm \
HP/SNMP/Utils.pm \
+ HP/Proliant/Component/EventSubsystem.pm \
+ HP/Proliant/Component/EventSubsystem/CLI.pm \
+ HP/Proliant/Component/EventSubsystem/SNMP.pm \
HP/Proliant/Component/PowersupplySubsystem.pm \
HP/Proliant/Component/PowersupplySubsystem/CLI.pm \
HP/Proliant/Component/PowersupplySubsystem/SNMP.pm \
@@ -153,6 +156,9 @@
HP/Proliant/Component/MemorySubsystem/CLI.pm \
HP/Proliant/Component/MemorySubsystem/SNMP.pm \
HP/Proliant/Component/MemorySubsystem.pm \
+ HP/Proliant/Component/AsrSubsystem/CLI.pm \
+ HP/Proliant/Component/AsrSubsystem/SNMP.pm \
+ HP/Proliant/Component/AsrSubsystem.pm \
HP/Proliant/Component/SNMP.pm \
HP/Proliant/Component/DiskSubsystem/Da/CLI.pm \
HP/Proliant/Component/DiskSubsystem/Da/SNMP.pm \
@@ -252,7 +258,7 @@
distdir: $(DISTFILES)
- $(mkdir_p) $(distdir)/HP $(distdir)/HP/BladeSystem $(distdir)/HP/BladeSystem/Component $(distdir)/HP/BladeSystem/Component/CommonEnclosureSubsystem $(distdir)/HP/Proliant $(distdir)/HP/Proliant/Component $(distdir)/HP/Proliant/Component/CpuSubsystem $(distdir)/HP/Proliant/Component/DiskSubsystem $(distdir)/HP/Proliant/Component/DiskSubsystem/Da $(distdir)/HP/Proliant/Component/DiskSubsystem/Fca $(distdir)/HP/Proliant/Component/DiskSubsystem/Ide $(distdir)/HP/Proliant/Component/DiskSubsystem/Sas $(distdir)/HP/Proliant/Component/DiskSubsystem/Scsi $(distdir)/HP/Proliant/Component/FanSubsystem $(distdir)/HP/Proliant/Component/MemorySubsystem $(distdir)/HP/Proliant/Component/PowersupplySubsystem $(distdir)/HP/Proliant/Component/TemperatureSubsystem $(distdir)/HP/SNMP $(distdir)/Nagios
+ $(mkdir_p) $(distdir)/HP $(distdir)/HP/BladeSystem $(distdir)/HP/BladeSystem/Component $(distdir)/HP/BladeSystem/Component/CommonEnclosureSubsystem $(distdir)/HP/Proliant $(distdir)/HP/Proliant/Component $(distdir)/HP/Proliant/Component/AsrSubsystem $(distdir)/HP/Proliant/Component/CpuSubsystem $(distdir)/HP/Proliant/Component/DiskSubsystem $(distdir)/HP/Proliant/Component/DiskSubsystem/Da $(distdir)/HP/Proliant/Component/DiskSubsystem/Fca $(distdir)/HP/Proliant/Component/DiskSubsystem/Ide $(distdir)/HP/Proliant/Component/DiskSubsystem/Sas $(distdir)/HP/Proliant/Component/DiskSubsystem/Scsi $(distdir)/HP/Proliant/Component/EventSubsystem $(distdir)/HP/Proliant/Component/FanSubsystem $(distdir)/HP/Proliant/Component/MemorySubsystem $(distdir)/HP/Proliant/Component/PowersupplySubsystem $(distdir)/HP/Proliant/Component/TemperatureSubsystem $(distdir)/HP/SNMP $(distdir)/Nagios
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
|
[-]
[+]
|
Changed |
check_hpasm-4.3.tar.bz2/plugins-scripts/Nagios/MiniPlugin.pm
^
|
@@ -70,6 +70,14 @@
push @{$self->{messages}->{$code}}, @messages;
}
+sub remove_message {
+ my $self = shift;
+ my ($code, @messages) = @_;
+ $code = (qw(ok warning critical unknown))[$code] if $code =~ /^\d+$/;
+ $code = lc $code;
+ pop @{$self->{messages}->{$code}};
+}
+
sub add_perfdata {
my ($self, %args) = @_;
my $str = $args{label}.'='.$args{value};
|
[-]
[+]
|
Changed |
check_hpasm-4.3.tar.bz2/plugins-scripts/check_hpasm.pl
^
|
@@ -52,6 +52,13 @@
required => 0,
);
$plugin->add_arg(
+ spec => 'eventrange=s',
+ help => '--eventrange=<warningrange>/<criticalrange>
+ Period of time before critical IML events respecively become warnings or vanish
+ A range is descibed as a number and a unit (s, m, h, d), e.g. --eventrange 1h/20m',
+ required => 0,
+);
+$plugin->add_arg(
spec => 'perfdata=s',
help => '--perfdata=[short]
Output performance data. If your performance data string becomes
@@ -163,6 +170,7 @@
ignore_fan_redundancy => $plugin->opts->get('ignore-fan-redundancy'),
ignore_dimms => $plugin->opts->get('ignore-dimms'),
customthresholds => $plugin->opts->get('customthresholds'),
+ eventrange => $plugin->opts->get('eventrange'),
blacklist => $plugin->opts->get('blacklist'),
celsius => $CELSIUS,
perfdata => $PERFDATA,
|