check_nwc_health: Import new upstream 3.1
This commit is contained in:
parent
5dba34f0cb
commit
10325a164b
|
@ -2,6 +2,21 @@
|
|||
# Changelog of the check_nwc_health plugin #
|
||||
############################################
|
||||
|
||||
2014-09-26 3.1
|
||||
- add Clavister Firewall (Thanks Dirk Goetz)
|
||||
- fix GLPluginSNMP, all timeout-like errors are UNKNOWN
|
||||
- allow warningx/criticalx to override cisco sensor thresholds
|
||||
|
||||
2014-09-55 3.0.4
|
||||
- bugfix in glplugin (tmp-file-paths wrong under epn) (Thanks Sven Nierlein)
|
||||
|
||||
2014-09-15 3.0.3.9
|
||||
- bugfix in bgp error states (Thanks Matthias Gallinger)
|
||||
- bugfix in f5 pools (Thanks Sven Nierlein)
|
||||
|
||||
2014-08-28 3.0.3.8
|
||||
- bugfix in interface-usage/ifspeed (Thanks Matthias Gallinger)
|
||||
|
||||
2014-08-26 3.0.3.7
|
||||
- bugfix in glpluginsnmp (undef errors with loadbalacer index)
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
#! /bin/sh
|
||||
# From configure.ac .
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.69 for check_nwc_health 3.0.3.7.
|
||||
# Generated by GNU Autoconf 2.69 for check_nwc_health 3.1.
|
||||
#
|
||||
#
|
||||
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
|
||||
|
@ -577,8 +577,8 @@ MAKEFLAGS=
|
|||
# Identity of this package.
|
||||
PACKAGE_NAME='check_nwc_health'
|
||||
PACKAGE_TARNAME='check_nwc_health'
|
||||
PACKAGE_VERSION='3.0.3.7'
|
||||
PACKAGE_STRING='check_nwc_health 3.0.3.7'
|
||||
PACKAGE_VERSION='3.1'
|
||||
PACKAGE_STRING='check_nwc_health 3.1'
|
||||
PACKAGE_BUGREPORT=''
|
||||
PACKAGE_URL=''
|
||||
|
||||
|
@ -1228,7 +1228,7 @@ if test "$ac_init_help" = "long"; then
|
|||
# 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_nwc_health 3.0.3.7 to adapt to many kinds of systems.
|
||||
\`configure' configures check_nwc_health 3.1 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
|
@ -1299,7 +1299,7 @@ fi
|
|||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of check_nwc_health 3.0.3.7:";;
|
||||
short | recursive ) echo "Configuration of check_nwc_health 3.1:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
|
@ -1385,7 +1385,7 @@ fi
|
|||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
check_nwc_health configure 3.0.3.7
|
||||
check_nwc_health configure 3.1
|
||||
generated by GNU Autoconf 2.69
|
||||
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
|
@ -1402,7 +1402,7 @@ cat >config.log <<_ACEOF
|
|||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by check_nwc_health $as_me 3.0.3.7, which was
|
||||
It was created by check_nwc_health $as_me 3.1, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
|
@ -2265,7 +2265,7 @@ fi
|
|||
|
||||
# Define the identity of the package.
|
||||
PACKAGE='check_nwc_health'
|
||||
VERSION='3.0.3.7'
|
||||
VERSION='3.1'
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
|
@ -3351,7 +3351,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
|||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by check_nwc_health $as_me 3.0.3.7, which was
|
||||
This file was extended by check_nwc_health $as_me 3.1, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
|
@ -3404,7 +3404,7 @@ _ACEOF
|
|||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||
ac_cs_version="\\
|
||||
check_nwc_health config.status 3.0.3.7
|
||||
check_nwc_health config.status 3.1
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
|
@ -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_nwc_health,3.0.3.7)
|
||||
AC_INIT(check_nwc_health,3.1)
|
||||
AM_INIT_AUTOMAKE([1.9 tar-pax])
|
||||
AC_CANONICAL_HOST
|
||||
|
|
@ -179,7 +179,7 @@ sub check {
|
|||
} else {
|
||||
$self->{bgpPeerRemoteAsImportant} = 1;
|
||||
}
|
||||
if ($self->{bgpPeerState} eq "established" || $self->{bgpPeerState} eq "idle") {
|
||||
if ($self->{bgpPeerState} eq "established") {
|
||||
$self->add_ok(sprintf "peer %s (AS%s) state is %s since %s",
|
||||
$self->{bgpPeerRemoteAddr},
|
||||
$self->{bgpPeerRemoteAs}.$self->{bgpPeerRemoteAsName},
|
|
@ -31,6 +31,7 @@ sub init {
|
|||
package Classes::Cisco::CISCOENTITYSENSORMIB::Component::SensorSubsystem::Sensor;
|
||||
our @ISA = qw(GLPlugin::SNMP::TableItem);
|
||||
use strict;
|
||||
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
|
||||
|
||||
sub finish {
|
||||
my $self = shift;
|
||||
|
@ -58,13 +59,10 @@ sub check {
|
|||
return;
|
||||
} elsif ($self->{entSensorStatus} eq "unavailable") {
|
||||
return;
|
||||
} elsif (scalar(grep { $_->{entSensorThresholdEvaluation} eq "true" }
|
||||
@{$self->{thresholds}})) {
|
||||
$self->add_critical(sprintf "%s sensor %s threshold evaluation is true",
|
||||
$self->{entSensorType},
|
||||
$self->{entPhysicalIndex});
|
||||
} else {
|
||||
}
|
||||
my $label = sprintf('sens_%s_%s', $self->{entSensorType}, $self->{entPhysicalIndex});
|
||||
my $warningx = ($self->get_thresholds(metric => $label))[0];
|
||||
my $criticalx = ($self->get_thresholds(metric => $label))[1];
|
||||
if (scalar(@{$self->{thresholds}} == 2)) {
|
||||
# reparaturlauf
|
||||
foreach my $idx (0..1) {
|
||||
|
@ -83,19 +81,90 @@ sub check {
|
|||
my $critical = (map { $_->{entSensorThresholdValue} }
|
||||
grep { $_->{entSensorThresholdSeverity} eq "major" }
|
||||
@{$self->{thresholds}})[0];
|
||||
$self->set_thresholds(
|
||||
metric => $label,
|
||||
warning => $warning, critical => $critical
|
||||
);
|
||||
if ((defined($criticalx) &&
|
||||
$self->check_thresholds(metric => $label, value => $self->{entSensorValue}) == CRITICAL) ||
|
||||
(! defined($criticalx) &&
|
||||
grep { $_->{entSensorThresholdEvaluation} eq "true" }
|
||||
grep { $_->{entSensorThresholdSeverity} eq "major" } @{$self->{thresholds}})) {
|
||||
# eigener schwellwert hat vorrang
|
||||
$self->add_critical(sprintf "%s sensor %s threshold evaluation is true (value: %s, major threshold: %s)",
|
||||
$self->{entSensorType},
|
||||
$self->{entPhysicalIndex},
|
||||
$self->{entSensorValue},
|
||||
defined($criticalx) ? $criticalx : $critical
|
||||
);
|
||||
} elsif ((defined($warningx) &&
|
||||
$self->check_thresholds(metric => $label, value => $self->{entSensorValue}) == WARNING) ||
|
||||
(! defined($warningx) &&
|
||||
grep { $_->{entSensorThresholdEvaluation} eq "true" }
|
||||
grep { $_->{entSensorThresholdSeverity} eq "minor" } @{$self->{thresholds}})) {
|
||||
$self->add_warning(sprintf "%s sensor %s threshold evaluation is true (value: %s, minor threshold: %s)",
|
||||
$self->{entSensorType},
|
||||
$self->{entPhysicalIndex},
|
||||
$self->{entSensorValue},
|
||||
defined($warningx) ? $warningx : $warning
|
||||
);
|
||||
}
|
||||
$self->add_perfdata(
|
||||
label => sprintf('sens_%s_%s', $self->{entSensorType}, $self->{entPhysicalIndex}),
|
||||
label => $label,
|
||||
value => $self->{entSensorValue},
|
||||
warning => $warning,
|
||||
critical => $critical,
|
||||
warning => defined($warningx) ? $warningx : $warning,
|
||||
critical => defined($criticalx) ? $criticalx : $critical,
|
||||
);
|
||||
} elsif ($self->{entSensorValue}) {
|
||||
$self->add_perfdata(
|
||||
label => sprintf('sens_%s_%s', $self->{entSensorType}, $self->{entPhysicalIndex}),
|
||||
value => $self->{entSensorValue},
|
||||
warning => $self->{ciscoEnvMonSensorThreshold},
|
||||
critical => undef,
|
||||
);
|
||||
if ((defined($criticalx) &&
|
||||
$self->check_thresholds(metric => $label, value => $self->{entSensorValue}) == CRITICAL) ||
|
||||
(defined($warningx) &&
|
||||
$self->check_thresholds(metric => $label, value => $self->{entSensorValue}) == WARNING) ||
|
||||
$self->{entSensorThresholdEvaluation} eq "true") {
|
||||
}
|
||||
if (defined($criticalx) &&
|
||||
$self->check_thresholds(metric => $label, value => $self->{entSensorValue}) == CRITICAL) {
|
||||
$self->add_critical(sprintf "%s sensor %s threshold evaluation is true (value: %s)",
|
||||
$self->{entSensorType},
|
||||
$self->{entPhysicalIndex},
|
||||
$self->{entSensorValue}
|
||||
);
|
||||
$self->add_perfdata(
|
||||
label => $label,
|
||||
value => $self->{entSensorValue},
|
||||
critical => $criticalx,
|
||||
warning => $warningx,
|
||||
);
|
||||
} elsif (defined($warningx) &&
|
||||
$self->check_thresholds(metric => $label, value => $self->{entSensorValue}) == WARNING) {
|
||||
$self->add_warning(sprintf "%s sensor %s threshold evaluation is true (value: %s)",
|
||||
$self->{entSensorType},
|
||||
$self->{entPhysicalIndex},
|
||||
$self->{entSensorValue}
|
||||
);
|
||||
$self->add_perfdata(
|
||||
label => $label,
|
||||
value => $self->{entSensorValue},
|
||||
critical => $criticalx,
|
||||
warning => $warningx,
|
||||
);
|
||||
} elsif ($self->{entSensorThresholdEvaluation} eq "true") {
|
||||
$self->add_warning(sprintf "%s sensor %s threshold evaluation is true (value: %s)",
|
||||
$self->{entSensorType},
|
||||
$self->{entPhysicalIndex},
|
||||
$self->{entSensorValue}
|
||||
);
|
||||
$self->add_perfdata(
|
||||
label => $label,
|
||||
value => $self->{entSensorValue},
|
||||
warning => $self->{ciscoEnvMonSensorThreshold},
|
||||
);
|
||||
}
|
||||
} elsif (scalar(grep { $_->{entSensorThresholdEvaluation} eq "true" }
|
||||
@{$self->{thresholds}})) {
|
||||
$self->add_warning(sprintf "%s sensor %s threshold evaluation is true",
|
||||
$self->{entSensorType},
|
||||
$self->{entPhysicalIndex});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package Classes::Clavister;
|
||||
our @ISA = qw(Classes::Device);
|
||||
use strict;
|
||||
|
||||
use constant trees => (
|
||||
'1.3.6.1.4.1.5089', # CLAVISTER-MIB
|
||||
);
|
||||
|
||||
sub init {
|
||||
my $self = shift;
|
||||
if ($self->{productname} =~ /Clavister/i) {
|
||||
bless $self, 'Classes::Clavister::Firewall1';
|
||||
$self->debug('using Classes::Clavister::Firewall1');
|
||||
}
|
||||
if (ref($self) ne "Classes::Clavister") {
|
||||
$self->init();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package Classes::Clavister::Firewall1;
|
||||
our @ISA = qw(Classes::Clavister);
|
||||
use strict;
|
||||
|
||||
sub init {
|
||||
my $self = shift;
|
||||
if ($self->mode =~ /device::hardware::health/) {
|
||||
$self->analyze_and_check_environmental_subsystem("Classes::Clavister::Firewall1::Component::EnvironmentalSubsystem");
|
||||
} elsif ($self->mode =~ /device::hardware::load/) {
|
||||
$self->analyze_and_check_cpu_subsystem("Classes::Clavister::Firewall1::Component::CpuSubsystem");
|
||||
} elsif ($self->mode =~ /device::hardware::memory/) {
|
||||
$self->analyze_and_check_mem_subsystem("Classes::Clavister::Firewall1::Component::MemSubsystem");
|
||||
} else {
|
||||
$self->no_such_mode();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package Classes::Clavister::Firewall1::Component::CpuSubsystem;
|
||||
our @ISA = qw(GLPlugin::SNMP::Item);
|
||||
use strict;
|
||||
|
||||
sub init {
|
||||
my $self = shift;
|
||||
$self->get_snmp_objects('CLAVISTER-MIB', (qw(
|
||||
clvSysCpuLoad)));
|
||||
}
|
||||
|
||||
sub check {
|
||||
my $self = shift;
|
||||
$self->add_info('checking cpus');
|
||||
$self->add_info(sprintf 'cpu usage is %.2f%%', $self->{clvSysCpuLoad});
|
||||
$self->set_thresholds(warning => 80, critical => 90);
|
||||
$self->add_message($self->check_thresholds($self->{clvSysCpuLoad}));
|
||||
$self->add_perfdata(
|
||||
label => 'cpu_usage',
|
||||
value => $self->{clvSysCpuLoad},
|
||||
uom => '%',
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package Classes::Clavister::Firewall1::Component::EnvironmentalSubsystem;
|
||||
our @ISA = qw(GLPlugin::SNMP::Item);
|
||||
use strict;
|
||||
use Data::Dumper;
|
||||
|
||||
sub init {
|
||||
my $self = shift;
|
||||
$self->get_snmp_tables('CLAVISTER-MIB', [
|
||||
['sensor', 'clvHWSensorEntry', 'Classes::Clavister::Firewall1::Component::HWSensor'],
|
||||
]);
|
||||
}
|
||||
|
||||
sub check {
|
||||
my $self = shift;
|
||||
foreach (@{$self->{sensor}}) {
|
||||
$_->check();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
package Classes::Clavister::Firewall1::Component::HWSensor;
|
||||
our @ISA = qw(GLPlugin::SNMP::TableItem);
|
||||
use strict;
|
||||
|
||||
sub check {
|
||||
my $self = shift;
|
||||
if ($self->{clvHWSensorName} =~ /Fan/i) {
|
||||
$self->add_info(sprintf '%s is running (%d %s)',
|
||||
$self->{clvHWSensorName}, $self->{clvHWSensorValue}, $self->{clvHWSensorUnit});
|
||||
$self->set_thresholds(warning => "6000:7500", critical => "1000:10000");
|
||||
$self->add_message($self->check_thresholds($self->{clvHWSensorValue}));
|
||||
$self->add_perfdata(
|
||||
label => $self->{clvHWSensorName}.'_rpm',
|
||||
value => $self->{clvHWSensorValue},
|
||||
);
|
||||
} elsif ($self->{clvHWSensorName} =~ /Temp/i) {
|
||||
$self->add_info(sprintf '%s is running (%d %s)',
|
||||
$self->{clvHWSensorName}, $self->{clvHWSensorValue}, $self->{clvHWSensorUnit});
|
||||
$self->set_thresholds(warning => 60, critical => 70);
|
||||
$self->add_message($self->check_thresholds($self->{clvHWSensorValue}));
|
||||
$self->add_perfdata(
|
||||
label => $self->{clvHWSensorName}.'_'.$self->{clvHWSensorUnit},
|
||||
value => $self->{clvHWSensorValue},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package Classes::Clavister::Firewall1::Component::MemSubsystem;
|
||||
our @ISA = qw(GLPlugin::SNMP::Item);
|
||||
use strict;
|
||||
|
||||
sub init {
|
||||
my $self = shift;
|
||||
$self->get_snmp_objects('CLAVISTER-MIB', (qw(
|
||||
clvSysMemUsage)));
|
||||
}
|
||||
|
||||
sub check {
|
||||
my $self = shift;
|
||||
$self->add_info(sprintf 'memory usage is %.2f%%', $self->{clvSysMemUsage});
|
||||
$self->set_thresholds(warning => 80, critical => 90);
|
||||
$self->add_message($self->check_thresholds($self->{clvSysMemUsage}));
|
||||
$self->add_perfdata(
|
||||
label => 'memory_usage',
|
||||
value => $self->{clvSysMemUsage},
|
||||
uom => '%',
|
||||
);
|
||||
}
|
||||
|
|
@ -25,6 +25,7 @@ sub classify {
|
|||
$self->{productname} = 'procurve' if $self->opts->servertype eq 'procurve';
|
||||
$self->{productname} = 'bluecoat' if $self->opts->servertype eq 'bluecoat';
|
||||
$self->{productname} = 'checkpoint' if $self->opts->servertype eq 'checkpoint';
|
||||
$self->{productname} = 'clavister' if $self->opts->servertype eq 'clavister';
|
||||
$self->{productname} = 'ifmib' if $self->opts->servertype eq 'ifmib';
|
||||
}
|
||||
if (! $self->check_messages()) {
|
||||
|
@ -110,6 +111,9 @@ sub classify {
|
|||
} elsif ($self->{productname} =~ /(cpx86_64)|(Check\s*Point)|(Linux.*\dcp )/i) {
|
||||
bless $self, 'Classes::CheckPoint';
|
||||
$self->debug('using Classes::CheckPoint');
|
||||
} elsif ($self->{productname} =~ /Clavister/i) {
|
||||
bless $self, 'Classes::Clavister';
|
||||
$self->debug('using Classes::Clavister');
|
||||
} elsif ($self->{productname} =~ /Blue\s*Coat/i) {
|
||||
bless $self, 'Classes::Bluecoat';
|
||||
$self->debug('using Classes::Bluecoat');
|
|
@ -154,6 +154,7 @@ use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
|
|||
sub finish {
|
||||
my $self = shift;
|
||||
$self->{ltmPoolMemberMonitorRule} ||= $self->{ltmPoolMonitorRule};
|
||||
$self->{members} = [];
|
||||
}
|
||||
|
||||
sub check {
|
||||
|
@ -314,6 +315,11 @@ our @ISA = qw(GLPlugin::SNMP::TableItem);
|
|||
use strict;
|
||||
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
|
||||
|
||||
sub finish {
|
||||
my $self = shift;
|
||||
$self->{members} = [];
|
||||
}
|
||||
|
||||
sub check {
|
||||
my $self = shift;
|
||||
$self->add_info(sprintf 'pool %s active members: %d of %d', $self->{poolName},
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue