diff --git a/ChangeLog b/ChangeLog index 54078d28..9549a143 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,99 @@ +* 2019-02-19 7.5.0.1 + remove adsl-line-mib +* 2019-02-18 7.5 + add Draytek Vigor +* 2019-01-09 7.4.3 + add mode interface-security (cisco) +* 2018-12-17 7.4.2.1 + finish ha-status for cisco wlc +* 2018-12-12 7.4.2 + start ha for cisco wlc + improve paloalto uptime model string + improve ucd memory +* 2018-12-04 7.4.1.2 + fix cisco bgp for routers which do not export the proptietary mib, but bgp4 +* 2018-12-04 7.4.1.1 + fix undefs for Huawei with older Mibs + fix fortigate sensors +* 2018-12-04 7.4.1 + detect more Huawei devices +* 2018-12-03 7.4 + use proprietary bgp mib for cisco (and add ipv6) + make ospd v6-ready + add servertpe generic_ucd + fix ciscoipsecflow fail timestamps +* 2018-10-22 7.3.1 + add modes ha-status/role for fortigate +* 2018-10-22 7.3.0.5 + update glplugin (CISCO-STACKWISE-MIB) +* 2018-10-21 7.3.0.4 + update glplugin (for go-worker) +* 2018-10-17 7.3.0.3 + update glplugin + better fortigate detection +* 2018-09-28 7.3.0.2 + update glplugin +* 2018-09-25 7.3.0.1 + re-enable Huawei CloudEngine support +* 2018-09-10 7.3 + update stack-status + add servertype hostresource + update cisco vpn-status +* 2018-08-13 7.2.0.2 + bugfix in interface-modes where --name3 found no match +* 2018-08-10 7.2.0.1 + bugfix in ios ha-status, ignore cable "failover" description +* 2018-08-01 7.2 + add packet forwarding engine metrics for juniper standby nodes +* 2018-07-26 7.1 + add custom thresholds for cisco ccm + detect fritzbox 7490 +* 2018-07-13 7.0.2 + add interface-uptime + 2018-07-05 7.0.1.6 + fix a bug in non-map FabOS memory + set thresholds to 100% for cisco asa heapcache memory-usage +* 2018-06-18 7.0.1.5 + update glplugin (get_snmp_table_objects waja fix) +* 2018-05-05 7.0.1.4 + simplify the cisco memory exceptions +* 2018-04-29 7.0.1.3 + bugfix in cisco global shared memory > 9.3.2 +* 2018-03-31 7.0.1.2 + fix a bug in link-aggregation-availability +* 2018-03-13 7.0.1.1 + fix a bug in cisco enhanced mempool mib and posixmem (thx sabedevops) +* 2018-03-07 7.0.1 + improve f5, add ha-role, check-config, count-connections +* 2018-03-01 7.0.0.7 + update GLPlugin +* 2018-02-26 7.0.0.6 + ignore free space of iso mounts in hostresource mib +* 2018-02-06 7.0.0.5 + fix a bug in hostresourcesmib memory calc. (arista eos) +* 2018-02-08 7.0.0.5 + update glplugn, add modes encode/decode, rfc3986 +* 2018-01-23 7.0.0.4 + merge pull request #164 (simonmeggle) + add bluecoat asg fix from Stefan Kublik +* 2018-01-12 7.0.0.3 + check the clock of checkpoint fw +* 2018-01-11 7.0.0.2 + fix a bug in checkpoint vpn-status +* 2018-01-08 7.0.0.1 + update glplugin +* 2018-01-05 7.0 + code improvements, fix hh3c entities +* 2017-12-27 6.4.4.1 + fix f5 versions +* 2017-12-21 6.4.4 + add interface-duplex +* 2017-12-15 6.4.3.3 + fix a bug in vsx-firewall1-fork +* 2017-12-14 6.4.3.2 + update glplugin +* 2017-12-14 6.4.3.1 + update glplugin * 2017-12-12 6.4.3 add checkpoint ha-status, fix checkpoint vpn-status * 2017-11-27 6.4.2.3 diff --git a/GLPlugin b/GLPlugin index 5abb5d9e..94d5904c 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit 5abb5d9e321465d79d132c92aebcc9201b595d34 +Subproject commit 94d5904cfdf6f5e10790c00b8fd27ed300ada5dc diff --git a/README.md b/README.md index 51f05a96..c9cca923 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,12 @@ +Meet me at... +============= +
+ Description ============ The plugin check_nwc_health was developed with the aim of having a single tool for all aspects of monitoring of network components. -
+
Motivation
==========
@@ -24,23 +28,23 @@ Modi
| Mode | Function |
|-------------------------------|------------------------------------------------------------------------|
| hardware-health | Check the status of environmental equipment (fans, temperatures, power) |
-| cpu-load | Check the CPU load of the device) |
-| memory-usage | Check the memory usage of the device) |
-| interface-usage | Check the utilization of interfaces) |
+| cpu-load | Check the CPU load of the device |
+| memory-usage | Check the memory usage of the device |
+| interface-usage | Check the utilization of interfaces |
| interface-errors | Check the error-rate of interfaces |
-| interface-discards | Check the discard-rate of interfaces) |
+| interface-discards | Check the discard-rate of interfaces |
| interface-status | Check the status of interfaces (oper/admin) |
-| interface-nat-count-sessions | Count the number of nat sessions) |
+| interface-nat-count-sessions | Count the number of nat sessions |
| interface-nat-rejects | Count the number of nat sessions rejected due to lack of resources) |
-| list-interfaces | Show the interfaces of the device and update the name cache) |
-| list-interfaces-detail | Show the interfaces of the device and some details) |
+| list-interfaces | Show the interfaces of the device and update the name cache |
+| list-interfaces-detail | Show the interfaces of the device and some details |
| interface-availability | Show the availability (oper != up of interfaces) |
-| link-aggregation-availability | Check the percentage of up interfaces in a link aggregation) |
-| list-routes | Check the percentage of up interfaces in a link aggregation) |
-| route-exists | Check if a route exists. --name is the dest, --name2 check also the next hop)) |
-| count-routes | Count the routes. --name is the dest, --name2 is the hop)) |
-| vpn-status | Check the status of vpns (up/down)) |
-| create-shinken-service | Create a Shinken service definition) |
+| link-aggregation-availability | Check the percentage of up interfaces in a link aggregation |
+| list-routes | Check the percentage of up interfaces in a link aggregation |
+| route-exists | Check if a route exists. (--name is the dest, --name2 check also the next hop) |
+| count-routes | Count the routes. (--name is the dest, --name2 is the hop) |
+| vpn-status | Check the status of vpns (up/down) |
+| create-shinken-service | Create a Shinken service definition |
| hsrp-state | Check the state in a HSRP group) |
| hsrp-failover | Check if a HSRP group's nodes have changed their roles |
| list-hsrp-groups | Show the HSRP groups configured on this device |
@@ -60,7 +64,7 @@ Modi
| pool-complections | Check the members and connections of a load balancer pool |
| list-pools | List load balancer pools |
| check-licenses | Check the installed licences/keys |
-| count-users | Count the | connected) users/sessions |
+| count-users | Count the (connected) users/sessions |
| check-config | Check the status of configs (cisco, unsaved config changes) |
| check-connections | Check the quality of connections |
| count-connections | Check the number of connections (-client, -server is possible) |
diff --git a/configure.ac b/configure.ac
index 03dbc914..9fb03bef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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,6.4.3)
+AC_INIT(check_nwc_health,7.5.0.1)
AM_INIT_AUTOMAKE([1.9 tar-pax])
AM_MAINTAINER_MODE([disable])
AC_CANONICAL_HOST
diff --git a/plugins-scripts/Classes/ALARMMIB/Component/AlarmSubsystem.pm b/plugins-scripts/Classes/ALARMMIB/Component/AlarmSubsystem.pm
index b83d05bc..592b1e89 100644
--- a/plugins-scripts/Classes/ALARMMIB/Component/AlarmSubsystem.pm
+++ b/plugins-scripts/Classes/ALARMMIB/Component/AlarmSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('ALARM-MIB', [
#['models', 'alarmModelTable', 'Classes::ALARMMIB::Component::AlarmSubsystem::AlarmModel'],
#['variables', 'alarmActiveVariableTable', 'Classes::ALARMMIB::Component::AlarmSubsystem::AlarmVariable'],
@@ -26,7 +26,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{ceAlarmTypes} = [];
if ($self->{alarmActiveVariableValueType} eq 'octetString') {
my $index = 0;
@@ -44,7 +44,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf "there are %d active alarms",
$self->{alarmActiveStatsActiveCurrent});
if ($self->{alarmActiveStatsActiveCurrent}) {
diff --git a/plugins-scripts/Classes/AVOS.pm b/plugins-scripts/Classes/AVOS.pm
index 96c591f7..fa30c1c8 100644
--- a/plugins-scripts/Classes/AVOS.pm
+++ b/plugins-scripts/Classes/AVOS.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Bluecoat);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
} elsif ($self->mode =~ /device::hardware::load/) {
$self->analyze_and_check_cpu_subsystem("Classes::AVOS::Component::CpuSubsystem");
diff --git a/plugins-scripts/Classes/AVOS/Component/ConnectionSubsystem.pm b/plugins-scripts/Classes/AVOS/Component/ConnectionSubsystem.pm
index 619b8b49..60424808 100644
--- a/plugins-scripts/Classes/AVOS/Component/ConnectionSubsystem.pm
+++ b/plugins-scripts/Classes/AVOS/Component/ConnectionSubsystem.pm
@@ -3,13 +3,13 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('BLUECOAT-AV-MIB', (qw(
avSlowICAPConnections)));
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf '%d slow ICAP connections',
$self->{avSlowICAPConnections});
$self->set_thresholds(warning => 100, critical => 100);
diff --git a/plugins-scripts/Classes/AVOS/Component/CpuSubsystem.pm b/plugins-scripts/Classes/AVOS/Component/CpuSubsystem.pm
index c5f6ecc8..7e62c558 100644
--- a/plugins-scripts/Classes/AVOS/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/AVOS/Component/CpuSubsystem.pm
@@ -3,8 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
- my %params = @_;
+ my ($self, %params) = @_;
# With AVOS version 5.5.4.1, 5.4.6.1 and 6.1.2.1, the SNMP MIB has been extended to support multiple CPU cores.
# The new OID is defined as a table 1.3.6.1.4.1.3417.2.11.2.4.1 in the BLUECOAT-SG-PROXY-MIB file with the following sub-OIDs.
# https://kb.bluecoat.com/index?page=content&id=FAQ1244&actp=search&viewlocale=en_US&searchid=1360452047002
@@ -23,7 +22,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'cpu %s usage is %.2f%%',
$self->{sgProxyCpuCoreIndex}, $self->{sgProxyCpuCoreBusyPerCent});
$self->set_thresholds(warning => 80, critical => 90);
@@ -41,7 +40,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'cpu %s usage is %.2f%%',
$self->{deviceUsageIndex}, $self->{deviceUsagePercent});
$self->set_thresholds(warning => $self->{deviceUsageHigh} - 10, critical => $self->{deviceUsageHigh});
diff --git a/plugins-scripts/Classes/AVOS/Component/KeySubsystem.pm b/plugins-scripts/Classes/AVOS/Component/KeySubsystem.pm
index f780b019..0a2010d2 100644
--- a/plugins-scripts/Classes/AVOS/Component/KeySubsystem.pm
+++ b/plugins-scripts/Classes/AVOS/Component/KeySubsystem.pm
@@ -3,13 +3,13 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('BLUECOAT-AV-MIB', (qw(
avLicenseDaysRemaining avVendorName)));
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'license %s expires in %d days',
$self->{avVendorName},
$self->{avLicenseDaysRemaining});
diff --git a/plugins-scripts/Classes/AVOS/Component/MemSubsystem.pm b/plugins-scripts/Classes/AVOS/Component/MemSubsystem.pm
index 274ae311..c12ff541 100644
--- a/plugins-scripts/Classes/AVOS/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/AVOS/Component/MemSubsystem.pm
@@ -9,7 +9,7 @@ sub init {
# There's two separate OIDs to obtain memory pressure value for AVOSV4 and AVOSV5;
# AVOSV4: memPressureValue - OIDs: 1.3.6.1.4.1.3417.2.8.2.3 (systemResourceMIB)
# AVOSV5: sgProxyMemoryPressure - OIDs: 1.3.6.1.4.1.3417.2.11.2.3.4 (bluecoatSGProxyMIB)
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('BLUECOAT-SG-PROXY-MIB', (qw(
sgProxyMemPressure sgProxyMemAvailable sgProxyMemCacheUsage sgProxyMemSysUsage)));
if (! defined $self->{sgProxyMemPressure}) {
@@ -36,7 +36,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
my $errorfound = 0;
$self->add_info('checking memory');
$self->add_info(sprintf 'memory usage is %.2f%%',
diff --git a/plugins-scripts/Classes/AVOS/Component/SecuritySubsystem.pm b/plugins-scripts/Classes/AVOS/Component/SecuritySubsystem.pm
index 7bf14e37..3ab7aa61 100644
--- a/plugins-scripts/Classes/AVOS/Component/SecuritySubsystem.pm
+++ b/plugins-scripts/Classes/AVOS/Component/SecuritySubsystem.pm
@@ -3,13 +3,13 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('BLUECOAT-AV-MIB', (qw(
avVirusesDetected)));
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf '%d viruses detected',
$self->{avVirusesDetected});
$self->set_thresholds(warning => 1500, critical => 1500);
diff --git a/plugins-scripts/Classes/Alcatel.pm b/plugins-scripts/Classes/Alcatel.pm
index 95e6ee53..a530e521 100644
--- a/plugins-scripts/Classes/Alcatel.pm
+++ b/plugins-scripts/Classes/Alcatel.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Device);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->{productname} =~ /AOS.*OAW/i) {
bless $self, 'Classes::Alcatel::OmniAccess';
$self->debug('using Classes::Alcatel::OmniAccess');
diff --git a/plugins-scripts/Classes/Alcatel/OmniAccess.pm b/plugins-scripts/Classes/Alcatel/OmniAccess.pm
index 79abe385..ae717cd7 100644
--- a/plugins-scripts/Classes/Alcatel/OmniAccess.pm
+++ b/plugins-scripts/Classes/Alcatel/OmniAccess.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Alcatel);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::Alcatel::OmniAccess::Component::EnvironmentalSubsystem");
# waere praktischer, aber in diesem fall muss alarmdreck ausgeputzt werden
diff --git a/plugins-scripts/Classes/Alcatel/OmniAccess/Component/CpuSubsystem.pm b/plugins-scripts/Classes/Alcatel/OmniAccess/Component/CpuSubsystem.pm
index 15fd8fae..8c545ffc 100644
--- a/plugins-scripts/Classes/Alcatel/OmniAccess/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/Alcatel/OmniAccess/Component/CpuSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('WLSX-SYSTEMEXT-MIB', [
['memories', 'wlsxSysExtProcessorTable', 'Classes::Alcatel::OmniAccess::Component::CpuSubsystem::Cpu'],
]);
@@ -15,7 +15,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
my $label = sprintf '%s_usage', lc $self->{sysExtProcessorDescr};
$label =~ s/\s+/_/g;
$self->add_info(sprintf '%s usage is %.2f%%',
diff --git a/plugins-scripts/Classes/Alcatel/OmniAccess/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Alcatel/OmniAccess/Component/EnvironmentalSubsystem.pm
index acce0621..f95c74e6 100644
--- a/plugins-scripts/Classes/Alcatel/OmniAccess/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/Alcatel/OmniAccess/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{fan_subsystem} =
Classes::Alcatel::OmniAccess::Component::FanSubsystem->new();
$self->get_snmp_objects('WLSX-SYSTEMEXT-MIB', qw(
@@ -15,7 +15,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{fan_subsystem}->check();
$self->{powersupply_subsystem}->check();
$self->{storage_subsystem}->check();
@@ -32,7 +32,7 @@ sub check {
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
printf "[%s]\n%s\n", uc "wlsxSysExtInternalTemparature",
$self->{wlsxSysExtInternalTemparature};
$self->{fan_subsystem}->dump();
diff --git a/plugins-scripts/Classes/Alcatel/OmniAccess/Component/FanSubsystem.pm b/plugins-scripts/Classes/Alcatel/OmniAccess/Component/FanSubsystem.pm
index 86136deb..a3300e9f 100644
--- a/plugins-scripts/Classes/Alcatel/OmniAccess/Component/FanSubsystem.pm
+++ b/plugins-scripts/Classes/Alcatel/OmniAccess/Component/FanSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('WLSX-SYSTEMEXT-MIB', [
['fans', 'wlsxSysExtFanTable', 'Classes::Alcatel::OmniAccess::Component::FanSubsystem::Fan'],
]);
@@ -14,7 +14,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'fan %d status is %s',
$self->{flat_indices},
$self->{sysExtFanStatus});
diff --git a/plugins-scripts/Classes/Alcatel/OmniAccess/Component/HaSubsystem.pm b/plugins-scripts/Classes/Alcatel/OmniAccess/Component/HaSubsystem.pm
index 3ca71191..1dea2878 100644
--- a/plugins-scripts/Classes/Alcatel/OmniAccess/Component/HaSubsystem.pm
+++ b/plugins-scripts/Classes/Alcatel/OmniAccess/Component/HaSubsystem.pm
@@ -4,7 +4,7 @@ use strict;
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::ha::role/) {
$self->get_snmp_objects('WLSX-SYSTEMEXT-MIB', (qw(wlsxSysExtSwitchRole)));
if (! $self->opts->role()) {
@@ -14,7 +14,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking ha');
$self->add_info(sprintf 'ha role is %s', $self->{wlsxSysExtSwitchRole});
if ($self->{wlsxSysExtSwitchRole} ne $self->opts->role()) {
diff --git a/plugins-scripts/Classes/Alcatel/OmniAccess/Component/MemSubsystem.pm b/plugins-scripts/Classes/Alcatel/OmniAccess/Component/MemSubsystem.pm
index 68a28e36..69015b04 100644
--- a/plugins-scripts/Classes/Alcatel/OmniAccess/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/Alcatel/OmniAccess/Component/MemSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('WLSX-SYSTEMEXT-MIB', [
['memories', 'wlsxSysExtMemoryTable', 'Classes::Alcatel::OmniAccess::Component::MemSubsystem::Memory'],
]);
@@ -15,12 +15,12 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{usage} = 100 * $self->{sysExtMemoryUsed} / $self->{sysExtMemorySize};
}
sub check {
- my $self = shift;
+ my ($self) = @_;
my $label = sprintf 'memory_%s_usage', $self->{flat_indices};
$self->add_info(sprintf 'memory %s usage is %.2f%%',
$self->{flat_indices}, $self->{usage});
diff --git a/plugins-scripts/Classes/Alcatel/OmniAccess/Component/PowersupplySubsystem.pm b/plugins-scripts/Classes/Alcatel/OmniAccess/Component/PowersupplySubsystem.pm
index 2b54c9d1..33661ecb 100644
--- a/plugins-scripts/Classes/Alcatel/OmniAccess/Component/PowersupplySubsystem.pm
+++ b/plugins-scripts/Classes/Alcatel/OmniAccess/Component/PowersupplySubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('WLSX-SYSTEMEXT-MIB', [
['powersupplies', 'wlsxSysExtPowerSupplyTable', 'Classes::Alcatel::OmniAccess::Component::PowersupplySubsystem::Powersupply'],
]);
@@ -14,7 +14,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'power supply %d status is %s',
$self->{flat_indices},
$self->{sysExtPowerSupplyStatus});
diff --git a/plugins-scripts/Classes/Alcatel/OmniAccess/Component/StorageSubsystem.pm b/plugins-scripts/Classes/Alcatel/OmniAccess/Component/StorageSubsystem.pm
index 186877bb..ac800d6c 100644
--- a/plugins-scripts/Classes/Alcatel/OmniAccess/Component/StorageSubsystem.pm
+++ b/plugins-scripts/Classes/Alcatel/OmniAccess/Component/StorageSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('WLSX-SYSTEMEXT-MIB', [
['storage', 'wlsxSysExtStorageTable', 'Classes::Alcatel::OmniAccess::Component::StorageSubsystem::Storageory'],
]);
@@ -15,12 +15,12 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{usage} = 100 * $self->{sysExtStorageUsed} / $self->{sysExtStorageSize};
}
sub check {
- my $self = shift;
+ my ($self) = @_;
my $label = sprintf 'storage_%s_usage', $self->{sysExtStorageName};
$label =~ s/\s+/_/g;
$self->add_info(sprintf 'storage %s usage is %.2f%%',
diff --git a/plugins-scripts/Classes/Alcatel/OmniAccess/Component/WlanSubsystem.pm b/plugins-scripts/Classes/Alcatel/OmniAccess/Component/WlanSubsystem.pm
index f34054fa..170734f6 100644
--- a/plugins-scripts/Classes/Alcatel/OmniAccess/Component/WlanSubsystem.pm
+++ b/plugins-scripts/Classes/Alcatel/OmniAccess/Component/WlanSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('WLSX-WLAN-MIB', qw(wlsxWlanTotalNumAccessPoints));
$self->get_snmp_tables('WLSX-WLAN-MIB', [
['aps', 'wlsxWlanAPTable', 'Classes::Alcatel::OmniAccess::Component::WlanSubsystem::AP', sub { return $self->filter_name(shift->{wlanAPName}) } ],
@@ -11,7 +11,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking access points');
$self->{numOfAPs} = scalar (@{$self->{aps}});
$self->{apNameList} = [map { $_->{wlanAPName} } @{$self->{aps}}];
@@ -78,7 +78,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
if ($self->{wlanAPMacAddress} && $self->{wlanAPMacAddress} =~ /0x(\w{2})(\w{2})(\w{2})(\w{2})(\w{2})(\w{2})/) {
$self->{wlanAPMacAddress} = join(".", map { hex($_) } ($1, $2, $3, $4, $5, $6));
} elsif ($self->{wlanAPMacAddress} && unpack("H12", $self->{wlanAPMacAddress}) =~ /(\w{2})(\w{2})(\w{2})(\w{2})(\w{2})(\w{2})/) {
@@ -87,7 +87,7 @@ sub finish {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'access point %s is %s',
$self->{wlanAPName}, $self->{wlanAPStatus});
if ($self->mode =~ /device::wlan::aps::status/) {
diff --git a/plugins-scripts/Classes/AlliedTelesyn.pm b/plugins-scripts/Classes/AlliedTelesyn.pm
index 1fbc7d4c..ce73c39e 100644
--- a/plugins-scripts/Classes/AlliedTelesyn.pm
+++ b/plugins-scripts/Classes/AlliedTelesyn.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Device);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->no_such_mode();
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::AlliedTelesyn::Component::EnvironmentalSubsystem");
diff --git a/plugins-scripts/Classes/Arista.pm b/plugins-scripts/Classes/Arista.pm
index f5fa2d22..af2cdbb6 100644
--- a/plugins-scripts/Classes/Arista.pm
+++ b/plugins-scripts/Classes/Arista.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Device);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->mult_snmp_max_msg_size(10);
$self->analyze_and_check_environmental_subsystem("Classes::Arista::Component::EnvironmentalSubsystem");
diff --git a/plugins-scripts/Classes/Arista/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Arista/Component/EnvironmentalSubsystem.pm
index 902f769a..8718355c 100644
--- a/plugins-scripts/Classes/Arista/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/Arista/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('ENTITY-MIB', [
['entities', 'entPhysicalTable',
'Classes::Arista::Component::EnvironmentalSubsystem::Entity',
@@ -36,7 +36,7 @@ use strict;
sub rebless {
- my $self = shift;
+ my ($self) = @_;
bless $self,
'Classes::Arista::Component::EnvironmentalSubsystem::Chassis' if
$self->{entPhysicalClass} eq 'chassis';
@@ -61,7 +61,7 @@ sub rebless {
}
sub check_state {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf "%s is %s (admin %s, oper %s)",
$self->{entPhysicalDescr}, $self->{entStateUsage},
$self->{entStateAdmin}, $self->{entStateOper});
@@ -99,7 +99,7 @@ our @ISA = qw(Classes::Arista::Component::EnvironmentalSubsystem::Entity);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->check_state();
}
@@ -116,7 +116,7 @@ our @ISA = qw(Classes::Arista::Component::EnvironmentalSubsystem::Entity);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->check_state();
}
@@ -125,7 +125,7 @@ our @ISA = qw(Classes::Arista::Component::EnvironmentalSubsystem::Entity);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{valid} = ($self->{entPhySensorValue} == -1000000000 || $self->{entPhySensorValue} == 1000000000)
? 0 : 1;
@@ -141,7 +141,7 @@ sub finish {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->check_state();
my ($warn, $crit) = (undef, undef);
if ($self->{aristaEntSensorStatusDescr} =~ /no thresholds/i) {
diff --git a/plugins-scripts/Classes/BGP/Component/PeerSubsystem.pm b/plugins-scripts/Classes/BGP/Component/PeerSubsystem.pm
index e0167d0e..96150149 100644
--- a/plugins-scripts/Classes/BGP/Component/PeerSubsystem.pm
+++ b/plugins-scripts/Classes/BGP/Component/PeerSubsystem.pm
@@ -55,7 +55,7 @@ our $errorcodes = {
};
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{peers} = [];
if ($self->mode =~ /device::bgp::peer::(list|count|watch)/) {
$self->update_entry_cache(1, 'BGP4-MIB', 'bgpPeerTable', 'bgpPeerRemoteAddr');
@@ -70,7 +70,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
my $errorfound = 0;
$self->add_info('checking bgp peers');
if ($self->mode =~ /peer::list/) {
@@ -208,18 +208,12 @@ sub check {
package Classes::BGP::Component::PeerSubsystem::Peer;
-our @ISA = qw(Classes::BGP::Component::PeerSubsystem);
+our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
-sub new {
- my $class = shift;
- my %params = @_;
- my $self = {};
- foreach(keys %params) {
- $self->{$_} = $params{$_};
- }
- bless $self, $class;
+sub finish {
+ my ($self) = @_;
$self->{bgpPeerLastError} |= "00 00";
my $errorcode = 0;
my $subcode = 0;
@@ -233,12 +227,10 @@ sub new {
$self->{bgpPeerFaulty} = 0;
my @parts = gmtime($self->{bgpPeerFsmEstablishedTime});
$self->{bgpPeerFsmEstablishedTime} = sprintf ("%dd, %dh, %dm, %ds",@parts[7,2,1,0]);
-
- return $self;
}
sub check {
- my $self = shift;
+ my ($self) = @_;
if ($self->opts->name2) {
foreach my $as (split(",", $self->opts->name2)) {
if ($as =~ /(\d+)=(\w+)/) {
diff --git a/plugins-scripts/Classes/Bintec/Bibo.pm b/plugins-scripts/Classes/Bintec/Bibo.pm
index ab3d73ec..cbec040e 100644
--- a/plugins-scripts/Classes/Bintec/Bibo.pm
+++ b/plugins-scripts/Classes/Bintec/Bibo.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Bintec);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::Bintec::Bibo::Component::EnvironmentalSubsystem");
} elsif ($self->mode =~ /device::hardware::load/) {
diff --git a/plugins-scripts/Classes/Bintec/Bibo/Components/CpuSubsystem.pm b/plugins-scripts/Classes/Bintec/Bibo/Components/CpuSubsystem.pm
index 3e7a4780..cf716ae8 100644
--- a/plugins-scripts/Classes/Bintec/Bibo/Components/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/Bintec/Bibo/Components/CpuSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->bulk_is_baeh();
$self->get_snmp_tables('BIANCA-BRICK-MIBRES-MIB', [
['cpus', 'cpuTable', 'Classes::Bintec::Bibo::Component::CpuSubsystem::Cpu'],
@@ -16,7 +16,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->valdiff({name => 'cpu'}, qw(cpuTotalIdle));
$self->{cpuTotalUsage} = 100 - (100 * $self->{delta_cpuTotalIdle} / $self->{delta_timestamp});
if ($self->{cpuTotalUsage} < 0 || $self->{cpuTotalUsage} > 100 || ! $self->{delta_cpuTotalIdle}) {
@@ -26,7 +26,7 @@ sub finish {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
my $label = 'cpu_'.$self->{cpuDescr};
$self->add_info(sprintf 'cpu %d (%s) usage is %.2f%%',
$self->{cpuNumber},
diff --git a/plugins-scripts/Classes/Bintec/Bibo/Components/DiskSubsystem.pm b/plugins-scripts/Classes/Bintec/Bibo/Components/DiskSubsystem.pm
index 979f7362..c06619c4 100644
--- a/plugins-scripts/Classes/Bintec/Bibo/Components/DiskSubsystem.pm
+++ b/plugins-scripts/Classes/Bintec/Bibo/Components/DiskSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->bulk_is_baeh();
$self->get_snmp_tables('BINTEC-FILESYS', [
['disks', 'fsDiskTable', 'Classes::Bintec::Bibo::Component::DiskSubsystem::Disk'],
@@ -16,12 +16,12 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{usage} = 100 - (100 * $self->{fsDiskFreeBlocks} / $self->{fsDiskBlocks});
}
sub check {
- my $self = shift;
+ my ($self) = @_;
my $label = 'disk_'.$self->{fsDiskDevName};
$self->add_info(sprintf 'disk %s usage is %.2f%%',
$self->{fsDiskDevName},
diff --git a/plugins-scripts/Classes/Bintec/Bibo/Components/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Bintec/Bibo/Components/EnvironmentalSubsystem.pm
index 191e5c82..2143dc9b 100644
--- a/plugins-scripts/Classes/Bintec/Bibo/Components/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/Bintec/Bibo/Components/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->bulk_is_baeh();
# there is temperature/sensor information in these mibs
# mib-sensor.mib mib-box.mib mib-sysped.mib mib-sysiny.mib mibsysx8.mib
diff --git a/plugins-scripts/Classes/Bintec/Bibo/Components/MemSubsystem.pm b/plugins-scripts/Classes/Bintec/Bibo/Components/MemSubsystem.pm
index 5295bf7d..ec877452 100644
--- a/plugins-scripts/Classes/Bintec/Bibo/Components/MemSubsystem.pm
+++ b/plugins-scripts/Classes/Bintec/Bibo/Components/MemSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->bulk_is_baeh();
$self->get_snmp_tables('BIANCA-BRICK-MIBRES-MIB', [
['mem', 'memoryTable', 'Classes::Bintec::Bibo::Component::MemSubsystem::Memory'],
@@ -16,7 +16,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{usage} = $self->{memoryInuse} /
$self->{memoryTotal} * 100;
bless $self, "Classes::Bintec::Bibo::Component::MemSubsystem::Memory::Flash"
@@ -33,7 +33,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{memoryDescr} = $self->unhex_octet_string($self->{memoryDescr});
$self->{memoryDescr} =~ s/\0//g;
$self->add_info(sprintf '%s usage is %.2f%%',
@@ -54,7 +54,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{memoryDescr} = $self->unhex_octet_string($self->{memoryDescr});
$self->{memoryDescr} =~ s/\0//g;
$self->add_info(sprintf '%s usage is %.2f%%',
@@ -74,7 +74,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf '%s usage is %.2f%%',
$self->{memoryDescr}, $self->{usage});
my $label = 'memory_'.$self->{memoryDescr}.'_usage';
diff --git a/plugins-scripts/Classes/Bluecoat.pm b/plugins-scripts/Classes/Bluecoat.pm
index c980750a..3a0f8495 100644
--- a/plugins-scripts/Classes/Bluecoat.pm
+++ b/plugins-scripts/Classes/Bluecoat.pm
@@ -4,8 +4,8 @@ use strict;
sub init {
- my $self = shift;
- if ($self->{productname} =~ /Blue.*Coat.*(SG\d+|SGOS)/i) {
+ my ($self) = @_;
+ if ($self->{productname} =~ /Blue.*Coat.*(SG\d+|SGOS|ASG)/i) {
# product ProxySG Blue Coat SG600
# iso.3.6.1.4.1.3417.2.11.1.3.0 = STRING: "Version: SGOS 5.5.8.1, Release id: 78642 Proxy Edition"
bless $self, 'Classes::SGOS';
diff --git a/plugins-scripts/Classes/Brocade.pm b/plugins-scripts/Classes/Brocade.pm
index cb21e7d4..e0444f25 100644
--- a/plugins-scripts/Classes/Brocade.pm
+++ b/plugins-scripts/Classes/Brocade.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Device);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode !~ /device::uptime/) {
foreach ($self->get_snmp_table_objects(
'ENTITY-MIB', 'entPhysicalTable', undef, ['entPhysicalDescr'])) {
diff --git a/plugins-scripts/Classes/CheckPoint.pm b/plugins-scripts/Classes/CheckPoint.pm
index 8765617e..d6c5801e 100644
--- a/plugins-scripts/Classes/CheckPoint.pm
+++ b/plugins-scripts/Classes/CheckPoint.pm
@@ -7,8 +7,9 @@ use constant trees => (
);
sub init {
- my $self = shift;
- if (defined $self->get_snmp_object('CHECKPOINT-MIB', 'vsxVsInstalled')) {
+ my ($self) = @_;
+ if (defined $self->get_snmp_object('CHECKPOINT-MIB', 'vsxVsInstalled') &&
+ $self->get_snmp_object('CHECKPOINT-MIB', 'vsxVsInstalled') != 0) {
bless $self, 'Classes::CheckPoint::VSX';
$self->debug('using Classes::CheckPoint::VSX');
#} elsif ($self->get_snmp_object('CHECKPOINT-MIB', 'fwProduct') || $self->{productname} =~ /(FireWall\-1\s)|(cpx86_64)|(Linux.*\dcp )/i) {
diff --git a/plugins-scripts/Classes/CheckPoint/Firewall1.pm b/plugins-scripts/Classes/CheckPoint/Firewall1.pm
index 3db2ae0d..deb61fe2 100644
--- a/plugins-scripts/Classes/CheckPoint/Firewall1.pm
+++ b/plugins-scripts/Classes/CheckPoint/Firewall1.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::CheckPoint);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::CheckPoint::Firewall1::Component::EnvironmentalSubsystem");
} elsif ($self->mode =~ /device::hardware::load/) {
diff --git a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/CpuSubsystem.pm b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/CpuSubsystem.pm
index 2e7a85a6..1ab65c41 100755
--- a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/CpuSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('CHECKPOINT-MIB', (qw(procUsage procNum)));
$self->get_snmp_tables('CHECKPOINT-MIB', [
['multiprocs', 'multiProcTable', 'Classes::CheckPoint::Firewall1::Component::CpuSubsystem::MultiProc'],
@@ -12,7 +12,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking cpus');
$self->add_info(sprintf 'cpu usage is %.2f%%', $self->{procUsage});
$self->set_thresholds(warning => 80, critical => 90);
@@ -42,7 +42,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
my $label = sprintf 'cpu_core_%s_usage', $self->{multiProcIndex};
$self->add_info(sprintf 'cpu core %s usage is %.2f%%',
$self->{multiProcIndex},
diff --git a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/DiskSubsystem.pm b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/DiskSubsystem.pm
index 00f06690..5e5bc518 100644
--- a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/DiskSubsystem.pm
+++ b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/DiskSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('HOST-RESOURCES-MIB', [
['storages', 'hrStorageTable', 'Classes::HOSTRESOURCESMIB::Component::DiskSubsystem::Storage', sub { return shift->{hrStorageType} eq 'hrStorageFixedDisk'}],
]);
@@ -16,7 +16,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking disks');
if (@{$self->{multidisks}}) {
foreach (@{$self->{multidisks}}) {
@@ -51,7 +51,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'volume %s with %d disks is %s',
$self->{raidVolumeID},
$self->{numOfDisksOnRaid},
@@ -72,7 +72,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'disk %s (vol %s) is %s',
$self->{raidDiskIndex},
$self->{raidDiskVolumeID},
@@ -85,7 +85,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
my $label = sprintf 'disk_%s_free', $self->{multiDiskName};
$self->add_info(sprintf 'disk %s (%s) has %.2f%% free space',
$self->{multiDiskIndex},
diff --git a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/EnvironmentalSubsystem.pm
index 963b8da1..0612abe3 100644
--- a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{disk_subsystem} =
Classes::CheckPoint::Firewall1::Component::DiskSubsystem->new();
$self->{temperature_subsystem} =
@@ -14,15 +14,18 @@ sub init {
Classes::CheckPoint::Firewall1::Component::VoltageSubsystem->new();
$self->{powersupply_subsystem} =
Classes::CheckPoint::Firewall1::Component::PowersupplySubsystem->new();
+ $self->{clock_subsystem} =
+ Classes::HOSTRESOURCESMIB::Component::ClockSubsystem->new();
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{disk_subsystem}->check();
$self->{temperature_subsystem}->check();
$self->{fan_subsystem}->check();
$self->{voltage_subsystem}->check();
$self->{powersupply_subsystem}->check();
+ $self->{clock_subsystem}->check() if ! $self->{clock_subsystem}->is_blacklisted();
if (! $self->check_messages()) {
$self->clear_ok(); # too much noise
$self->add_ok("environmental hardware working fine");
@@ -30,11 +33,12 @@ sub check {
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
$self->{disk_subsystem}->dump();
$self->{temperature_subsystem}->dump();
$self->{fan_subsystem}->dump();
$self->{voltage_subsystem}->dump();
$self->{powersupply_subsystem}->dump();
+ $self->{clock_subsystem}->dump();
}
diff --git a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/FanSubsystem.pm b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/FanSubsystem.pm
index b94a430c..beaa5753 100644
--- a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/FanSubsystem.pm
+++ b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/FanSubsystem.pm
@@ -3,14 +3,14 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('CHECKPOINT-MIB', [
['fans', 'fanSpeedSensorTable', 'Classes::CheckPoint::Firewall1::Component::FanSubsystem::Fan'],
]);
}
sub check {
- my $self = shift;
+ my ($self) = @_;
foreach (@{$self->{fans}}) {
$_->check();
}
@@ -22,7 +22,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'fan %s is %s (%d %s)',
$self->{fanSpeedSensorName}, $self->{fanSpeedSensorStatus},
$self->{fanSpeedSensorValue}, $self->{fanSpeedSensorUnit});
diff --git a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/FwSubsystem.pm b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/FwSubsystem.pm
index 609d6382..50d27fe9 100644
--- a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/FwSubsystem.pm
+++ b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/FwSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('CHECKPOINT-MIB', (qw(
fwModuleState fwPolicyName fwNumConn)));
if ($self->mode =~ /device::fw::policy::installed/) {
@@ -12,7 +12,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking fw module');
if ($self->{fwModuleState} ne 'Installed') {
$self->add_critical(sprintf 'fw module is %s', $self->{fwPolicyName});
diff --git a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/HaSubsystem.pm b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/HaSubsystem.pm
index 072f86fb..586b783c 100644
--- a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/HaSubsystem.pm
+++ b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/HaSubsystem.pm
@@ -4,7 +4,7 @@ use strict;
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::ha::role/) {
$self->get_snmp_objects('CHECKPOINT-MIB', (qw(
haStarted haState haStatShort haStatLong)));
@@ -21,7 +21,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::ha::role/) {
chomp($self->{haState});
$self->add_info('checking ha');
@@ -71,7 +71,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf "%s has status %s",
$self->{haProblemName}, $self->{haProblemStatus});
if ($self->{haProblemStatus} ne "OK") {
diff --git a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/MemSubsystem.pm b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/MemSubsystem.pm
index 36eddc88..689a5633 100644
--- a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/MemSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('CHECKPOINT-MIB', (qw(
memTotalReal64 memFreeReal64)));
$self->{memory_usage} = $self->{memFreeReal64} ?
@@ -11,7 +11,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'memory usage is %.2f%%', $self->{memory_usage});
$self->set_thresholds(warning => 80, critical => 90);
$self->add_message($self->check_thresholds($self->{memory_usage}));
diff --git a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/MngmtSubsystem.pm b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/MngmtSubsystem.pm
index 38afba31..c4a58b38 100644
--- a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/MngmtSubsystem.pm
+++ b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/MngmtSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::mngmt::status/) {
$self->get_snmp_objects('CHECKPOINT-MIB', (qw(
mgStatShortDescr mgStatLongDescr)));
@@ -11,7 +11,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking mngmt');
if ($self->mode =~ /device::mngmt::status/) {
if (! defined $self->{mgStatShortDescr}) {
diff --git a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/PowersupplySubsystem.pm b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/PowersupplySubsystem.pm
index f4b0c035..7f4e5a86 100644
--- a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/PowersupplySubsystem.pm
+++ b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/PowersupplySubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('CHECKPOINT-MIB', [
['powersupplies', 'powerSupplyTable', 'Classes::CheckPoint::Firewall1::Component::PowersupplySubsystem::Powersupply'],
]);
@@ -14,7 +14,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
#Ignore Dummy values
if ($self->{powerSupplyStatus} ne 'Dummy') {
$self->add_info(sprintf 'power supply %d status is %s',
diff --git a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/SvnSubsystem.pm b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/SvnSubsystem.pm
index 633c3d0a..197ca0d3 100644
--- a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/SvnSubsystem.pm
+++ b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/SvnSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::svn::status/) {
$self->get_snmp_objects('CHECKPOINT-MIB', (qw(
svnStatShortDescr svnStatLongDescr)));
@@ -11,7 +11,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking svn');
if ($self->mode =~ /device::svn::status/) {
if ($self->{svnStatShortDescr} ne 'OK') {
diff --git a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/TemperatureSubsystem.pm b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/TemperatureSubsystem.pm
index ba6665a7..74daf9db 100644
--- a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/TemperatureSubsystem.pm
+++ b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/TemperatureSubsystem.pm
@@ -3,14 +3,14 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('CHECKPOINT-MIB', [
['temperatures', 'tempertureSensorTable', 'Classes::CheckPoint::Firewall1::Component::TemperatureSubsystem::Temperature'],
]);
}
sub check {
- my $self = shift;
+ my ($self) = @_;
foreach (@{$self->{temperatures}}) {
$_->check();
}
@@ -23,7 +23,7 @@ use strict;
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'temperature %s is %s (%d %s)',
$self->{tempertureSensorName}, $self->{tempertureSensorStatus},
$self->{tempertureSensorValue}, $self->{tempertureSensorUnit});
@@ -34,7 +34,6 @@ sub check {
} else {
$self->add_unknown();
}
- $self->set_thresholds(warning => 60, critical => 70);
$self->add_perfdata(
label => 'temperature_'.$self->{tempertureSensorName},
value => $self->{tempertureSensorValue},
diff --git a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/VoltageSubsystem.pm b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/VoltageSubsystem.pm
index 0f56b563..6202ef7c 100644
--- a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/VoltageSubsystem.pm
+++ b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/VoltageSubsystem.pm
@@ -3,14 +3,14 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('CHECKPOINT-MIB', [
['voltages', 'voltageSensorTable', 'Classes::CheckPoint::Firewall1::Component::VoltageSubsystem::Voltage'],
]);
}
sub check {
- my $self = shift;
+ my ($self) = @_;
foreach (@{$self->{voltages}}) {
$_->check();
}
@@ -22,7 +22,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'voltage %s is %s (%.2f %s)',
$self->{voltageSensorName}, $self->{voltageSensorStatus},
$self->{voltageSensorValue}, $self->{voltageSensorUnit});
diff --git a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/VpnSubsystem.pm b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/VpnSubsystem.pm
index f6490f5c..1c6f4c65 100644
--- a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/VpnSubsystem.pm
+++ b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/VpnSubsystem.pm
@@ -3,15 +3,15 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('CHECKPOINT-MIB', [
- ['tunnels', 'tunnelTable', 'Classes::CheckPoint::Firewall1::Component::VpnSubsystem::Tunnel', sub { my $o = shift; $o->filter_name($o->{tunnelPeerIpAddr}) || $o->filter_name($o->{tunnelPeerObjName}) } ],
- ['permanenttunnels', 'permanentTunnelTable', 'Classes::CheckPoint::Firewall1::Component::VpnSubsystem::PermanentTunnel, sub { my $o = shift; $o->filter_name($o->{permanentTunnelPeerIpAddr}) || $o->filter_name($o->{permanentTunnelPeerObjName}) }'],
+ ['tunnels', 'tunnelTable', 'Classes::CheckPoint::Firewall1::Component::VpnSubsystem::Tunnel', sub { my ($o) = @_; $o->filter_name($o->{tunnelPeerIpAddr}) || $o->filter_name($o->{tunnelPeerObjName}) } ],
+ ['permanenttunnels', 'permanentTunnelTable', 'Classes::CheckPoint::Firewall1::Component::VpnSubsystem::PermanentTunnel', sub { my ($o) = @_; $o->filter_name($o->{permanentTunnelPeerIpAddr}) || $o->filter_name($o->{permanentTunnelPeerObjName}) } ],
]);
}
sub check {
- my $self = shift;
+ my ($self) = @_;
if (! @{$self->{tunnels}} && ! @{$self->{permanenttunnels}}) {
$self->add_ok('no tunnels configured');
} else {
@@ -25,7 +25,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{flat_indices} =~ /^(\d+\.\d+\.\d+\.\d+)/;
$self->{tunnelPeerIpAddr} ||= $1;
$self->{tunnelPeerObjName} ||= $self->{tunnelPeerIpAddr};
@@ -35,7 +35,7 @@ sub finish {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'tunnel to %s is %s',
$self->{tunnelPeerObjName}, $self->{tunnelState});
if ($self->{tunnelState} =~ /^(destroy|down)$/) {
@@ -50,7 +50,7 @@ our @ISA = qw(Classes::CheckPoint::Firewall1::Component::VpnSubsystem::Tunnel);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{flat_indices} =~ /^(\d+\.\d+\.\d+\.\d+)/;
$self->{permanentTunnelPeerIpAddr} ||= $1;
$self->{permanentTunnelPeerObjName} ||= $self->{permanentTunnelPeerIpAddr};
@@ -60,7 +60,7 @@ sub finish {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'permanent tunnel to %s is %s',
$self->{permanentTunnelPeerObjName}, $self->{permanentTunnelState});
if ($self->{permanentTunnelState} =~ /^(destroy|down)$/) {
diff --git a/plugins-scripts/Classes/CheckPoint/Gaia.pm b/plugins-scripts/Classes/CheckPoint/Gaia.pm
index b5cb6aed..a13b27bb 100644
--- a/plugins-scripts/Classes/CheckPoint/Gaia.pm
+++ b/plugins-scripts/Classes/CheckPoint/Gaia.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::CheckPoint::Firewall1);
use strict;
sub xinit {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::CheckPoint::Firewall1::Component::EnvironmentalSubsystem");
$self->no_such_mode();
diff --git a/plugins-scripts/Classes/CheckPoint/VSX.pm b/plugins-scripts/Classes/CheckPoint/VSX.pm
index b911638e..6ef8b9f2 100644
--- a/plugins-scripts/Classes/CheckPoint/VSX.pm
+++ b/plugins-scripts/Classes/CheckPoint/VSX.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::CheckPoint);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::CheckPoint::Firewall1::Component::EnvironmentalSubsystem");
} elsif ($self->mode =~ /device::hardware::load/) {
diff --git a/plugins-scripts/Classes/CheckPoint/VSX/Component/FwSubsystem.pm b/plugins-scripts/Classes/CheckPoint/VSX/Component/FwSubsystem.pm
index bdd605b9..2464ef97 100644
--- a/plugins-scripts/Classes/CheckPoint/VSX/Component/FwSubsystem.pm
+++ b/plugins-scripts/Classes/CheckPoint/VSX/Component/FwSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('CHECKPOINT-MIB', (qw(
fwModuleState fwPolicyName)));
if ($self->mode =~ /device::fw::policy::installed/) {
@@ -28,7 +28,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking fw module');
if ($self->{fwModuleState} ne 'Installed') {
$self->add_critical(sprintf 'fw module is %s', $self->{fwPolicyName});
@@ -64,7 +64,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
my $label = sprintf 'vsx_%s_numconn', $self->{vsxStatusVsName};
$self->set_thresholds(metric => $label,
warning => 20000, critical => 23000);
diff --git a/plugins-scripts/Classes/Cisco.pm b/plugins-scripts/Classes/Cisco.pm
index f1ec270a..40bf668b 100644
--- a/plugins-scripts/Classes/Cisco.pm
+++ b/plugins-scripts/Classes/Cisco.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Device);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->{productname} =~ /Cisco NX-OS/i) {
$self->rebless('Classes::Cisco::NXOS');
} elsif ($self->{productname} =~ /Cisco Controller/i ||
@@ -37,6 +37,12 @@ sub init {
} else {
$self->no_such_mode();
}
+ } elsif ($self->mode =~ /device::interfaces::portsecurity/) {
+ if ($self->implements_mib('CISCO-PORT-SECURITY-MIB')) {
+ $self->analyze_and_check_interface_subsystem("Classes::Cisco::CISCOPORTSECURITYMIB::Component::InterfaceSubsystem");
+ } else {
+ $self->no_such_mode();
+ }
} else {
$self->init();
if ($self->mode =~ /device::interfaces::ifstack::status/ &&
diff --git a/plugins-scripts/Classes/Cisco/ASA.pm b/plugins-scripts/Classes/Cisco/ASA.pm
index 8e9099bf..417bcaa4 100644
--- a/plugins-scripts/Classes/Cisco/ASA.pm
+++ b/plugins-scripts/Classes/Cisco/ASA.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Cisco);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::Cisco::CISCOENTITYALARMMIB::Component::AlarmSubsystem");
$self->analyze_and_check_environmental_subsystem("Classes::Cisco::CISCOENTITYSENSORMIB::Component::SensorSubsystem");
diff --git a/plugins-scripts/Classes/Cisco/AsyncOS.pm b/plugins-scripts/Classes/Cisco/AsyncOS.pm
index 1e082bf5..041be3f2 100644
--- a/plugins-scripts/Classes/Cisco/AsyncOS.pm
+++ b/plugins-scripts/Classes/Cisco/AsyncOS.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Cisco);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::Cisco::AsyncOS::Component::EnvironmentalSubsystem");
} elsif ($self->mode =~ /device::hardware::load/) {
diff --git a/plugins-scripts/Classes/Cisco/AsyncOS/Component/CpuSubsystem.pm b/plugins-scripts/Classes/Cisco/AsyncOS/Component/CpuSubsystem.pm
index 599c5d21..0e4559d2 100644
--- a/plugins-scripts/Classes/Cisco/AsyncOS/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/AsyncOS/Component/CpuSubsystem.pm
@@ -3,13 +3,13 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('ASYNCOS-MAIL-MIB', (qw(
perCentCPUUtilization)));
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking cpus');
$self->add_info(sprintf 'cpu usage is %.2f%%',
$self->{perCentCPUUtilization});
diff --git a/plugins-scripts/Classes/Cisco/AsyncOS/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Cisco/AsyncOS/Component/EnvironmentalSubsystem.pm
index 002e7a48..9e25963b 100644
--- a/plugins-scripts/Classes/Cisco/AsyncOS/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/AsyncOS/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
#
# 1.3.6.1.4.1.9.9.13.1.1.0 ciscoEnvMonPresent (irgendein typ of envmon)
#
@@ -18,7 +18,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{fan_subsystem}->check();
$self->{temperature_subsystem}->check();
$self->{powersupply_subsystem}->check();
@@ -29,7 +29,7 @@ sub check {
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
$self->{fan_subsystem}->dump();
$self->{temperature_subsystem}->dump();
$self->{powersupply_subsystem}->dump();
diff --git a/plugins-scripts/Classes/Cisco/AsyncOS/Component/FanSubsystem.pm b/plugins-scripts/Classes/Cisco/AsyncOS/Component/FanSubsystem.pm
index 15155465..e3f06417 100644
--- a/plugins-scripts/Classes/Cisco/AsyncOS/Component/FanSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/AsyncOS/Component/FanSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('ASYNCOS-MAIL-MIB', [
['fans', 'fanTable', 'Classes::Cisco::AsyncOS::Component::FanSubsystem::Fan'],
]);
@@ -14,7 +14,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'fan %d (%s) has %s rpm',
$self->{fanIndex},
$self->{fanName},
diff --git a/plugins-scripts/Classes/Cisco/AsyncOS/Component/KeySubsystem.pm b/plugins-scripts/Classes/Cisco/AsyncOS/Component/KeySubsystem.pm
index 943a00e9..7d6a6ada 100644
--- a/plugins-scripts/Classes/Cisco/AsyncOS/Component/KeySubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/AsyncOS/Component/KeySubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('ASYNCOS-MAIL-MIB', [
['keys', 'keyExpirationTable', 'Classes::Cisco::AsyncOS::Component::KeySubsystem::Key'],
]);
@@ -14,7 +14,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{keyDaysUntilExpire} = int($self->{keySecondsUntilExpire} / 86400);
if ($self->{keyIsPerpetual} eq 'true') {
$self->add_info(sprintf 'perpetual key %d (%s) never expires',
diff --git a/plugins-scripts/Classes/Cisco/AsyncOS/Component/MemSubsystem.pm b/plugins-scripts/Classes/Cisco/AsyncOS/Component/MemSubsystem.pm
index 852e5c4f..39027927 100644
--- a/plugins-scripts/Classes/Cisco/AsyncOS/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/AsyncOS/Component/MemSubsystem.pm
@@ -3,13 +3,13 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('ASYNCOS-MAIL-MIB', (qw(
perCentMemoryUtilization memoryAvailabilityStatus)));
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking memory');
$self->add_info(sprintf 'memory usage is %.2f%% (%s)',
$self->{perCentMemoryUtilization}, $self->{memoryAvailabilityStatus});
diff --git a/plugins-scripts/Classes/Cisco/AsyncOS/Component/PowersupplySubsystem.pm b/plugins-scripts/Classes/Cisco/AsyncOS/Component/PowersupplySubsystem.pm
index 3c2d6fc4..1ae86146 100644
--- a/plugins-scripts/Classes/Cisco/AsyncOS/Component/PowersupplySubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/AsyncOS/Component/PowersupplySubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('ASYNCOS-MAIL-MIB', [
['supplies', 'powerSupplyTable', 'Classes::Cisco::AsyncOS::Component::PowersupplySubsystem::Powersupply'],
]);
@@ -14,7 +14,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'powersupply %d (%s) has status %s',
$self->{powerSupplyIndex},
$self->{powerSupplyName},
diff --git a/plugins-scripts/Classes/Cisco/AsyncOS/Component/RaidSubsystem.pm b/plugins-scripts/Classes/Cisco/AsyncOS/Component/RaidSubsystem.pm
index 99d0f2a0..50f8997d 100644
--- a/plugins-scripts/Classes/Cisco/AsyncOS/Component/RaidSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/AsyncOS/Component/RaidSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('ASYNCOS-MAIL-MIB', (qw(
raidEvents)));
$self->get_snmp_tables('ASYNCOS-MAIL-MIB', [
@@ -16,7 +16,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'raid %d has status %s',
$self->{raidIndex},
$self->{raidStatus});
diff --git a/plugins-scripts/Classes/Cisco/AsyncOS/Component/TemperatureSubsystem.pm b/plugins-scripts/Classes/Cisco/AsyncOS/Component/TemperatureSubsystem.pm
index d469e589..aded53f9 100644
--- a/plugins-scripts/Classes/Cisco/AsyncOS/Component/TemperatureSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/AsyncOS/Component/TemperatureSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('ASYNCOS-MAIL-MIB', [
['temperatures', 'temperatureTable', 'Classes::Cisco::AsyncOS::Component::TemperatureSubsystem::Temperature'],
]);
@@ -14,7 +14,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->set_thresholds(warning => 60, critical => 70);
$self->add_info(sprintf 'temperature %d (%s) is %s degree C',
$self->{temperatureIndex},
diff --git a/plugins-scripts/Classes/Cisco/CCM.pm b/plugins-scripts/Classes/Cisco/CCM.pm
index 149ddc97..2161edc9 100644
--- a/plugins-scripts/Classes/Cisco/CCM.pm
+++ b/plugins-scripts/Classes/Cisco/CCM.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Cisco);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::HOSTRESOURCESMIB::Component::EnvironmentalSubsystem");
} elsif ($self->mode =~ /device::hardware::load/) {
diff --git a/plugins-scripts/Classes/Cisco/CCM/Component/CmSubsystem.pm b/plugins-scripts/Classes/Cisco/CCM/Component/CmSubsystem.pm
index 0833044e..b28961fb 100644
--- a/plugins-scripts/Classes/Cisco/CCM/Component/CmSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/CCM/Component/CmSubsystem.pm
@@ -3,14 +3,14 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('CISCO-CCM-MIB', [
['ccms', 'ccmTable', 'Classes::Cisco::CCM::Component::CmSubsystem::Cm'],
]);
}
sub check {
- my $self = shift;
+ my ($self) = @_;
foreach (@{$self->{ccms}}) {
$_->check();
}
@@ -28,7 +28,7 @@ use strict;
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'cm %s is %s',
$self->{ccmName},
$self->{ccmStatus});
diff --git a/plugins-scripts/Classes/Cisco/CCM/Component/PhoneSubsystem.pm b/plugins-scripts/Classes/Cisco/CCM/Component/PhoneSubsystem.pm
index b85eb9ba..319d9b93 100644
--- a/plugins-scripts/Classes/Cisco/CCM/Component/PhoneSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/CCM/Component/PhoneSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('CISCO-CCM-MIB', (qw(
ccmRegisteredPhones ccmUnregisteredPhones ccmRejectedPhones)));
if (! defined $self->{ccmRegisteredPhones}) {
@@ -14,7 +14,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
if (! defined $self->{ccmRegisteredPhones}) {
foreach (qw(ccmRegisteredPhones ccmUnregisteredPhones ccmRejectedPhones)) {
$self->{$_} = 0;
@@ -25,12 +25,29 @@ sub check {
$self->add_unknown('unable to count phones');
}
}
+
$self->add_info(sprintf 'phones: %d registered, %d unregistered, %d rejected',
$self->{ccmRegisteredPhones},
$self->{ccmUnregisteredPhones},
$self->{ccmRejectedPhones});
- $self->set_thresholds(warning => 10, critical => 20);
- $self->add_message($self->check_thresholds($self->{ccmRejectedPhones}));
+
+ $self->set_thresholds(metric => 'registered',
+ warning => '0:', critical => '0:');
+ $self->set_level($self->check_thresholds(metric => 'registered',
+ value => $self->{ccmRegisteredPhones}));
+
+ $self->set_thresholds(metric => 'unregistered',
+ warning => 11, critical => 22);
+ $self->set_level($self->check_thresholds(metric => 'unregistered',
+ value => $self->{ccmUnregisteredPhones}));
+
+ $self->set_thresholds(metric => 'rejected',
+ warning => 110, critical => 120);
+ $self->set_level($self->check_thresholds(metric => 'rejected',
+ value => $self->{ccmRejectedPhones}));
+
+ $self->add_message($self->get_level());
+
$self->add_perfdata(
label => 'registered',
value => $self->{ccmRegisteredPhones},
diff --git a/plugins-scripts/Classes/Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm b/plugins-scripts/Classes/Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm
index 73c527ac..4b938fcf 100644
--- a/plugins-scripts/Classes/Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('CISCO-ENHANCED-MEMPOOL-MIB', [
['mems', 'cempMemPoolTable', 'Classes::Cisco::CISCOENHANCEDMEMPOOLMIB::Component::MemSubsystem::EnhMem'],
]);
@@ -14,12 +14,16 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
if (defined $self->{cempMemPoolHCUsed}) {
$self->{usage} = 100 * $self->{cempMemPoolHCUsed} /
($self->{cempMemPoolHCFree} + $self->{cempMemPoolHCUsed});
} else {
- $self->{usage} = 100 * $self->{cempMemPoolUsed} /
+ # there was a posixMemory with used=0, free=0
+ # (= heap mem for posix-like processes in modular ios)
+ $self->{usage} =
+ ($self->{cempMemPoolFree} + $self->{cempMemPoolUsed}) == 0 ? 0 :
+ 100 * $self->{cempMemPoolUsed} /
($self->{cempMemPoolFree} + $self->{cempMemPoolUsed});
}
$self->{type} = $self->{cempMemPoolType} ||= 0;
@@ -27,27 +31,37 @@ sub finish {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'mempool %s usage is %.2f%%',
$self->{name}, $self->{usage});
+ my $used100 = 0;
if ($self->{name} =~ /^lsmpi_io/ &&
$self->get_snmp_object('MIB-2-MIB', 'sysDescr', 0) =~ /IOS.*(XE|ASR1000)/i) {
# https://supportforums.cisco.com/docs/DOC-16425
- $self->force_thresholds(
- metric => $self->{name}.'_usage',
- warning => 100,
- critical => 100,
- );
+ $used100 = 1;
+ } elsif ($self->{name} =~ /global.*shared/i &&
+ $self->get_snmp_object('MIB-2-MIB', 'sysDescr', 0)
+ =~ /(asa|adaptive security appliance)/i) {
+ if ($self->get_snmp_object('MIB-2-MIB', 'sysDescr', 0) =~ /Version ([\d\.]+)/) {
+ $self->set_variable("version", $1);
+ if ($self->version_is_minimum("9.3.2")) {
+ # Cisco Adaptive Security Appliance Version 9.4(4)16
+ $used100 = 1;
+ }
+ }
} elsif ($self->{name} =~ /^reserved/ &&
$self->get_snmp_object('MIB-2-MIB', 'sysDescr', 0) =~ /IOS.*XR/i) {
# ASR9K "reserved" and "image" are always at 100%
- $self->force_thresholds(
- metric => $self->{name}.'_usage',
- warning => 100,
- critical => 100,
- );
+ $used100 = 1;
} elsif ($self->{name} =~ /^image/ &&
$self->get_snmp_object('MIB-2-MIB', 'sysDescr', 0) =~ /IOS.*XR/i) {
+ $used100 = 1;
+ } elsif ($self->{name} =~ /heapcache/i &&
+ $self->get_snmp_object('MIB-2-MIB', 'sysDescr', 0) =~ /adaptive/i) {
+ # MEMPOOL_HEAPCACHE_0. It's a cache, so usage >99% is fine imho
+ $used100 = 1;
+ }
+ if ($used100) {
$self->force_thresholds(
metric => $self->{name}.'_usage',
warning => 100,
diff --git a/plugins-scripts/Classes/Cisco/CISCOENTITYALARMMIB/Component/AlarmSubsystem.pm b/plugins-scripts/Classes/Cisco/CISCOENTITYALARMMIB/Component/AlarmSubsystem.pm
index 555157ad..6f2ef075 100644
--- a/plugins-scripts/Classes/Cisco/CISCOENTITYALARMMIB/Component/AlarmSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/CISCOENTITYALARMMIB/Component/AlarmSubsystem.pm
@@ -3,14 +3,14 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
my $alarms = {};
$self->get_snmp_tables('CISCO-ENTITY-ALARM-MIB', [
- ['alarms', 'ceAlarmTable', 'Classes::Cisco::CISCOENTITYSENSORMIB::Component::AlarmSubsystem::Alarm', sub { my $o = shift; $o->{parent} = $self; $self->filter_name($o->{entPhysicalIndex})}],
+ ['alarms', 'ceAlarmTable', 'Classes::Cisco::CISCOENTITYSENSORMIB::Component::AlarmSubsystem::Alarm', sub { my ($o) = @_; $o->{parent} = $self; $self->filter_name($o->{entPhysicalIndex})}],
['alarmdescriptionmappings', 'ceAlarmDescrMapTable', 'Classes::Cisco::CISCOENTITYSENSORMIB::Component::AlarmSubsystem::AlarmDescriptionMapping' ],
['alarmdescriptions', 'ceAlarmDescrTable', 'Classes::Cisco::CISCOENTITYSENSORMIB::Component::AlarmSubsystem::AlarmDescription' ],
['alarmfilterprofiles', 'ceAlarmFilterProfileTable', 'Classes::Cisco::CISCOENTITYSENSORMIB::Component::AlarmSubsystem::AlarmFilterProfile' ],
- ['alarmhistory', 'ceAlarmHistTable', 'Classes::Cisco::CISCOENTITYSENSORMIB::Component::AlarmSubsystem::AlarmHistory', sub { my $o = shift; $o->{parent} = $self; $self->filter_name($o->{entPhysicalIndex})}],
+ ['alarmhistory', 'ceAlarmHistTable', 'Classes::Cisco::CISCOENTITYSENSORMIB::Component::AlarmSubsystem::AlarmHistory', sub { my ($o) = @_; $o->{parent} = $self; $self->filter_name($o->{entPhysicalIndex})}],
]);
$self->get_snmp_tables('ENTITY-MIB', [
['entities', 'entPhysicalTable', 'Classes::Cisco::CISCOENTITYSENSORMIB::Component::AlarmSubsystem::PhysicalEntity'],
@@ -36,7 +36,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
if (scalar(@{$self->{alarms}}) == 0) {
$self->add_info('no alarms');
$self->add_ok();
@@ -59,7 +59,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{entPhysicalIndex} = $self->{flat_indices};
$self->{ceAlarmTypes} = [];
if ($self->{ceAlarmList}) {
@@ -82,7 +82,7 @@ sub finish {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
my $location = exists $self->{entity} ?
$self->{entity}->{entPhysicalDescr} : "unknown";
if (length($self->{ceAlarmTypes})) {
@@ -129,7 +129,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{entPhysicalIndex} = $self->{flat_indices};
}
@@ -137,7 +137,7 @@ package Classes::Cisco::CISCOENTITYSENSORMIB::Component::AlarmSubsystem::AlarmDe
our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{ceAlarmDescrIndex} = $self->{indices}->[0];
$self->{ceAlarmDescrAlarmType} = $self->{indices}->[1];
}
@@ -147,7 +147,7 @@ package Classes::Cisco::CISCOENTITYSENSORMIB::Component::AlarmSubsystem::AlarmDe
our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{ceAlarmDescrIndex} = $self->{indices}->[0];
}
@@ -158,13 +158,13 @@ package Classes::Cisco::CISCOENTITYSENSORMIB::Component::AlarmSubsystem::AlarmHi
our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{ceAlarmHistTimeStamp} = time - $self->uptime() + $self->timeticks($self->{ceAlarmHistTimeStamp});
$self->{ceAlarmHistTimeStampLocal} = scalar localtime $self->{ceAlarmHistTimeStamp};
}
sub check {
- my $self = shift;
+ my ($self) = @_;
my $vendortype = "unknown";
my @entities = grep {
$_->{entPhysicalIndex} == $self->{ceAlarmHistEntPhysicalIndex};
diff --git a/plugins-scripts/Classes/Cisco/CISCOENTITYALARMMIB/Component/SensorSubsystem.pm b/plugins-scripts/Classes/Cisco/CISCOENTITYALARMMIB/Component/SensorSubsystem.pm
index c7b629d9..8eb927fd 100644
--- a/plugins-scripts/Classes/Cisco/CISCOENTITYALARMMIB/Component/SensorSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/CISCOENTITYALARMMIB/Component/SensorSubsystem.pm
@@ -3,10 +3,10 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
my $sensors = {};
$self->get_snmp_tables('CISCO-ENTITY-SENSOR-MIB', [
- ['sensors', 'entSensorValueTable', 'Classes::Cisco::CISCOENTITYSENSORMIB::Component::SensorSubsystem::Sensor', sub { my $o = shift; $self->filter_name($o->{entPhysicalIndex})}],
+ ['sensors', 'entSensorValueTable', 'Classes::Cisco::CISCOENTITYSENSORMIB::Component::SensorSubsystem::Sensor', sub { my ($o) = @_; $self->filter_name($o->{entPhysicalIndex})}],
['thresholds', 'entSensorThresholdTable', 'Classes::Cisco::CISCOENTITYSENSORMIB::Component::SensorSubsystem::SensorThreshold'],
]);
$self->get_snmp_tables('ENTITY-MIB', [
@@ -33,7 +33,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{entPhysicalIndex} = $self->{flat_indices};
# www.thaiadmin.org%2Fboard%2Findex.php%3Faction%3Ddlattach%3Btopic%3D45832.0%3Battach%3D23494&ei=kV9zT7GHJ87EsgbEvpX6DQ&usg=AFQjCNHuHiS2MR9TIpYtu7C8bvgzuqxgMQ&cad=rja
# zu klaeren. entPhysicalIndex entspricht dem entPhysicalindex der ENTITY-MIB.
@@ -45,7 +45,7 @@ sub finish {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf '%s sensor %s%s is %s',
$self->{entSensorType},
$self->{entPhysicalIndex},
@@ -105,7 +105,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{entPhysicalIndex} = $self->{indices}->[0];
$self->{entSensorThresholdIndex} = $self->{indices}->[1];
}
@@ -116,7 +116,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{entPhysicalIndex} = $self->{flat_indices};
}
diff --git a/plugins-scripts/Classes/Cisco/CISCOENTITYFRUCONTROLMIB/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Cisco/CISCOENTITYFRUCONTROLMIB/Component/EnvironmentalSubsystem.pm
index 929eddc2..d53b6f5c 100644
--- a/plugins-scripts/Classes/Cisco/CISCOENTITYFRUCONTROLMIB/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/CISCOENTITYFRUCONTROLMIB/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{fan_subsystem} =
Classes::Cisco::CISCOENTITYFRUCONTROLMIB::Component::FanSubsystem->new();
$self->{powersupply_subsystem} =
@@ -13,7 +13,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{fan_subsystem}->check();
$self->{powersupply_subsystem}->check();
$self->{module_subsystem}->check();
@@ -23,7 +23,7 @@ sub check {
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
$self->{fan_subsystem}->dump();
$self->{powersupply_subsystem}->dump();
$self->{module_subsystem}->dump();
diff --git a/plugins-scripts/Classes/Cisco/CISCOENTITYFRUCONTROLMIB/Component/FanSubsystem.pm b/plugins-scripts/Classes/Cisco/CISCOENTITYFRUCONTROLMIB/Component/FanSubsystem.pm
index c63e16d5..34918d44 100644
--- a/plugins-scripts/Classes/Cisco/CISCOENTITYFRUCONTROLMIB/Component/FanSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/CISCOENTITYFRUCONTROLMIB/Component/FanSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('CISCO-ENTITY-FRU-CONTROL-MIB', [
['fans', 'cefcFanTrayStatusTable', 'Classes::Cisco::CISCOENTITYFRUCONTROLMIB::Component::FanSubsystem::Fan'],
]);
@@ -25,7 +25,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'fan/tray %s%s status is %s',
$self->{flat_indices},
#exists $self->{entity} ? ' ('.$self->{entity}->{entPhysicalDescr}.' idx '.$self->{entity}->{entPhysicalIndex}.' class '.$self->{entity}->{entPhysicalClass}.')' : '',
diff --git a/plugins-scripts/Classes/Cisco/CISCOENTITYFRUCONTROLMIB/Component/ModuleSubsystem.pm b/plugins-scripts/Classes/Cisco/CISCOENTITYFRUCONTROLMIB/Component/ModuleSubsystem.pm
index ddc6fc7b..0b246e08 100644
--- a/plugins-scripts/Classes/Cisco/CISCOENTITYFRUCONTROLMIB/Component/ModuleSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/CISCOENTITYFRUCONTROLMIB/Component/ModuleSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('CISCO-ENTITY-FRU-CONTROL-MIB', [
['modules', 'cefcModuleTable', 'Classes::Cisco::CISCOENTITYFRUCONTROLMIB::Component::ModuleSubsystem::Module'],
]);
@@ -25,7 +25,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
my @criticals = qw(failed missing okButPowerOverCritical powerDenied);
my @warnings = qw(mismatchWithParent mismatchConfig diagFailed
outOfServiceAdmin outOfServiceEnvTemp powerDown okButPowerOverWarning
diff --git a/plugins-scripts/Classes/Cisco/CISCOENTITYFRUCONTROLMIB/Component/PowersupplySubsystem.pm b/plugins-scripts/Classes/Cisco/CISCOENTITYFRUCONTROLMIB/Component/PowersupplySubsystem.pm
index 60aa7a2b..0c6d69e2 100644
--- a/plugins-scripts/Classes/Cisco/CISCOENTITYFRUCONTROLMIB/Component/PowersupplySubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/CISCOENTITYFRUCONTROLMIB/Component/PowersupplySubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('CISCO-ENTITY-FRU-CONTROL-MIB', [
['powersupplies', 'cefcFRUPowerStatusTable', 'Classes::Cisco::CISCOENTITYFRUCONTROLMIB::Component::PowersupplySubsystem::Powersupply'],
['powersupplygroups', 'cefcFRUPowerSupplyGroupTable', 'Classes::Cisco::CISCOENTITYFRUCONTROLMIB::Component::PowersupplySubsystem::PowersupplyGroup'],
@@ -27,7 +27,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'power supply %s%s admin status is %s, oper status is %s',
$self->{flat_indices},
#exists $self->{entity} ? ' ('.$self->{entity}->{entPhysicalDescr}.' idx '.$self->{entity}->{entPhysicalIndex}.' class '.$self->{entity}->{entPhysicalClass}.')' : '',
diff --git a/plugins-scripts/Classes/Cisco/CISCOENTITYSENSORMIB/Component/SensorSubsystem.pm b/plugins-scripts/Classes/Cisco/CISCOENTITYSENSORMIB/Component/SensorSubsystem.pm
index 89003ace..aa50fb80 100644
--- a/plugins-scripts/Classes/Cisco/CISCOENTITYSENSORMIB/Component/SensorSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/CISCOENTITYSENSORMIB/Component/SensorSubsystem.pm
@@ -3,10 +3,10 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
my $sensors = {};
$self->get_snmp_tables('CISCO-ENTITY-SENSOR-MIB', [
- ['sensors', 'entSensorValueTable', 'Classes::Cisco::CISCOENTITYSENSORMIB::Component::SensorSubsystem::Sensor', sub { my $o = shift; $self->filter_name($o->{entPhysicalIndex})}],
+ ['sensors', 'entSensorValueTable', 'Classes::Cisco::CISCOENTITYSENSORMIB::Component::SensorSubsystem::Sensor', sub { my ($o) = @_; $self->filter_name($o->{entPhysicalIndex})}],
['thresholds', 'entSensorThresholdTable', 'Classes::Cisco::CISCOENTITYSENSORMIB::Component::SensorSubsystem::SensorThreshold'],
]);
$self->get_snmp_tables('ENTITY-MIB', [
@@ -34,7 +34,7 @@ use strict;
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{entPhysicalIndex} = $self->{flat_indices};
# www.thaiadmin.org%2Fboard%2Findex.php%3Faction%3Ddlattach%3Btopic%3D45832.0%3Battach%3D23494&ei=kV9zT7GHJ87EsgbEvpX6DQ&usg=AFQjCNHuHiS2MR9TIpYtu7C8bvgzuqxgMQ&cad=rja
# zu klaeren. entPhysicalIndex entspricht dem entPhysicalindex der ENTITY-MIB.
@@ -46,7 +46,7 @@ sub finish {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf '%s sensor %s%s is %s',
$self->{entSensorType},
$self->{entPhysicalIndex},
@@ -188,7 +188,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{entPhysicalIndex} = $self->{indices}->[0];
$self->{entSensorThresholdIndex} = $self->{indices}->[1];
}
@@ -199,7 +199,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{entPhysicalIndex} = $self->{flat_indices};
}
diff --git a/plugins-scripts/Classes/Cisco/CISCOENVMONMIB/Component/FanSubsystem.pm b/plugins-scripts/Classes/Cisco/CISCOENVMONMIB/Component/FanSubsystem.pm
index a4eb0636..5c1c1253 100644
--- a/plugins-scripts/Classes/Cisco/CISCOENVMONMIB/Component/FanSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/CISCOENVMONMIB/Component/FanSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('CISCO-ENVMON-MIB', [
['fans', 'ciscoEnvMonFanStatusTable', 'Classes::Cisco::CISCOENVMONMIB::Component::FanSubsystem::Fan'],
]);
@@ -14,7 +14,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->ensure_index('ciscoEnvMonFanStatusIndex');
$self->add_info(sprintf 'fan %d (%s) is %s',
$self->{ciscoEnvMonFanStatusIndex},
diff --git a/plugins-scripts/Classes/Cisco/CISCOENVMONMIB/Component/PowersupplySubsystem.pm b/plugins-scripts/Classes/Cisco/CISCOENVMONMIB/Component/PowersupplySubsystem.pm
index 577e87ad..c8964e2b 100644
--- a/plugins-scripts/Classes/Cisco/CISCOENVMONMIB/Component/PowersupplySubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/CISCOENVMONMIB/Component/PowersupplySubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('CISCO-ENVMON-MIB', [
['supplies', 'ciscoEnvMonSupplyStatusTable', 'Classes::Cisco::CISCOENVMONMIB::Component::PowersupplySubsystem::Powersupply'],
]);
@@ -15,7 +15,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->ensure_index('ciscoEnvMonSupplyStatusIndex');
$self->add_info(sprintf 'powersupply %d (%s) is %s',
$self->{ciscoEnvMonSupplyStatusIndex},
diff --git a/plugins-scripts/Classes/Cisco/CISCOENVMONMIB/Component/TemperatureSubsystem.pm b/plugins-scripts/Classes/Cisco/CISCOENVMONMIB/Component/TemperatureSubsystem.pm
index ec30934a..8ed1e076 100644
--- a/plugins-scripts/Classes/Cisco/CISCOENVMONMIB/Component/TemperatureSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/CISCOENVMONMIB/Component/TemperatureSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('CISCO-ENVMON-MIB', [
['temperatures', 'ciscoEnvMonTemperatureStatusTable', 'Classes::Cisco::CISCOENVMONMIB::Component::TemperatureSubsystem::Temperature'],
]);
@@ -13,25 +13,17 @@ package Classes::Cisco::CISCOENVMONMIB::Component::TemperatureSubsystem::Tempera
our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
-sub new {
- my $class = shift;
- my %params = @_;
- my $self = {};
- foreach (keys %params) {
- $self->{$_} = $params{$_};
- }
- if ($self->{ciscoEnvMonTemperatureStatusValue}) {
- bless $self, $class;
- } else {
- bless $self, $class.'::Simple';
+sub finish {
+ my ($self) = @_;
+ if (! exists $self->{ciscoEnvMonTemperatureStatusValue}) {
+ bless $self, ref($self).'::Simple';
}
$self->ensure_index('ciscoEnvMonTemperatureStatusIndex');
$self->{ciscoEnvMonTemperatureLastShutdown} ||= 0;
- return $self;
}
sub check {
- my $self = shift;
+ my ($self) = @_;
if ($self->{ciscoEnvMonTemperatureStatusValue} >
$self->{ciscoEnvMonTemperatureThreshold}) {
$self->add_info(sprintf 'temperature %d %s is too high (%d of %d max = %s)',
@@ -51,6 +43,7 @@ sub check {
$self->{ciscoEnvMonTemperatureStatusDescr},
$self->{ciscoEnvMonTemperatureStatusValue},
$self->{ciscoEnvMonTemperatureThreshold});
+ $self->add_ok();
}
$self->add_perfdata(
label => sprintf('temp_%s', $self->{ciscoEnvMonTemperatureStatusIndex}),
@@ -66,7 +59,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{ciscoEnvMonTemperatureStatusIndex} ||= 0;
$self->{ciscoEnvMonTemperatureStatusDescr} ||= 0;
$self->add_info(sprintf 'temperature %d %s is %s',
@@ -80,6 +73,7 @@ sub check {
$self->add_critical();
}
} else {
+ $self->add_ok();
}
}
diff --git a/plugins-scripts/Classes/Cisco/CISCOENVMONMIB/Component/VoltageSubsystem.pm b/plugins-scripts/Classes/Cisco/CISCOENVMONMIB/Component/VoltageSubsystem.pm
index 80fbe07c..14bff7f7 100644
--- a/plugins-scripts/Classes/Cisco/CISCOENVMONMIB/Component/VoltageSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/CISCOENVMONMIB/Component/VoltageSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
my $index = 0;
$self->get_snmp_tables('CISCO-ENVMON-MIB', [
['voltages', 'ciscoEnvMonVoltageStatusTable', 'Classes::Cisco::CISCOENVMONMIB::Component::VoltageSubsystem::Voltage'],
@@ -11,7 +11,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
my $errorfound = 0;
$self->add_info('checking voltages');
if (scalar (@{$self->{voltages}}) == 0) {
@@ -28,7 +28,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->ensure_index('ciscoEnvMonVoltageStatusIndex');
$self->add_info(sprintf 'voltage %d (%s) is %s',
$self->{ciscoEnvMonVoltageStatusIndex},
diff --git a/plugins-scripts/Classes/Cisco/CISCOIPSECFLOWMONITOR/Component/VpnSubsystem.pm b/plugins-scripts/Classes/Cisco/CISCOIPSECFLOWMONITOR/Component/VpnSubsystem.pm
index c784209b..2c2b9cf5 100644
--- a/plugins-scripts/Classes/Cisco/CISCOIPSECFLOWMONITOR/Component/VpnSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/CISCOIPSECFLOWMONITOR/Component/VpnSubsystem.pm
@@ -3,39 +3,123 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
+ my $now = time;
+ $self->opts->override_opt('lookback', 1800) if ! $self->opts->lookback;
$self->get_snmp_tables('CISCO-IPSEC-FLOW-MONITOR-MIB', [
- ['ciketunnels', 'cikeTunnelTable', 'Classes::Cisco::CISCOIPSECFLOWMONITOR::Component::VpnSubsystem::CikeTunnel', sub { my $o = shift; $o->{parent} = $self; $self->filter_name($o->{cikeTunRemoteValue})}],
+ ['ciketunnels', 'cikeTunnelTable', 'Classes::Cisco::CISCOIPSECFLOWMONITOR::Component::VpnSubsystem::cikeTunnel', sub { my ($o) = @_; $o->filter_name($o->{cikeTunRemoteAddr}); }],
+ [ 'cikefails', 'cikeFailTable', 'Classes::Cisco::CISCOIPSECFLOWMONITOR::Component::VpnSubsystem::cikeFail', sub { my ($o) = @_; $o->filter_name($o->{cikeFailRemoteAddr}) && $o->{cikeFailTimeAgo} < $self->opts->lookback; }],
+ [ 'cipsecfails', 'cipSecFailTable', 'Classes::Cisco::CISCOIPSECFLOWMONITOR::Component::VpnSubsystem::cipSecFail', sub { my ($o) = @_; $o->filter_name($o->{cipSecFailPktDstAddr}) && $o->{cipSecFailTimeAgo} < $self->opts->lookback; }],
]);
}
sub check {
- my $self = shift;
- if (! @{$self->{ciketunnels}}) {
+ my ($self) = @_;
+ if ($self->opts->name && ! $self->opts->regexp && ! @{$self->{ciketunnels}}) {
$self->add_critical(sprintf 'tunnel to %s does not exist',
$self->opts->name);
+ } elsif (! @{$self->{ciketunnels}}) {
+ $self->add_unknown("no tunnels found");
} else {
foreach (@{$self->{ciketunnels}}) {
$_->check();
}
+ foreach (@{$self->{cikefails}}) {
+ $_->check();
+ }
+ foreach (@{$self->{cipsecfails}}) {
+ $_->check();
+ }
}
}
-package Classes::Cisco::CISCOIPSECFLOWMONITOR::Component::VpnSubsystem::CikeTunnel;
+package Classes::Cisco::CISCOIPSECFLOWMONITOR::Component::VpnSubsystem::cikeTunnel;
our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
+sub finish {
+ my ($self) = @_;
+ $self->{cikeTunLocalAddr} = $self->unhex_ip($self->{cikeTunLocalAddr});
+ $self->{cikeTunRemoteAddr} = $self->unhex_ip($self->{cikeTunRemoteAddr});
+}
+
sub check {
- my $self = shift;
-# cikeTunRemoteValue per --name angegeben, muss active sein
-# ansonsten watch-vpns, delta tunnels ueberwachen
- $self->add_info(sprintf 'tunnel to %s is %s',
- $self->{cikeTunRemoteValue}, $self->{cikeTunStatus});
- if ($self->{cikeTunStatus} ne 'active') {
+ my ($self) = @_;
+ $self->add_info(sprintf "tunnel %s%s->%s%s is %s",
+ $self->{cikeTunLocalAddr},
+ $self->{cikeTunLocalName} ? " (".$self->{cikeTunLocalName}.")" : "",
+ $self->{cikeTunRemoteAddr},
+ $self->{cikeTunRemoteName} ? " (".$self->{cikeTunRemoteName}.")" : "",
+ $self->{cikeTunStatus},
+ );
+ if ($self->{cikeTunStatus} ne "active") {
+ # ich bezweifle, dass man jemals hierher gelangt. die zeile
+ # wird schlichtweg verschwinden.
$self->add_critical();
} else {
$self->add_ok();
}
}
+
+# cipSecFailPhaseOne
+package Classes::Cisco::CISCOIPSECFLOWMONITOR::Component::VpnSubsystem::cikeFail;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
+
+sub finish {
+ my ($self) = @_;
+ $self->{cikeFailLocalAddr} = $self->unhex_ip($self->{cikeFailLocalAddr});
+ $self->{cikeFailLocalValue} = $self->unhex_ip($self->{cikeFailLocalValue});
+ $self->{cikeFailRemoteAddr} = $self->unhex_ip($self->{cikeFailRemoteAddr});
+ $self->{cikeFailRemoteValue} = $self->unhex_ip($self->{cikeFailRemoteValue});
+ $self->{cikeFailTime} /= 100;
+ $self->{cikeFailTimeAgo} = $self->ago_sysuptime($self->{cikeFailTime});
+}
+
+sub check {
+ my ($self) = @_;
+ $self->add_info(sprintf "%s phase1 failure %s->%s %s ago",
+ $self->{cikeFailReason},
+ $self->{cikeFailLocalAddr},
+ $self->{cikeFailRemoteAddr},
+ $self->human_timeticks($self->{cikeFailTimeAgo}),
+ );
+ $self->add_critical_mitigation();
+}
+
+
+# cipSecFailPhaseTwo
+package Classes::Cisco::CISCOIPSECFLOWMONITOR::Component::VpnSubsystem::cipSecFail;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
+
+sub ago {
+ my ($self, $eventtime) = @_;
+ my $sysUptime = $self->get_snmp_object('MIB-2-MIB', 'sysUpTime', 0);
+ if ($sysUptime < $self->uptime()) {
+ }
+}
+
+sub finish {
+ my ($self) = @_;
+ $self->{cipSecFailPktDstAddr} = $self->unhex_ip($self->{cipSecFailPktDstAddr});
+ $self->{cipSecFailPktSrcAddr} = $self->unhex_ip($self->{cipSecFailPktSrcAddr});
+ $self->{cipSecFailTime} /= 100;
+ $self->{cipSecFailTimeAgo} = $self->ago_sysuptime($self->{cipSecFailTime});
+}
+
+sub check {
+ my ($self) = @_;
+ $self->add_info(sprintf "%s phase2 failure %s->%s %s ago",
+ $self->{cipSecFailReason},
+ $self->{cipSecFailPktSrcAddr},
+ $self->{cipSecFailPktDstAddr},
+ $self->human_timeticks($self->{cipSecFailTimeAgo}),
+ );
+ if ($self->{cipSecFailReason} eq "other") {
+ # passiert stuendlich, kann wohl ein simpler idle-timeout sein
+ } else {
+ $self->add_critical_mitigation();
+ }
+}
+
diff --git a/plugins-scripts/Classes/Cisco/CISCOMEMORYPOOLMIB/Component/MemSubsystem.pm b/plugins-scripts/Classes/Cisco/CISCOMEMORYPOOLMIB/Component/MemSubsystem.pm
index 163f331d..613f61ba 100644
--- a/plugins-scripts/Classes/Cisco/CISCOMEMORYPOOLMIB/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/CISCOMEMORYPOOLMIB/Component/MemSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->mult_snmp_max_msg_size(2);
$self->get_snmp_tables('CISCO-MEMORY-POOL-MIB', [
['mems', 'ciscoMemoryPoolTable', 'Classes::Cisco::CISCOMEMORYPOOLMIB::Component::MemSubsystem::Mem'],
@@ -15,7 +15,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{usage} = 100 * $self->{ciscoMemoryPoolUsed} /
($self->{ciscoMemoryPoolFree} + $self->{ciscoMemoryPoolUsed});
$self->{type} = $self->{ciscoMemoryPoolType} ||= 0;
@@ -23,7 +23,7 @@ sub finish {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'mempool %s usage is %.2f%%',
$self->{name}, $self->{usage});
if ($self->{name} =~ /^lsmpi_io/ &&
diff --git a/plugins-scripts/Classes/Cisco/CISCOPORTSECURITYMIB/Component/InterfaceSubsystem.pm b/plugins-scripts/Classes/Cisco/CISCOPORTSECURITYMIB/Component/InterfaceSubsystem.pm
new file mode 100644
index 00000000..5faed204
--- /dev/null
+++ b/plugins-scripts/Classes/Cisco/CISCOPORTSECURITYMIB/Component/InterfaceSubsystem.pm
@@ -0,0 +1,134 @@
+package Classes::Cisco::CISCOPORTSECURITYMIB::Component::InterfaceSubsystem;
+our @ISA = qw(Classes::IFMIB::Component::InterfaceSubsystem);
+use strict;
+
+sub init {
+ my ($self) = @_;
+ my @iftable_columns = qw(ifIndex ifDescr ifAlias ifName);
+ my @cpsifconfigtable_columns = ();
+ if ($self->mode =~ /device::interfaces::portsecurity/) {
+ $self->get_snmp_objects('CISCO-PORT-SECURITY-MIB', qw(cpsGlobalPortSecurityEnable));
+ if ($self->{cpsGlobalPortSecurityEnable} eq 'false') {
+ return;
+ }
+ push(@iftable_columns, qw(
+ ifOperStatus ifAdminStatus
+ ));
+ push(@cpsifconfigtable_columns, qw(
+ cpsIfPortSecurityEnable cpsIfPortSecurityStatus cpsIfViolationCount
+ cpsIfSecureLastMacAddress
+ ));
+ } else {
+ $self->SUPER::init();
+ }
+ if ($self->mode =~ /device::interfaces::portsecurity/) {
+ my $if_has_changed = $self->update_interface_cache(0);
+ my $only_admin_up =
+ $self->opts->name && $self->opts->name eq '_adminup_' ? 1 : 0;
+ my $only_oper_up =
+ $self->opts->name && $self->opts->name eq '_operup_' ? 1 : 0;
+ if ($only_admin_up || $only_oper_up) {
+ $self->override_opt('name', undef);
+ $self->override_opt('drecksptkdb', undef);
+ }
+ my @indices = $self->get_interface_indices();
+ my @all_indices = @indices;
+ my @selected_indices = ();
+ if (! $self->opts->name && ! $self->opts->name3) {
+ # get_table erzwingen
+ @indices = ();
+ $self->bulk_is_baeh(10);
+ }
+ if (!$self->opts->name || scalar(@indices) > 0) {
+ my @save_indices = @indices; # die werden in get_snmp_table_objects geshiftet
+ foreach ($self->get_snmp_table_objects(
+ 'IFMIB', 'ifTable+ifXTable', \@indices, \@iftable_columns)) {
+ next if $only_admin_up && $_->{ifAdminStatus} ne 'up';
+ next if $only_oper_up && $_->{ifOperStatus} ne 'up';
+ my $interface = Classes::Cisco::CISCOPORTSECURITYMIB::Component::InterfaceSubsystem::Interface->new(%{$_});
+ $interface->{columns} = [@iftable_columns];
+ push(@{$self->{interfaces}}, $interface);
+ }
+ @indices = map { [$_->{ifIndex}]; } @{$self->{interfaces}};
+ if (! $self->opts->name && ! $self->opts->name3) {
+ $self->get_snmp_tables('CISCO-PORT-SECURITY-MIB', [
+ ['cpsifs', 'cpsIfConfigTable', 'Classes::Cisco::CISCOPORTSECURITYMIB::Component::InterfaceSubsystem::CpsIf'],
+ ]);
+ } else {
+ $self->{cpsifs} = [];
+ foreach ($self->get_snmp_table_objects(
+ 'CISCO-PORT-SECURITY-MIB', 'cpsIfConfigTable', \@indices, \@cpsifconfigtable_columns)) {
+ my $interface = Classes::Cisco::CISCOPORTSECURITYMIB::Component::InterfaceSubsystem::CpsIf->new(%{$_});
+ push(@{$self->{cpsifs}}, $interface);
+ }
+ }
+ $self->merge_tables('interfaces', 'cpsifs');
+ @{$self->{interfaces}} = grep {
+ exists $_->{cpsIfPortSecurityEnable} &&
+ $_->{cpsIfPortSecurityEnable} eq 'true';
+ } @{$self->{interfaces}};
+ }
+ } else {
+ $self->SUPER::init();
+ }
+}
+
+sub check {
+ my ($self) = @_;
+ if ($self->mode =~ /device::interfaces::portsecurity/) {
+ if ($self->{cpsGlobalPortSecurityEnable} eq 'true') {
+ $self->SUPER::check();
+ } else {
+ $self->add_ok("port security is not enabled on this device");
+ }
+ } else {
+ $self->SUPER::check();
+ }
+}
+
+package Classes::Cisco::CISCOPORTSECURITYMIB::Component::InterfaceSubsystem::CpsIf;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
+use strict;
+
+sub finish {
+ my ($self) = @_;
+ $self->{cpsIfSecureLastMacAddress} = $self->{cpsIfSecureLastMacAddress} ?
+ $self->unhex_mac($self->{cpsIfSecureLastMacAddress}) : '-unknown-';
+
+}
+
+package Classes::Cisco::CISCOPORTSECURITYMIB::Component::InterfaceSubsystem::Interface;
+our @ISA = qw(Classes::IFMIB::Component::InterfaceSubsystem::Interface);
+use strict;
+
+
+sub check {
+ my ($self) = @_;
+ my $full_descr = sprintf "%s%s",
+ $self->{ifDescr},
+ $self->{ifAlias} && $self->{ifAlias} ne $self->{ifDescr} ?
+ " (alias ".$self->{ifAlias}.")" : "";
+ if ($self->mode =~ /device::interfaces::portsecurity/) {
+ if ($self->{cpsIfPortSecurityEnable} eq 'false') {
+ $self->add_info(sprintf 'interface %s security not enabled',
+ $full_descr);
+ $self->add_ok();
+ } else {
+ $self->add_info(sprintf 'interface %s security status is %s',
+ $full_descr, $self->{cpsIfPortSecurityStatus});
+ if ($self->{cpsIfPortSecurityStatus} eq 'secureup') {
+ $self->add_ok();
+ } elsif ($self->{cpsIfPortSecurityStatus} eq 'securedown') {
+ $self->annotate_info('last mac address was '.$self->{cpsIfSecureLastMacAddress});
+ $self->add_unknown_mitigation();
+ } elsif ($self->{cpsIfPortSecurityStatus} eq 'shutdown') {
+ $self->annotate_info('last mac address was '.$self->{cpsIfSecureLastMacAddress});
+ $self->add_critical();
+ }
+ }
+ } else {
+ $self->SUPER::check();
+ }
+}
+
+
diff --git a/plugins-scripts/Classes/Cisco/CISCOSTACKWISEMIB/Component/StackSubsystem.pm b/plugins-scripts/Classes/Cisco/CISCOSTACKWISEMIB/Component/StackSubsystem.pm
index 35940c14..66a96de8 100644
--- a/plugins-scripts/Classes/Cisco/CISCOSTACKWISEMIB/Component/StackSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/CISCOSTACKWISEMIB/Component/StackSubsystem.pm
@@ -7,14 +7,22 @@ use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
sub init {
my ($self) = @_;
$self->get_snmp_objects('CISCO-STACKWISE-MIB', qw(cswMaxSwitchNum
- cswRingRedundant ciscoStackWiseMIBConform cswStackWiseMIBCompliances
+ cswRingRedundant cswStackBandWidth ciscoStackWiseMIBConform
+ cswStackWiseMIBCompliances
));
- $self->get_snmp_tables("CISCO-STACKWISE-MIB", [
- ['switches', 'cswSwitchInfoTable', 'Classes::Cisco::CISCOSTACKWISEMIB::Component::StackSubsystem::Switch'],
- ['ports', 'cswStackPortInfoTable', 'Classes::Cisco::CISCOSTACKWISEMIB::Component::StackSubsystem::Port'],
- #['powers', 'cswStackPowerInfoTable', 'Monitoring::GLPlugin::SNMP::TableItem'],
- #['powerports', 'cswStackPowerPortInfoTable', 'Monitoring::GLPlugin::SNMP::TableItem'],
- ]);
+ # cswStackType is not uniqe enough depening of IOS-XE version.
+ # cswStackBandWidth exists only on distributed switches with SVL
+ if ($self->{cswStackBandWidth}) {
+ $self->get_snmp_tables("CISCO-STACKWISE-MIB", [
+ ['switches', 'cswSwitchInfoTable', 'Classes::Cisco::CISCOSTACKWISEMIB::Component::StackSubsystem::Switch'],
+ ['ports', 'cswDistrStackPhyPortInfoEntry', 'Classes::Cisco::CISCOSTACKWISEMIB::Component::StackSubsystem::PhyPort'],
+ ]);
+ } else {
+ $self->get_snmp_tables("CISCO-STACKWISE-MIB", [
+ ['switches', 'cswSwitchInfoTable', 'Classes::Cisco::CISCOSTACKWISEMIB::Component::StackSubsystem::Switch'],
+ ['ports', 'cswStackPortInfoTable', 'Classes::Cisco::CISCOSTACKWISEMIB::Component::StackSubsystem::Port'],
+ ]);
+ };
$self->{numSwitches} = scalar(@{$self->{switches}});
$self->{switchSerialList} = [map { $_->{flat_indices} } @{$self->{switches}}];
$self->{numPorts} = scalar(@{$self->{ports}});
@@ -25,10 +33,16 @@ sub check {
foreach (@{$self->{switches}}) {
$_->check();
}
- $self->add_info(sprintf 'ring is %sredundant',
- $self->{cswRingRedundant} ne 'true' ? 'not ' : '');
- if ($self->{cswRingRedundant} ne 'true' && $self->{numSwitches} > 1) {
- $self->add_warning();
+ if ($self->{cswStackBandWidth}) {
+ $self->add_info(sprintf
+ 'this is a distributed stack with bandwidth %d Gbit/s',
+ $self->{cswStackBandWidth});
+ } else {
+ $self->add_info(sprintf 'ring is %sredundant',
+ $self->{cswRingRedundant} ne 'true' ? 'not ' : '');
+ if ($self->{cswRingRedundant} ne 'true' && $self->{numSwitches} > 1) {
+ $self->add_warning();
+ }
}
$self->opts->override_opt('lookback', 1800) if ! $self->opts->lookback;
$self->valdiff({name => 'stackwise', lastarray => 1},
@@ -66,6 +80,16 @@ sub check {
);
}
+package Classes::Cisco::CISCOSTACKWISEMIB::Component::StackSubsystem::PhyPort;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
+
+sub check {
+ my ($self) = @_;
+ $self->add_info(sprintf 'link to neighbor %s is %s',
+ $self->{cswDistrStackPhyPortNbr}, $self->{cswDistrStackPhyPortOperStatus}
+ );
+}
+
package Classes::Cisco::CISCOSTACKWISEMIB::Component::StackSubsystem::Switch;
our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
diff --git a/plugins-scripts/Classes/Cisco/IOS.pm b/plugins-scripts/Classes/Cisco/IOS.pm
index 2864ef80..2db93b36 100644
--- a/plugins-scripts/Classes/Cisco/IOS.pm
+++ b/plugins-scripts/Classes/Cisco/IOS.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Cisco);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::chassis::health/) {
if ($self->implements_mib('CISCO-STACK-MIB')) {
$self->analyze_and_check_environmental_subsystem("Classes::Cisco::CISCOSTACKMIB::Component::StackSubsystem");
@@ -34,10 +34,13 @@ sub init {
$self->analyze_and_check_config_subsystem("Classes::Cisco::IOS::Component::NatSubsystem");
} elsif ($self->mode =~ /device::interfaces::nat::rejects/) {
$self->analyze_and_check_config_subsystem("Classes::Cisco::IOS::Component::NatSubsystem");
- } elsif ($self->mode =~ /device::bgp::prefix::count/) {
- $self->analyze_and_check_config_subsystem("Classes::Cisco::IOS::Component::BgpSubsystem");
+ #} elsif ($self->mode =~ /device::bgp::prefix::count/) {
+ } elsif ($self->mode =~ /device::bgp/) {
+ $self->analyze_and_check_bgp_subsystem("Classes::BGP::Component::PeerSubsystem");
} elsif ($self->mode =~ /device::wlan/ && $self->implements_mib('AIRESPACE-WIRELESS-MIB')) {
$self->analyze_and_check_wlan_subsystem("Classes::Cisco::WLC::Component::WlanSubsystem");
+ } elsif ($self->mode =~ /device::vpn::status/) {
+ $self->analyze_and_check_config_subsystem("Classes::Cisco::CISCOIPSECFLOWMONITOR::Component::VpnSubsystem");
} else {
$self->no_such_mode();
}
diff --git a/plugins-scripts/Classes/Cisco/IOS/Component/BgpSubsystem.pm b/plugins-scripts/Classes/Cisco/IOS/Component/BgpSubsystem.pm
index cf2716e6..0d1f2acd 100644
--- a/plugins-scripts/Classes/Cisco/IOS/Component/BgpSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/IOS/Component/BgpSubsystem.pm
@@ -1,22 +1,46 @@
package Classes::Cisco::IOS::Component::BgpSubsystem;
-our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
+our @ISA = qw(Classes::BGP::Component::PeerSubsystem Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
- $self->get_snmp_tables('CISCO-BGP4-MIB', [
- ['peers', 'cbgpPeerAddrFamilyPrefixTable', 'Classes::Cisco::IOS::Component::BgpSubsystem::Peer', sub { return $self->filter_name(shift->{cbgpPeerRemoteAddr}) } ],
- ]);
+ my ($self) = @_;
+ if ($self->mode =~ /device::bgp::prefix::count/) {
+ $self->get_snmp_tables('CISCO-BGP4-MIB', [
+ ['peers', 'cbgpPeer2AddrFamilyPrefixTable', 'Classes::Cisco::IOS::Component::BgpSubsystem::Peer2', sub { return $self->filter_name(shift->{cbgpPeer2RemoteAddr}) } ],
+ ]);
+ if (! @{$self->{peers}}) {
+ $self->get_snmp_tables('CISCO-BGP4-MIB', [
+ ['peers', 'cbgpPeerAddrFamilyPrefixTable', 'Classes::Cisco::IOS::Component::BgpSubsystem::Peer', sub { return $self->filter_name(shift->{cbgpPeerRemoteAddr}) } ],
+ ]);
+ }
+ } else {
+ $self->get_snmp_tables('CISCO-BGP4-MIB', [
+ ['peers', 'cbgpPeer2Table', 'Classes::Cisco::IOS::Component::BgpSubsystem::Peer2', sub { return $self->filter_name(shift->{cbgpPeer2RemoteAddr}) } ],
+ ]);
+ if (! @{$self->{peers}}) {
+ $self->get_snmp_tables('CISCO-BGP4-MIB', [
+ ['peers', 'cbgpPeerTable', 'Classes::Cisco::IOS::Component::BgpSubsystem::Peer', sub { return $self->filter_name(shift->{cbgpPeerRemoteAddr}) } ],
+ ]);
+ }
+ if (scalar(@{$self->{peers}}) == 0) {
+ bless $self, "Classes::BGP::Component::PeerSubsystem";
+ $self->init();
+ }
+ }
}
sub check {
- my $self = shift;
- if ($self->mode =~ /prefix::count/) {
+ my ($self) = @_;
+ if ($self->mode =~ /device::bgp::prefix::count/) {
if (scalar(@{$self->{peers}}) == 0) {
$self->add_critical('no peers found');
} else {
- $self->SUPER::check();
+ foreach (@{$self->{peers}}) {
+ $_->check();
+ }
}
+ } else {
+ $self->SUPER::check();
}
}
@@ -25,25 +49,93 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
- $self->{cbgpPeerAddrFamilyAfi} = pop @{$self->{indices}};
- $self->{cbgpPeerAddrFamilySafi} = pop @{$self->{indices}};
- $self->{cbgpPeerRemoteAddr} = join(".", @{$self->{indices}});
+ my ($self) = @_;
+ if ($self->mode =~ /device::bgp::prefix::count/) {
+ $self->{cbgpPeerAddrFamilySafi} = pop @{$self->{indices}};
+ $self->{cbgpPeerAddrFamilyAfi} = pop @{$self->{indices}};
+ $self->{cbgpPeerRemoteAddr} = join(".", @{$self->{indices}});
+ }
}
sub check {
- my $self = shift;
- if ($self->mode =~ /prefix::count/) {
+ my ($self) = @_;
+ if ($self->mode =~ /device::bgp::prefix::count/) {
$self->add_info(sprintf "peer %s accepted %d prefixes",
- $self->{cbgpPeerRemoteAddr}, $self->{cbgpPeerAddrAcceptedPrefixes});
+ $self->{cbgpPeerRemoteAddr}, $self->{cbgpPeerAcceptedPrefixes});
$self->set_thresholds(metric => $self->{cbgpPeerRemoteAddr}.'_accepted_prefixes',
warning => '1:', critical => '1:');
$self->add_message($self->check_thresholds(
metric => $self->{cbgpPeerRemoteAddr}.'_accepted_prefixes',
- value => $self->{cbgpPeerAddrAcceptedPrefixes}));
+ value => $self->{cbgpPeerAcceptedPrefixes}));
$self->add_perfdata(
label => $self->{cbgpPeerRemoteAddr}.'_accepted_prefixes',
- value => $self->{cbgpPeerAddrAcceptedPrefixes},
+ value => $self->{cbgpPeerAcceptedPrefixes},
+ );
+ }
+}
+
+package Classes::Cisco::IOS::Component::BgpSubsystem::Peer2;
+our @ISA = qw(Classes::BGP::Component::PeerSubsystem::Peer Monitoring::GLPlugin::SNMP::TableItem);
+use strict;
+
+sub finish {
+ my ($self) = @_;
+ if ($self->mode =~ /device::bgp::prefix::count/) {
+ $self->{cbgpPeer2AddrFamilySafi} = pop @{$self->{indices}};
+ $self->{cbgpPeer2AddrFamilyAfi} = pop @{$self->{indices}};
+ $self->{cbgpPeer2Type} = shift @{$self->{indices}};
+ # ja mei
+ $self->{cbgpPeer2Type} = shift @{$self->{indices}};
+ if (scalar(@{$self->{indices}}) > 4) {
+ $self->{cbgpPeer2RemoteAddr} = pack "C*", @{$self->{indices}};
+ $self->{cbgpPeer2RemoteAddr} = $self->unhex_ipv6($self->{cbgpPeer2RemoteAddr});
+ } else {
+ $self->{cbgpPeer2RemoteAddr} = join(".", @{$self->{indices}});
+ }
+ } else {
+ $self->{cbgpPeer2Type} = shift @{$self->{indices}};
+ $self->{cbgpPeer2Type} = shift @{$self->{indices}};
+ if (scalar(@{$self->{indices}}) > 4) {
+ $self->{cbgpPeer2RemoteAddr} = pack "C*", @{$self->{indices}};
+ $self->{cbgpPeer2RemoteAddr} = $self->unhex_ipv6($self->{cbgpPeer2RemoteAddr});
+ } else {
+ $self->{cbgpPeer2RemoteAddr} = join(".", @{$self->{indices}});
+ }
+ }
+ if ($self->mode !~ /device::bgp::prefix::count/) {
+ # na dasporama ohm en Item a eigns check und ko des vom
+ # Classes::BGP hernehma.
+ my @mapping = (
+ ["bgpPeerRemoteAddr", "cbgpPeer2RemoteAddr"],
+ ["bgpPeerRemoteAs", "cbgpPeer2RemoteAs"],
+ ["bgpPeerAdminStatus", "cbgpPeer2AdminStatus"],
+ ["bgpPeerLastError", "cbgpPeer2LastError"],
+ ["bgpPeerFsmEstablishedTime", "cbgpPeer2FsmEstablishedTime"],
+ ["bgpPeerState", "cbgpPeer2State"],
+ );
+ foreach (@mapping) {
+ $self->{$_->[0]} = $self->{$_->[1]};
+ }
+ $self->SUPER::finish();
+ }
+}
+
+sub check {
+ my ($self) = @_;
+ if ($self->mode =~ /device::bgp::prefix::count/) {
+ $self->add_info(sprintf "peer %s accepted %d prefixes",
+ $self->{cbgpPeer2RemoteAddr}, $self->{cbgpPeer2AcceptedPrefixes});
+ $self->set_thresholds(metric => $self->{cbgpPeer2RemoteAddr}.'_accepted_prefixes',
+ warning => '1:', critical => '1:');
+ $self->add_message($self->check_thresholds(
+ metric => $self->{cbgpPeer2RemoteAddr}.'_accepted_prefixes',
+ value => $self->{cbgpPeer2AcceptedPrefixes}));
+ $self->add_perfdata(
+ label => $self->{cbgpPeer2RemoteAddr}.'_accepted_prefixes',
+ value => $self->{cbgpPeer2AcceptedPrefixes},
);
+ } else {
+ $self->SUPER::check();
}
}
+
diff --git a/plugins-scripts/Classes/Cisco/IOS/Component/ConfigSubsystem.pm b/plugins-scripts/Classes/Cisco/IOS/Component/ConfigSubsystem.pm
index 6654a4a7..3074d01c 100644
--- a/plugins-scripts/Classes/Cisco/IOS/Component/ConfigSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/IOS/Component/ConfigSubsystem.pm
@@ -4,7 +4,7 @@ use strict;
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('CISCO-CONFIG-MAN-MIB', (qw(
ccmHistoryRunningLastChanged ccmHistoryRunningLastSaved
ccmHistoryStartupLastChanged)));
@@ -18,7 +18,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
my $info;
my $runningChangedMarginAfterReload = 300;
$self->add_info('checking config');
@@ -64,7 +64,7 @@ sub check {
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
printf "[CONFIG]\n";
foreach (qw(ccmHistoryRunningLastChanged ccmHistoryRunningLastSaved ccmHistoryStartupLastChanged)) {
printf "%s: %s (%s)\n", $_, $self->{$_}, scalar localtime $self->{$_};
diff --git a/plugins-scripts/Classes/Cisco/IOS/Component/ConnectionSubsystem.pm b/plugins-scripts/Classes/Cisco/IOS/Component/ConnectionSubsystem.pm
index 8e46106b..a9576505 100644
--- a/plugins-scripts/Classes/Cisco/IOS/Component/ConnectionSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/IOS/Component/ConnectionSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('CISCO-FIREWALL-MIB', [
['connectionstates', 'cfwConnectionStatTable', 'Classes::Cisco::IOS::Component::ConnectionSubsystem::ConnectionState'],
]);
@@ -14,7 +14,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
if ($self->{cfwConnectionStatDescription} !~ /number of connections currently in use/i) {
$self->add_blacklist(sprintf 'c:%s', $self->{cfwConnectionStatDescription});
$self->add_info(sprintf '%d connections currently in use',
diff --git a/plugins-scripts/Classes/Cisco/IOS/Component/CpuSubsystem.pm b/plugins-scripts/Classes/Cisco/IOS/Component/CpuSubsystem.pm
index 4cb58c57..2e5fb8f4 100644
--- a/plugins-scripts/Classes/Cisco/IOS/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/IOS/Component/CpuSubsystem.pm
@@ -11,7 +11,7 @@ use constant PHYS_DESCR => 4;
}
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('CISCO-PROCESS-MIB', [
['cpus', 'cpmCPUTotalTable', 'Classes::Cisco::IOS::Component::CpuSubsystem::Cpu' ],
]);
@@ -57,7 +57,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{cpmCPUTotalIndex} = $self->{flat_indices};
$self->{cpmCPUTotalPhysicalIndex} = exists $self->{cpmCPUTotalPhysicalIndex} ?
$self->{cpmCPUTotalPhysicalIndex} : 0;
@@ -95,7 +95,7 @@ sub finish {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{label} = $self->{name};
$self->add_info(sprintf 'cpu %s usage (5 min avg.) is %.2f%%',
$self->{name}, $self->{usage});
diff --git a/plugins-scripts/Classes/Cisco/IOS/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Cisco/IOS/Component/EnvironmentalSubsystem.pm
index aa10f0e4..bad96230 100644
--- a/plugins-scripts/Classes/Cisco/IOS/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/IOS/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
my $has_envmon = 0;
#
# 1.3.6.1.4.1.9.9.13.1.1.0 ciscoEnvMonPresent (irgendein typ of envmon)
@@ -58,7 +58,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
foreach my $subsys (qw(fan_subsystem temperature_subsystem
powersupply_subsystem voltage_subsystem fru_subsystem
sensor_subsystem alarm_subsystem)) {
@@ -72,7 +72,7 @@ sub check {
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
foreach my $subsys (qw(fan_subsystem temperature_subsystem
powersupply_subsystem voltage_subsystem fru_subsystem
sensor_subsystem alarm_subsystem)) {
diff --git a/plugins-scripts/Classes/Cisco/IOS/Component/HaSubsystem.pm b/plugins-scripts/Classes/Cisco/IOS/Component/HaSubsystem.pm
index 9d3ef806..c2018907 100644
--- a/plugins-scripts/Classes/Cisco/IOS/Component/HaSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/IOS/Component/HaSubsystem.pm
@@ -111,8 +111,9 @@ sub check {
$self->{cfwHardwareStatusDetail});
if ($self->{cfwHardwareStatusDetail} eq "Failover Off") {
$self->add_ok();
- } elsif ($self->{cfwHardwareStatusDetail} =~ /FAILOVER/) {
- $self->add_warning_mitigation("cluster has switched");
+# } elsif ($self->{cfwHardwareStatusDetail} =~ /FAILOVER/) {
+# kommt verdaechtig oft vor und schaut so aus, als waere das normal
+# $self->add_warning_mitigation("cluster has switched");
} elsif ($self->{cfwHardwareStatusValue} eq "error") {
$self->add_warning_mitigation("cluster has lost redundancy");
} elsif ($self->{cfwHardwareStatusValue} ne "up") {
diff --git a/plugins-scripts/Classes/Cisco/IOS/Component/MemSubsystem.pm b/plugins-scripts/Classes/Cisco/IOS/Component/MemSubsystem.pm
index d831f72a..4a76e8b8 100644
--- a/plugins-scripts/Classes/Cisco/IOS/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/IOS/Component/MemSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->implements_mib('CISCO-ENHANCED-MEMPOOL-MIB')) {
$self->analyze_and_check_mem_subsystem("Classes::Cisco::CISCOENHANCEDMEMPOOLMIB::Component::MemSubsystem");
if (! exists $self->{components}->{mem_subsystem} ||
diff --git a/plugins-scripts/Classes/Cisco/IOS/Component/NatSubsystem.pm b/plugins-scripts/Classes/Cisco/IOS/Component/NatSubsystem.pm
index f642d23e..4d3bb65d 100644
--- a/plugins-scripts/Classes/Cisco/IOS/Component/NatSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/IOS/Component/NatSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::interfaces::nat::sessions::count/) {
$self->get_snmp_objects('CISCO-IETF-NAT-MIB', qw(
cnatAddrBindNumberOfEntries cnatAddrPortBindNumberOfEntries
@@ -16,7 +16,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::interfaces::nat::sessions::count/) {
$self->add_info(sprintf '%d bind entries (%d addr, %d port)',
$self->{cnatAddrBindNumberOfEntries} + $self->{cnatAddrPortBindNumberOfEntries},
@@ -48,7 +48,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{cnatProtocolStatsName} = $self->{flat_indices};
$self->make_symbolic('CISCO-IETF-NAT-MIB', 'cnatProtocolStatsName', $self->{cnatProtocolStatsName});
$self->valdiff({name => $self->{cnatProtocolStatsName}},
@@ -63,7 +63,7 @@ sub finish {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf '%.2f%% of all %s packets have been dropped/rejected',
$self->{rejects}, $self->{cnatProtocolStatsName});
$self->set_thresholds(warning => 30, critical => 50);
diff --git a/plugins-scripts/Classes/Cisco/NXOS.pm b/plugins-scripts/Classes/Cisco/NXOS.pm
index 6e04b0ef..e059fb4c 100644
--- a/plugins-scripts/Classes/Cisco/NXOS.pm
+++ b/plugins-scripts/Classes/Cisco/NXOS.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Cisco);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
#$self->mult_snmp_max_msg_size(10);
$self->analyze_and_check_environmental_subsystem("Classes::Cisco::NXOS::Component::EnvironmentalSubsystem");
diff --git a/plugins-scripts/Classes/Cisco/NXOS/Component/CpuSubsystem.pm b/plugins-scripts/Classes/Cisco/NXOS/Component/CpuSubsystem.pm
index 9963445d..2eaf513d 100644
--- a/plugins-scripts/Classes/Cisco/NXOS/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/NXOS/Component/CpuSubsystem.pm
@@ -7,7 +7,7 @@ use strict;
}
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('CISCO-PROCESS-MIB', [
['cpus', 'cpmCPUTotalTable', 'Classes::Cisco::NXOS::Component::CpuSubsystem::Cpu' ],
]);
@@ -44,7 +44,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{cpmCPUTotalIndex} = exists $self->{cpmCPUTotalIndex} ?
$self->{cpmCPUTotalIndex} :
$Classes::Cisco::NXOS::Component::CpuSubsystem::cpmCPUTotalIndex++;
@@ -82,7 +82,7 @@ sub finish {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'cpu %s usage (5 min avg.) is %.2f%%',
$self->{name}, $self->{usage});
$self->set_thresholds(warning => 80, critical => 90);
diff --git a/plugins-scripts/Classes/Cisco/NXOS/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Cisco/NXOS/Component/EnvironmentalSubsystem.pm
index 7d632748..bb67a907 100644
--- a/plugins-scripts/Classes/Cisco/NXOS/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/NXOS/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
#$self->mult_snmp_max_msg_size(10);
$self->bulk_is_baeh(10);
$self->{sensor_subsystem} =
@@ -32,7 +32,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{sensor_subsystem}->check();
if (exists $self->{fru_subsystem}) {
$self->{fru_subsystem}->check();
@@ -44,7 +44,7 @@ sub check {
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
$self->{sensor_subsystem}->dump();
if (exists $self->{fru_subsystem}) {
$self->{fru_subsystem}->dump();
@@ -52,7 +52,7 @@ sub dump {
}
sub check_l2_l3 {
- my $self = shift;
+ my ($self) = @_;
my @unrealistic_number_of_routes = ();
for my $masklen (1..12) {
push(@unrealistic_number_of_routes, 2 ** (32 - $masklen));
diff --git a/plugins-scripts/Classes/Cisco/NXOS/Component/FexSubsystem.pm b/plugins-scripts/Classes/Cisco/NXOS/Component/FexSubsystem.pm
index 576bf217..d800911c 100644
--- a/plugins-scripts/Classes/Cisco/NXOS/Component/FexSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/NXOS/Component/FexSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->mult_snmp_max_msg_size(10); # FEATURE-CONTROL
$self->get_snmp_tables('CISCO-FEATURE-CONTROL-MIB', [
['features', 'cfcFeatureCtrlTable', 'Monitoring::GLPlugin::SNMP::TableItem'],
@@ -43,14 +43,14 @@ sub init {
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
foreach (@{$self->{fexes}}) {
$_->dump();
}
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('counting fexes');
if (! $self->{fex_feature}) {
$self->add_ok('feature fex is not enabled');
@@ -94,7 +94,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{original_cefexConfigExtenderName} = $self->{cefexConfigExtenderName};
if (exists $self->{entPhysicalClass}) {
# stammt aus ENTITY-MIB
diff --git a/plugins-scripts/Classes/Cisco/NXOS/Component/MemSubsystem.pm b/plugins-scripts/Classes/Cisco/NXOS/Component/MemSubsystem.pm
index 251354be..28f47ec3 100644
--- a/plugins-scripts/Classes/Cisco/NXOS/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/NXOS/Component/MemSubsystem.pm
@@ -3,13 +3,13 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('CISCO-SYSTEM-EXT-MIB', (qw(
cseSysMemoryUtilization)));
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking memory');
if (defined $self->{cseSysMemoryUtilization}) {
$self->add_info(sprintf 'memory usage is %.2f%%',
diff --git a/plugins-scripts/Classes/Cisco/PrimeNCS.pm b/plugins-scripts/Classes/Cisco/PrimeNCS.pm
index 75bb741b..f031280d 100644
--- a/plugins-scripts/Classes/Cisco/PrimeNCS.pm
+++ b/plugins-scripts/Classes/Cisco/PrimeNCS.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Cisco);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
#$self->analyze_and_check_environmental_subsystem("Classes::Cisco::CISCOENTITYFRUCONTROLMIB::Component::EnvironmentalSubsystem");
$self->analyze_and_check_environmental_subsystem("Classes::HOSTRESOURCESMIB::Component::EnvironmentalSubsystem");
diff --git a/plugins-scripts/Classes/Cisco/SB.pm b/plugins-scripts/Classes/Cisco/SB.pm
index 1c9e4d48..2dbfbd68 100644
--- a/plugins-scripts/Classes/Cisco/SB.pm
+++ b/plugins-scripts/Classes/Cisco/SB.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Cisco);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::Cisco::SB::Component::EnvironmentalSubsystem");
if (! $self->check_messages()) {
diff --git a/plugins-scripts/Classes/Cisco/SB/Component/CpuSubsystem.pm b/plugins-scripts/Classes/Cisco/SB/Component/CpuSubsystem.pm
index 2a9dd949..455be054 100644
--- a/plugins-scripts/Classes/Cisco/SB/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/SB/Component/CpuSubsystem.pm
@@ -3,14 +3,14 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
my $type = 0;
$self->get_snmp_objects('CISCOSB-RNDMNG', (qw(
rlCpuUtilDuringLast5Minutes)));
}
sub check {
- my $self = shift;
+ my ($self) = @_;
if ($self->{rlCpuUtilDuringLast5Minutes} == 101) {
$self->add_unknown('cpu measurement disabled');
return;
diff --git a/plugins-scripts/Classes/Cisco/SB/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Cisco/SB/Component/EnvironmentalSubsystem.pm
index 936b4cb4..2116352b 100644
--- a/plugins-scripts/Classes/Cisco/SB/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/SB/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('CISCOSB-HWENVIROMENT', [
['fans', 'rlEnvMonFanStatusTable', 'Classes::Cisco::SB::Component::EnvironmentalSubsystem::Fan'],
['powersupplies', 'rlEnvMonSupplyStatusTable', 'Classes::Cisco::SB::Component::EnvironmentalSubsystem::Powersupply'],
@@ -20,7 +20,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'status of fan %s is %s',
$self->{flat_indices}, $self->{rlEnvMonFanState});
if ($self->{rlEnvMonFanState} eq 'notPresent') {
@@ -38,7 +38,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'status of supply %s is %s',
$self->{flat_indices}, $self->{rlEnvMonSupplyState});
if ($self->{rlEnvMonSupplyState} eq 'notPresent') {
diff --git a/plugins-scripts/Classes/Cisco/SB/Component/MemSubsystem.pm b/plugins-scripts/Classes/Cisco/SB/Component/MemSubsystem.pm
index 0ea637c3..6105af41 100644
--- a/plugins-scripts/Classes/Cisco/SB/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/SB/Component/MemSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
# schaut eher schlecht aus, das zeugs ist nicht main memory wie ueblich
$self->get_snmp_objects('CISCOSB-SYSMNG-MIB', (qw(
rlSysmngResourcePerUnitEntry
@@ -17,6 +17,6 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
}
diff --git a/plugins-scripts/Classes/Cisco/UCOS.pm b/plugins-scripts/Classes/Cisco/UCOS.pm
index 8eb4a8f0..7440aafc 100644
--- a/plugins-scripts/Classes/Cisco/UCOS.pm
+++ b/plugins-scripts/Classes/Cisco/UCOS.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Cisco);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::HOSTRESOURCESMIB::Component::EnvironmentalSubsystem");
} elsif ($self->mode =~ /device::hardware::load/) {
diff --git a/plugins-scripts/Classes/Cisco/WLC.pm b/plugins-scripts/Classes/Cisco/WLC.pm
index abdf9809..78bdf0fb 100644
--- a/plugins-scripts/Classes/Cisco/WLC.pm
+++ b/plugins-scripts/Classes/Cisco/WLC.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Cisco);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
if ($self->implements_mib('AIRESPACE-SWITCHING-MIB') &&
$self->get_snmp_object('AIRESPACE-SWITCHING-MIB', 'agentSwitchInfoPowerSupply1Present')) {
@@ -27,8 +27,17 @@ sub init {
}
} elsif ($self->mode =~ /device::wlan/) {
$self->analyze_and_check_wlan_subsystem("Classes::Cisco::WLC::Component::WlanSubsystem");
+ } elsif ($self->mode =~ /device::ha::/) {
+ $self->analyze_and_check_wlan_subsystem("Classes::Cisco::WLC::Component::HaSubsystem");
} else {
$self->no_such_mode();
}
}
+sub pretty_sysdesc {
+ my ($self, $sysDescr) = @_;
+ $self->get_snmp_objects('AIRESPACE-SWITCHING-MIB', qw(agentInventorySysDescription agentInventoryMachineModel));
+ if ($self->{agentInventorySysDescription} and $self->{agentInventoryMachineModel}) {
+ return $self->{agentInventorySysDescription}." ".$self->{agentInventoryMachineModel};
+ }
+}
diff --git a/plugins-scripts/Classes/Cisco/WLC/Component/CpuSubsystem.pm b/plugins-scripts/Classes/Cisco/WLC/Component/CpuSubsystem.pm
index c30b54a7..548a7411 100644
--- a/plugins-scripts/Classes/Cisco/WLC/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/WLC/Component/CpuSubsystem.pm
@@ -3,14 +3,14 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
my $type = 0;
$self->get_snmp_objects('AIRESPACE-SWITCHING-MIB', (qw(
agentCurrentCPUUtilization)));
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'cpu usage is %.2f%%',
$self->{agentCurrentCPUUtilization});
$self->set_thresholds(warning => 80, critical => 90);
diff --git a/plugins-scripts/Classes/Cisco/WLC/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Cisco/WLC/Component/EnvironmentalSubsystem.pm
index c40418fd..ece32925 100644
--- a/plugins-scripts/Classes/Cisco/WLC/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/WLC/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{ps1_present} = $self->get_snmp_object(
'AIRESPACE-SWITCHING-MIB', 'agentSwitchInfoPowerSupply1Present', 0);
$self->{ps1_operational} = $self->get_snmp_object(
@@ -23,7 +23,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
#$self->blacklist('t', $self->{cpmCPUTotalPhysicalIndex});
my $tinfo = sprintf 'temperature is %.2fC (%s env %s-%s)',
$self->{temp_value}, $self->{temp_environment},
@@ -56,7 +56,7 @@ sub check {
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
printf "[TEMPERATURE]\n";
foreach (qw(temp_environment temp_value temp_alarm_low temp_alarm_high)) {
if (exists $self->{$_}) {
diff --git a/plugins-scripts/Classes/Cisco/WLC/Component/FanSubsystem.pm b/plugins-scripts/Classes/Cisco/WLC/Component/FanSubsystem.pm
index f104f110..5efbec28 100644
--- a/plugins-scripts/Classes/Cisco/WLC/Component/FanSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/WLC/Component/FanSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('CISCO-ENVMON-MIB', [
['fans', 'ciscoEnvMonFanStatusTable', 'Classes::Cisco::IOS::Component::FanSubsystem::Fan'],
]);
@@ -14,7 +14,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{ciscoEnvMonFanStatusIndex} ||= 0;
$self->add_info(sprintf 'fan %d (%s) is %s',
$self->{ciscoEnvMonFanStatusIndex},
diff --git a/plugins-scripts/Classes/Cisco/WLC/Component/HaSubsystem.pm b/plugins-scripts/Classes/Cisco/WLC/Component/HaSubsystem.pm
new file mode 100644
index 00000000..32024872
--- /dev/null
+++ b/plugins-scripts/Classes/Cisco/WLC/Component/HaSubsystem.pm
@@ -0,0 +1,44 @@
+package Classes::Cisco::WLC::Component::HaSubsystem;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
+use strict;
+
+sub init {
+ my ($self) = @_;
+ if ($self->mode =~ /device::ha::status/) {
+ $self->{name} = $self->get_snmp_object('MIB-2-MIB', 'sysName', 0);
+ $self->get_snmp_objects('CISCO-LWAPP-HA-MIB', qw(
+ cLHaPeerIpAddressType cLHaPeerIpAddress
+ cLHaServicePortPeerIpAddressType cLHaServicePortPeerIpAddress
+ cLHaServicePortPeerIpNetMaskType cLHaServicePortPeerIpNetMask
+ cLHaRedundancyIpAddressType cLHaRedundancyIpAddress
+ cLHaPrimaryUnit cLHaNetworkFailOver
+ cLHaBulkSyncStatus cLHaRFStatusUnitIp
+ cLHaAvgPeerReachLatency cLHaAvgGwReachLatency
+ ));
+ }
+}
+
+sub check {
+ my ($self) = @_;
+ $self->add_info('checking ha config');
+ if ($self->mode =~ /device::ha::status/) {
+ if ($self->{cLHaNetworkFailOver} &&
+ $self->{cLHaNetworkFailOver} eq 'true') {
+ $self->add_info(sprintf "this is a %s unit in a failover setup, bulk sync status is %s",
+ ($self->{cLHaPrimaryUnit} && $self->{cLHaPrimaryUnit} eq 'false') ?
+ "secondary" : "primary", $self->{cLHaBulkSyncStatus});
+ if($self->{cLHaPrimaryUnit} &&
+ $self->{cLHaPrimaryUnit} eq 'false') {
+ $self->add_ok();
+ } else {
+ $self->add_ok();
+ }
+ if ($self->{cLHaBulkSyncStatus} ne "Complete") {
+ $self->add_warning();
+ }
+ } else {
+ $self->add_critical_mitigation('ha failover is not configured');
+ }
+ }
+}
+
diff --git a/plugins-scripts/Classes/Cisco/WLC/Component/MemSubsystem.pm b/plugins-scripts/Classes/Cisco/WLC/Component/MemSubsystem.pm
index aabba155..4d211b79 100644
--- a/plugins-scripts/Classes/Cisco/WLC/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/WLC/Component/MemSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('AIRESPACE-SWITCHING-MIB', (qw(
agentTotalMemory agentFreeMemory)));
$self->{memory_usage} = $self->{agentFreeMemory} ?
@@ -11,7 +11,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'memory usage is %.2f%%',
$self->{memory_usage});
$self->set_thresholds(warning => 80, critical => 90);
diff --git a/plugins-scripts/Classes/Cisco/WLC/Component/PowersupplySubsystem.pm b/plugins-scripts/Classes/Cisco/WLC/Component/PowersupplySubsystem.pm
index 7e0fa6da..cab58dc9 100644
--- a/plugins-scripts/Classes/Cisco/WLC/Component/PowersupplySubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/WLC/Component/PowersupplySubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('CISCO-ENVMON-MIB', [
['supplies', 'ciscoEnvMonSupplyStatusTable', 'Classes::Cisco::IOS::Component::PowersupplySubsystem::Powersupply'],
]);
@@ -14,7 +14,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{ciscoEnvMonSupplyStatusIndex} ||= 0;
$self->add_info(sprintf 'powersupply %d (%s) is %s',
$self->{ciscoEnvMonSupplyStatusIndex},
diff --git a/plugins-scripts/Classes/Cisco/WLC/Component/TemperatureSubsystem.pm b/plugins-scripts/Classes/Cisco/WLC/Component/TemperatureSubsystem.pm
index 5fd97fab..5eff6b12 100644
--- a/plugins-scripts/Classes/Cisco/WLC/Component/TemperatureSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/WLC/Component/TemperatureSubsystem.pm
@@ -3,39 +3,30 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
my $tempcnt = 0;
- foreach ($self->get_snmp_table_objects(
- 'CISCO-ENVMON-MIB', 'ciscoEnvMonTemperatureStatusTable')) {
- $_->{ciscoEnvMonTemperatureStatusIndex} = $tempcnt++ if (! exists $_->{ciscoEnvMonTemperatureStatusIndex});
- push(@{$self->{temperatures}},
- Classes::Cisco::IOS::Component::TemperatureSubsystem::Temperature->new(%{$_}));
- }
+ $self->get_snmp_tables('CISCO-ENVMON-MIB', [
+ ['temperatures', 'ciscoEnvMonTemperatureStatusTable', 'Classes::Cisco::IOS::Component::TemperatureSubsystem::Temperature'],
+ ]);
}
package Classes::Cisco::IOS::Component::TemperatureSubsystem::Temperature;
our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
-sub new {
- my $class = shift;
- my %params = @_;
- my $self = {};
- foreach (keys %params) {
- $self->{$_} = $params{$_};
- }
- $self->{ciscoEnvMonTemperatureStatusIndex} ||= 0;
+sub finish {
+ my ($self) = @_;
$self->{ciscoEnvMonTemperatureLastShutdown} ||= 0;
- if ($self->{ciscoEnvMonTemperatureStatusValue}) {
- bless $self, $class;
- } else {
- bless $self, $class.'::Simple';
+ if (! exists $self->{ciscoEnvMonTemperatureStatusIndex}) {
+ $self->{ciscoEnvMonTemperatureStatusIndex} = $self->{flat_indices};
+ }
+ if (! exists $self->{ciscoEnvMonTemperatureStatusValue}) {
+ bless $self, 'Classes::Cisco::IOS::Component::TemperatureSubsystem::Temperature::Simple';
}
- return $self;
}
sub check {
- my $self = shift;
+ my ($self) = @_;
if ($self->{ciscoEnvMonTemperatureStatusValue} >
$self->{ciscoEnvMonTemperatureThreshold}) {
$self->add_info(sprintf 'temperature %d %s is too high (%d of %d max = %s)',
@@ -70,20 +61,8 @@ package Classes::Cisco::IOS::Component::TemperatureSubsystem::Temperature::Simpl
our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
-sub new {
- my $class = shift;
- my %params = @_;
- my $self = {
- ciscoEnvMonTemperatureStatusIndex => $params{ciscoEnvMonTemperatureStatusIndex} || 0,
- ciscoEnvMonTemperatureStatusDescr => $params{ciscoEnvMonTemperatureStatusDescr},
- ciscoEnvMonTemperatureState => $params{ciscoEnvMonTemperatureState},
- };
- bless $self, $class;
- return $self;
-}
-
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'temperature %d %s is %s',
$self->{ciscoEnvMonTemperatureStatusIndex},
$self->{ciscoEnvMonTemperatureStatusDescr},
diff --git a/plugins-scripts/Classes/Cisco/WLC/Component/VoltageSubsystem.pm b/plugins-scripts/Classes/Cisco/WLC/Component/VoltageSubsystem.pm
index 62faaca7..fda444c3 100644
--- a/plugins-scripts/Classes/Cisco/WLC/Component/VoltageSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/WLC/Component/VoltageSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
my $index = 0;
$self->get_snmp_tables('CISCO-ENVMON-MIB', [
['voltages', 'ciscoEnvMonVoltageStatusTable', 'Classes::Cisco::IOS::Component::VoltageSubsystem::Voltage'],
@@ -18,7 +18,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'voltage %d (%s) is %s',
$self->{ciscoEnvMonVoltageStatusIndex},
$self->{ciscoEnvMonVoltageStatusDescr},
diff --git a/plugins-scripts/Classes/Cisco/WLC/Component/WlanSubsystem.pm b/plugins-scripts/Classes/Cisco/WLC/Component/WlanSubsystem.pm
index e09203bd..02d05dc1 100644
--- a/plugins-scripts/Classes/Cisco/WLC/Component/WlanSubsystem.pm
+++ b/plugins-scripts/Classes/Cisco/WLC/Component/WlanSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::wlan::aps::clients/) {
$self->get_snmp_tables('AIRESPACE-WIRELESS-MIB', [
['mobilestations', 'bsnMobileStationTable', 'Classes::Cisco::WLC::Component::WlanSubsystem::MobileStation', sub { return $self->filter_name(shift->{bsnMobileStationSsid}) } ],
@@ -21,12 +21,13 @@ sub init {
['ifloads', 'bsnAPIfLoadParametersTable', 'Classes::Cisco::WLC::Component::WlanSubsystem::IFLoad' ],
]);
$self->assign_loads_to_ifs();
+ $self->dummy_loads_to_ifs();
$self->assign_ifs_to_aps();
}
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking access points');
if ($self->mode =~ /device::wlan::aps::clients/) {
my $ssids = {};
@@ -105,7 +106,7 @@ sub check {
}
sub assign_ifs_to_aps {
- my $self = shift;
+ my ($self) = @_;
foreach my $ap (@{$self->{aps}}) {
$ap->{interfaces} = [];
foreach my $if (@{$self->{ifs}}) {
@@ -120,13 +121,19 @@ sub assign_ifs_to_aps {
}
sub assign_loads_to_ifs {
- my $self = shift;
+ my ($self) = @_;
foreach my $if (@{$self->{ifs}}) {
foreach my $load (@{$self->{ifloads}}) {
if ($load->{flat_indices} eq $if->{flat_indices}) {
map { $if->{$_} = $load->{$_} } grep { $_ !~ /indices/ } keys %{$load};
}
}
+ if (! exists $if->{bsnAPIfLoadNumOfClients}) {
+ # sometimes there is no corresponding load entry for an interface
+ $if->{bsnAPIfLoadNumOfClients} = 0;
+ $if->{bsnAPIfLoadTxUtilization} = 0;
+ $if->{bsnAPIfLoadRxUtilization} = 0;
+ }
}
}
@@ -146,7 +153,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
if ($self->{bsnAPDot3MacAddress} && $self->{bsnAPDot3MacAddress} =~ /0x(\w{2})(\w{2})(\w{2})(\w{2})(\w{2})(\w{2})/) {
$self->{bsnAPDot3MacAddress} = join(".", map { hex($_) } ($1, $2, $3, $4, $5, $6));
} elsif ($self->{bsnAPDot3MacAddress} && unpack("H12", $self->{bsnAPDot3MacAddress}) =~ /(\w{2})(\w{2})(\w{2})(\w{2})(\w{2})(\w{2})/) {
@@ -155,7 +162,7 @@ sub finish {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'access point %s is %s/%s (%d interfaces with %d clients)',
$self->{bsnAPName}, $self->{bsnAPAdminStatus},
$self->{bsnAPOperationStatus},
@@ -181,7 +188,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{bsnMobileStationMacAddress} =
$self->unhex_mac($self->{bsnMobileStationMacAddress});
}
diff --git a/plugins-scripts/Classes/Clavister.pm b/plugins-scripts/Classes/Clavister.pm
index 2959d786..3baabbf9 100644
--- a/plugins-scripts/Classes/Clavister.pm
+++ b/plugins-scripts/Classes/Clavister.pm
@@ -7,7 +7,7 @@ use constant trees => (
);
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->{productname} =~ /Clavister/i) {
bless $self, 'Classes::Clavister::Firewall1';
$self->debug('using Classes::Clavister::Firewall1');
diff --git a/plugins-scripts/Classes/Clavister/Firewall1.pm b/plugins-scripts/Classes/Clavister/Firewall1.pm
index 537b69e5..cff3f8fa 100644
--- a/plugins-scripts/Classes/Clavister/Firewall1.pm
+++ b/plugins-scripts/Classes/Clavister/Firewall1.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Clavister);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::Clavister::Firewall1::Component::EnvironmentalSubsystem");
} elsif ($self->mode =~ /device::hardware::load/) {
diff --git a/plugins-scripts/Classes/Clavister/Firewall1/Component/CpuSubsystem.pm b/plugins-scripts/Classes/Clavister/Firewall1/Component/CpuSubsystem.pm
index e549cbfa..8ed22dd1 100644
--- a/plugins-scripts/Classes/Clavister/Firewall1/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/Clavister/Firewall1/Component/CpuSubsystem.pm
@@ -3,13 +3,13 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('CLAVISTER-MIB', (qw(
clvSysCpuLoad)));
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking cpus');
$self->add_info(sprintf 'cpu usage is %.2f%%', $self->{clvSysCpuLoad});
$self->set_thresholds(warning => 80, critical => 90);
diff --git a/plugins-scripts/Classes/Clavister/Firewall1/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Clavister/Firewall1/Component/EnvironmentalSubsystem.pm
index f4b48629..16af2cbc 100644
--- a/plugins-scripts/Classes/Clavister/Firewall1/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/Clavister/Firewall1/Component/EnvironmentalSubsystem.pm
@@ -4,14 +4,14 @@ use strict;
use Data::Dumper;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('CLAVISTER-MIB', [
['sensor', 'clvHWSensorEntry', 'Classes::Clavister::Firewall1::Component::HWSensor'],
]);
}
sub check {
- my $self = shift;
+ my ($self) = @_;
foreach (@{$self->{sensor}}) {
$_->check();
}
@@ -23,7 +23,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
if ($self->{clvHWSensorName} =~ /Fan/i) {
$self->add_info(sprintf '%s is running (%d %s)',
$self->{clvHWSensorName}, $self->{clvHWSensorValue}, $self->{clvHWSensorUnit});
diff --git a/plugins-scripts/Classes/Clavister/Firewall1/Component/MemSubsystem.pm b/plugins-scripts/Classes/Clavister/Firewall1/Component/MemSubsystem.pm
index 1cb07ea9..b0b9409e 100644
--- a/plugins-scripts/Classes/Clavister/Firewall1/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/Clavister/Firewall1/Component/MemSubsystem.pm
@@ -3,13 +3,13 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('CLAVISTER-MIB', (qw(
clvSysMemUsage)));
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$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}));
diff --git a/plugins-scripts/Classes/Cumulus.pm b/plugins-scripts/Classes/Cumulus.pm
index 6a5a3186..550596a3 100644
--- a/plugins-scripts/Classes/Cumulus.pm
+++ b/plugins-scripts/Classes/Cumulus.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Device);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
#$self->get_snmp_tables("UCD-DISKIO-MIB", [
# ['diskios', 'diskIOTable', 'Monitoring::GLPlugin::SNMP::TableItem'],
diff --git a/plugins-scripts/Classes/Device.pm b/plugins-scripts/Classes/Device.pm
index c76e705b..b741e82a 100644
--- a/plugins-scripts/Classes/Device.pm
+++ b/plugins-scripts/Classes/Device.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP Monitoring::GLPlugin::UPNP);
use strict;
sub classify {
- my $self = shift;
+ my ($self) = @_;
if (! ($self->opts->hostname || $self->opts->snmpwalk)) {
$self->add_unknown('either specify a hostname or a snmpwalk file');
} else {
@@ -40,13 +40,13 @@ sub classify {
$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';
+ $self->{productname} = 'generic_hostresources' if $self->opts->servertype eq 'generic_hostresources';
+ $self->{productname} = 'generic_ucd' if $self->opts->servertype eq 'generic_ucd';
}
if ($self->opts->mode eq "uptime" && $self->opts->mode eq "short") {
return $self;
} elsif (! $self->check_messages()) {
- if ($self->opts->verbose && $self->opts->verbose) {
- printf "I am a %s\n", $self->{productname};
- }
+ $self->debug("I am a ".$self->{productname}."\n");
if ($self->opts->mode =~ /^my-/) {
$self->load_my_extension();
} elsif ($self->{productname} =~ /upnp/i) {
@@ -101,7 +101,7 @@ sub classify {
} elsif ($self->{productname} =~ /Juniper.*MAG\-SM\d+/i) {
# Juniper Networks,Inc,MAG-SMx60,7.4R8
$self->rebless('Classes::Juniper::IVE');
- } elsif ($self->implements_mib('JUNIPER-MIB')) {
+ } elsif ($self->implements_mib('JUNIPER-MIB') || $self->{productname} =~ /srx/i) {
$self->rebless('Classes::Juniper::SRX');
} elsif ($self->{productname} =~ /NetScreen/i) {
$self->rebless('Classes::Juniper');
@@ -110,6 +110,8 @@ sub classify {
} elsif ($self->{productname} =~ /Pulse Secure.*LLC/i) {
# Pulse Secure,LLC,Pulse Policy Secure,IC-6500,5.2R7.1 (build 37645)
$self->rebless('Classes::Juniper::IVE');
+ } elsif ($self->{productname} =~ /DrayTek.*Vigor/i) {
+ $self->rebless('Classes::DrayTek');
} elsif ($self->implements_mib('NETGEAR-MIB')) {
$self->rebless('Classes::Netgear');
} elsif ($self->{productname} =~ /^(GS|FS)/i) {
@@ -124,10 +126,12 @@ sub classify {
$self->rebless('Classes::F5');
} elsif ($self->{sysobjectid} =~ /1\.3\.6\.1\.4\.1\.3375\./) {
$self->rebless('Classes::F5');
- } elsif ($self->{productname} =~ /(H?H3C|HP Comware)/i) {
+ } elsif ($self->{productname} =~ /(H?H3C|HP Comware|HPE Comware)/i) {
$self->rebless('Classes::HH3C');
} elsif ($self->{productname} =~ /(Huawei)/i) {
$self->rebless('Classes::Huawei');
+ } elsif ($self->{sysobjectid} =~ /1\.3\.6\.1\.4\.1\.2011\.2\./) {
+ $self->rebless('Classes::Huawei');
} elsif ($self->{productname} =~ /Procurve/i ||
($self->implements_mib('HP-ICF-CHASSIS-MIB') &&
$self->implements_mib('NETSWITCH-MIB'))) {
@@ -144,10 +148,16 @@ sub classify {
# although there can be a
# Brocade Communications Systems, Inc. FWS648, IronWare Version 07.1....
$self->rebless('Classes::Foundry');
+ } elsif ($self->{productname} eq 'generic_hostresources') {
+ $self->rebless('Classes::HOSTRESOURCESMIB');
+ } elsif ($self->{productname} eq 'generic_ucd') {
+ $self->rebless('Classes::UCDMIB');
} elsif ($self->{productname} =~ /Linux Stingray/i) {
$self->rebless('Classes::HOSTRESOURCESMIB');
} elsif ($self->{productname} =~ /Fortinet|Fortigate/i) {
$self->rebless('Classes::Fortigate');
+ } elsif ($self->implements_mib('FORTINET-FORTIGATE-MIB')) {
+ $self->rebless('Classes::Fortigate');
} elsif ($self->implements_mib('ALCATEL-IND1-BASE-MIB')) {
$self->rebless('Classes::Alcatel');
} elsif ($self->implements_mib('ONEACCESS-SYS-MIB')) {
@@ -195,7 +205,7 @@ use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::interfaces::aggregation::availability/) {
$self->analyze_and_check_aggregation_subsystem("Classes::IFMIB::Component::LinkAggregation");
} elsif ($self->mode =~ /device::interfaces::ifstack/) {
diff --git a/plugins-scripts/Classes/DrayTek.pm b/plugins-scripts/Classes/DrayTek.pm
new file mode 100644
index 00000000..bb65198c
--- /dev/null
+++ b/plugins-scripts/Classes/DrayTek.pm
@@ -0,0 +1,25 @@
+package Classes::DrayTek;
+our @ISA = qw(Classes::Device);
+use strict;
+
+
+sub init {
+ my ($self) = @_;
+ if ($self->{productname} =~ /Vigor/i) {
+ bless $self, 'Classes::DrayTek::Vigor';
+ $self->debug('using Classes::DrayTek::Vigor');
+ }
+ if (ref($self) ne "Classes::DrayTek") {
+ $self->init();
+ } else {
+ $self->no_such_device();
+ }
+}
+
+sub pretty_sysdesc {
+ my ($self, $sysDescr) = @_;
+ if ($sysDescr =~ /DrayTek.*Vigor(\d+).*(Version: .*?)[ ,]/) {
+ return 'DrayTek Vigor '.$1.' '.$2;
+ }
+}
+
diff --git a/plugins-scripts/Classes/DrayTek/Vigor.pm b/plugins-scripts/Classes/DrayTek/Vigor.pm
new file mode 100644
index 00000000..60570943
--- /dev/null
+++ b/plugins-scripts/Classes/DrayTek/Vigor.pm
@@ -0,0 +1,17 @@
+package Classes::DrayTek::Vigor;
+our @ISA = qw(Classes::DrayTek);
+use strict;
+
+sub init {
+ my ($self) = @_;
+ if ($self->mode =~ /device::hardware::health/) {
+ $self->analyze_and_check_environmental_subsystem("Classes::DrayTek::Vigor::Component::EnvironmentalSubsystem");
+ } elsif ($self->mode =~ /device::hardware::load/) {
+ $self->analyze_and_check_cpu_subsystem("Classes::DrayTek::Vigor::Component::CpuSubsystem");
+ } elsif ($self->mode =~ /device::hardware::memory/) {
+ $self->analyze_and_check_mem_subsystem("Classes::DrayTek::Vigor::Component::MemSubsystem");
+ } else {
+ $self->no_such_mode();
+ }
+}
+
diff --git a/plugins-scripts/Classes/DrayTek/Vigor/Component/CpuSubsystem.pm b/plugins-scripts/Classes/DrayTek/Vigor/Component/CpuSubsystem.pm
new file mode 100644
index 00000000..1a9b0593
--- /dev/null
+++ b/plugins-scripts/Classes/DrayTek/Vigor/Component/CpuSubsystem.pm
@@ -0,0 +1,27 @@
+package Classes::DrayTek::Vigor::Component::CpuSubsystem;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
+use strict;
+
+sub init {
+ my ($self) = @_;
+ my $sysdescr = $self->get_snmp_object('MIB-2-MIB', 'sysDescr', 0);
+ if ($sysdescr =~ /CPU Usage:\s*([\d\.])+%/i) {
+ $self->{cpu_usage} = $1;
+ } else {
+ $self->no_such_mode();
+ }
+}
+
+sub check {
+ my ($self) = @_;
+ $self->add_info('checking cpu');
+ $self->add_info(sprintf 'cpu usage is %.2f%%', $self->{cpu_usage});
+ $self->set_thresholds(warning => 80, critical => 90);
+ $self->add_message($self->check_thresholds($self->{cpu_usage}));
+ $self->add_perfdata(
+ label => 'cpu_usage',
+ value => $self->{cpu_usage},
+ uom => '%',
+ );
+}
+
diff --git a/plugins-scripts/Classes/DrayTek/Vigor/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/DrayTek/Vigor/Component/EnvironmentalSubsystem.pm
new file mode 100644
index 00000000..743e47d6
--- /dev/null
+++ b/plugins-scripts/Classes/DrayTek/Vigor/Component/EnvironmentalSubsystem.pm
@@ -0,0 +1,36 @@
+package Classes::DrayTek::Vigor::Component::EnvironmentalSubsystem;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
+use strict;
+use Data::Dumper;
+
+sub init {
+ my ($self) = @_;
+ $self->get_snmp_tables('ADSL-LINE-MIB', [
+ ['lines', 'adslAturPhysTable', 'Classes::DrayTek::Vigor::Component::AdslLine'],
+ ]);
+}
+
+
+package Classes::DrayTek::Vigor::Component::AdslLine;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
+use strict;
+
+sub finish {
+ my ($self) = @_;
+ if ($self->{adslAturCurrStatus}) {
+ chomp $self->{adslAturCurrStatus};
+ $self->{adslAturCurrStatus} =~ s/\x00+$//;
+ }
+}
+
+sub check {
+ my ($self) = @_;
+ $self->add_info(sprintf 'adsl line %s has status %s',
+ $self->{flat_indices}, $self->{adslAturCurrStatus});
+ if ($self->{adslAturCurrStatus} ne "SHOWTIME") {
+ $self->add_critical();
+ } else {
+ $self->add_ok();
+ }
+}
+
diff --git a/plugins-scripts/Classes/DrayTek/Vigor/Component/MemSubsystem.pm b/plugins-scripts/Classes/DrayTek/Vigor/Component/MemSubsystem.pm
new file mode 100644
index 00000000..4d002a6b
--- /dev/null
+++ b/plugins-scripts/Classes/DrayTek/Vigor/Component/MemSubsystem.pm
@@ -0,0 +1,27 @@
+package Classes::DrayTek::Vigor::Component::MemSubsystem;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
+use strict;
+
+sub init {
+ my ($self) = @_;
+ my $sysdescr = $self->get_snmp_object('MIB-2-MIB', 'sysDescr', 0);
+ if ($sysdescr =~ /Memory Usage:\s*([\d\.])+%/i) {
+ $self->{mem_usage} = $1;
+ } else {
+ $self->no_such_mode();
+ }
+}
+
+sub check {
+ my ($self) = @_;
+ $self->add_info('checking mem');
+ $self->add_info(sprintf 'memory usage is %.2f%%', $self->{mem_usage});
+ $self->set_thresholds(warning => 90, critical => 95);
+ $self->add_message($self->check_thresholds($self->{mem_usage}));
+ $self->add_perfdata(
+ label => 'mem_usage',
+ value => $self->{mem_usage},
+ uom => '%',
+ );
+}
+
diff --git a/plugins-scripts/Classes/ENTITYSENSORMIB/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/ENTITYSENSORMIB/Component/EnvironmentalSubsystem.pm
index 1867c9dd..54dd2877 100644
--- a/plugins-scripts/Classes/ENTITYSENSORMIB/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/ENTITYSENSORMIB/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
my $entity_indices = {};
$self->get_snmp_tables('ENTITY-MIB', [
['entities', 'entPhysicalTable', 'Monitoring::GLPlugin::TableItem'],
@@ -61,7 +61,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
foreach (@{$self->{sensors}}) {
$_->check();
}
@@ -71,7 +71,7 @@ sub check {
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
foreach (@{$self->{sensors}}) {
$_->dump();
}
@@ -80,7 +80,7 @@ sub dump {
sub fake_names {
# das ist hoffentlich ein ausnahmefall.
# z.b. cisco asa hat keine entPhysicalTable, aber entPhySensorTable
- my $self = shift;
+ my ($self) = @_;
my $no_has_entities_names = {};
foreach (@{$self->{sensors}}) {
if (! exists $no_has_entities_names->{$_->{entPhySensorType}}) {
@@ -109,7 +109,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
if ($self->{entPhySensorPrecision} && $self->{entPhySensorValue}) {
$self->{entPhySensorValue} /= 10 ** $self->{entPhySensorPrecision};
}
@@ -123,7 +123,7 @@ sub finish {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
if ($self->{entPhySensorOperStatus} ne 'ok') {
$self->add_info(sprintf '%s sensor %s has status %s',
$self->{entPhySensorType},
@@ -151,11 +151,11 @@ our @ISA = qw(Classes::ENTITYSENSORMIB::Component::EnvironmentalSubsystem::Senso
use strict;
sub rename {
- my $self = shift;
+ my ($self) = @_;
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->SUPER::check();
my $label = $self->{entPhySensorEntityName};
$label =~ s/[Tt]emperature\s*@\s*(.*)/$1/;
@@ -170,7 +170,7 @@ our @ISA = qw(Classes::ENTITYSENSORMIB::Component::EnvironmentalSubsystem::Senso
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->SUPER::check();
my $label = $self->{entPhySensorEntityName};
$label =~ s/ RPM$//g;
@@ -186,7 +186,7 @@ our @ISA = qw(Classes::ENTITYSENSORMIB::Component::EnvironmentalSubsystem::Senso
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->SUPER::check();
my $label = $self->{entPhySensorEntityName};
$self->add_perfdata(
diff --git a/plugins-scripts/Classes/Eltex.pm b/plugins-scripts/Classes/Eltex.pm
index 99fb85ae..27cfa82f 100644
--- a/plugins-scripts/Classes/Eltex.pm
+++ b/plugins-scripts/Classes/Eltex.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Device);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->{productname} =~ /(MES2324B)|(MES2324F)|(MES31)|(MES53)/i) {
bless $self, 'Classes::Eltex::Aggregation';
$self->debug('using Classes::Eltex::Aggregation');
diff --git a/plugins-scripts/Classes/Eltex/Access.pm b/plugins-scripts/Classes/Eltex/Access.pm
index 276afef6..eab746fd 100644
--- a/plugins-scripts/Classes/Eltex/Access.pm
+++ b/plugins-scripts/Classes/Eltex/Access.pm
@@ -10,7 +10,7 @@ use strict;
# MES2348: 1 PSU, 2 FAN
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::load/) {
$self->analyze_and_check_cpu_subsystem('Classes::Eltex::MES::Component::CpuSubsystem');
} elsif ($self->mode =~ /device::hardware::health/) {
diff --git a/plugins-scripts/Classes/Eltex/Access/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Eltex/Access/Component/EnvironmentalSubsystem.pm
index 2fa953ba..fc9340ca 100644
--- a/plugins-scripts/Classes/Eltex/Access/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/Eltex/Access/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('ELTEX-MIB', [
['fans', 'eltexFanTable', 'Classes::Eltex::Access::Component::EnvironmentalSubsystem::Fan'],
['temperatures', 'eltexSensorTable', 'Classes::Eltex::Access::Component::EnvironmentalSubsystem::Temperature']
@@ -11,7 +11,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
foreach (@{$self->{fans}}, @{$self->{temperatures}}) {
$_->check();
}
@@ -21,7 +21,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf '%s is %s',
$self->{eltexFanDescription}, $self->{eltexFanStatus});
if ($self->{eltexFanStatus} eq 'normal') {
@@ -38,7 +38,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'sensor %s is %s°C',
$self->{eltexSensorDescription}, $self->{eltexSensorStatus});
$self->set_thresholds(warning => 55, critical => 65);
diff --git a/plugins-scripts/Classes/Eltex/Aggregation.pm b/plugins-scripts/Classes/Eltex/Aggregation.pm
index 97c24c2d..ab21414e 100644
--- a/plugins-scripts/Classes/Eltex/Aggregation.pm
+++ b/plugins-scripts/Classes/Eltex/Aggregation.pm
@@ -8,7 +8,7 @@ use strict;
# MES5324: 2 PSU, 4 FAN
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::load/) {
$self->analyze_and_check_cpu_subsystem('Classes::Eltex::MES::Component::CpuSubsystem');
} elsif ($self->mode =~ /device::hardware::health/) {
diff --git a/plugins-scripts/Classes/Eltex/Aggregation/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Eltex/Aggregation/Component/EnvironmentalSubsystem.pm
index 099fcede..05358119 100644
--- a/plugins-scripts/Classes/Eltex/Aggregation/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/Eltex/Aggregation/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('ELTEX-MIB', [
['fans', 'eltexFanTable', 'Classes::Eltex::Aggregation::Component::EnvironmentalSubsystem::Fan'],
['temperatures', 'eltexSensorTable', 'Classes::Eltex::Aggregation::Component::EnvironmentalSubsystem::Temperature'],
@@ -12,7 +12,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
foreach (@{$self->{fans}}, @{$self->{temperatures}}, @{$self->{power}}) {
$_->check();
}
@@ -23,7 +23,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf '%s is %s',
$self->{eltexFanDescription}, $self->{eltexFanStatus});
if ($self->{eltexFanStatus} eq 'normal') {
@@ -38,16 +38,23 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
- $self->add_info(sprintf 'sensor %s is %s°C',
- $self->{eltexSensorDescription}, $self->{eltexSensorStatus});
- $self->set_thresholds(warning => 55, critical => 65);
- $self->add_message($self->check_thresholds($self->{eltexSensorStatus}));
- $self->add_perfdata(
- label => 'sensor_'.$self->{eltexSensorDescription}.'_temp',
- value => $self->{eltexSensorStatus},
- uom => '°C',
- );
+ my ($self) = @_;
+ # Perform check only if this is temp sensor
+ if ($self->{eltexSensorType} eq '°C') {
+ $self->add_info(sprintf 'sensor %s is %s %s', $self->{eltexSensorDescription},
+ $self->{eltexSensorStatus}, $self->{eltexSensorType});
+ $self->set_thresholds(warning => 55, critical => 65);
+ $self->add_message($self->check_thresholds($self->{eltexSensorStatus}));
+ $self->add_perfdata(
+ label => 'sensor_'.$self->{eltexSensorDescription}.'_temp',
+ value => $self->{eltexSensorStatus},
+ uom => $self->{eltexSensorType},
+ );
+ }
+ # Avoid fan rpm
+ elsif ($self->{eltexSensorType} eq 'rpm') {
+ $self->blacklist();
+ }
}
package Classes::Eltex::Aggregation::Component::EnvironmentalSubsystem::Power;
@@ -55,7 +62,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf '%s is %s',
$self->{eltexPowerSupplyDescription}, $self->{eltexPowerSupplyStatus});
if ($self->{eltexPowerSupplyStatus} eq 'normal') {
diff --git a/plugins-scripts/Classes/Eltex/MES/Component/CpuSubsystem.pm b/plugins-scripts/Classes/Eltex/MES/Component/CpuSubsystem.pm
index a2f9e5e3..9a049fed 100644
--- a/plugins-scripts/Classes/Eltex/MES/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/Eltex/MES/Component/CpuSubsystem.pm
@@ -3,14 +3,14 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('ELTEX-MIB', (qw(
eltexCpuUtilisationLastSecond eltexCpuUtilisationOneMinute
eltexCpuUtilisationFiveMinutes)));
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'cpu usage is %s%%',
$self->{eltexCpuUtilisationLastSecond});
$self->set_thresholds(warning => 50, critical => 90);
diff --git a/plugins-scripts/Classes/Eltex/MES/Component/HaSubsystem.pm b/plugins-scripts/Classes/Eltex/MES/Component/HaSubsystem.pm
index 8218cb09..df1ba903 100644
--- a/plugins-scripts/Classes/Eltex/MES/Component/HaSubsystem.pm
+++ b/plugins-scripts/Classes/Eltex/MES/Component/HaSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('ELTEX-MIB', (qw(eltexStackUnitsNumber)));
}
@@ -16,7 +16,7 @@ sub init {
# WARNING - stack have 1 units | 'units'=1;2:;0:;;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'stack have %s units',
$self->{eltexStackUnitsNumber});
$self->set_thresholds(warning => '0:', critical => '0:');
diff --git a/plugins-scripts/Classes/F5.pm b/plugins-scripts/Classes/F5.pm
index 9cd29f5b..3f36de20 100644
--- a/plugins-scripts/Classes/F5.pm
+++ b/plugins-scripts/Classes/F5.pm
@@ -12,7 +12,7 @@ use constant trees => (
);
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->{productname} =~ /Linux.*((el6.f5.x86_64)|(el5.1.0.f5app)) .*/i ||
$self->{sysobjectid} =~ /1\.3\.6\.1\.4\.1\.3375\./) {
bless $self, 'Classes::F5::F5BIGIP';
diff --git a/plugins-scripts/Classes/F5/F5BIGIP.pm b/plugins-scripts/Classes/F5/F5BIGIP.pm
index 92d35b5f..4ae02250 100644
--- a/plugins-scripts/Classes/F5/F5BIGIP.pm
+++ b/plugins-scripts/Classes/F5/F5BIGIP.pm
@@ -3,12 +3,12 @@ our @ISA = qw(Classes::F5);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
# gets 11.* and 9.*
$self->{sysProductVersion} = $self->get_snmp_object('F5-BIGIP-SYSTEM-MIB', 'sysProductVersion');
$self->{sysPlatformInfoMarketingName} = $self->get_snmp_object('F5-BIGIP-SYSTEM-MIB', 'sysPlatformInfoMarketingName');
if (! defined $self->{sysProductVersion} ||
- $self->{sysProductVersion} !~ /^((9)|(10)|(11)|(12))/) {
+ $self->{sysProductVersion} !~ /^((9)|(10)|(11)|(12)|(13))/) {
$self->{sysProductVersion} = "4";
}
if ($self->mode =~ /device::hardware::health/) {
@@ -31,13 +31,19 @@ sub init {
}
} elsif ($self->mode =~ /device::wideip/) {
$self->analyze_and_check_gtm_subsystem("Classes::F5::F5BIGIP::Component::GTMSubsystem");
+ } elsif ($self->mode =~ /device::users/) {
+ $self->analyze_and_check_connection_subsystem("Classes::F5::F5BIGIP::Component::ConnectionSubsystem");
+ } elsif ($self->mode =~ /device::config/) {
+ $self->analyze_and_check_config_subsystem("Classes::F5::F5BIGIP::Component::ConfigSubsystem");
+ } elsif ($self->mode =~ /device::ha::/) {
+ $self->analyze_and_check_ha_subsystem("Classes::F5::F5BIGIP::Component::HaSubsystem");
} else {
$self->no_such_mode();
}
}
sub analyze_ltm_subsystem {
- my $self = shift;
+ my ($self) = @_;
$self->{components}->{ltm_subsystem} =
Classes::F5::F5BIGIP::Component::LTMSubsystem->new('sysProductVersion' => $self->{sysProductVersion}, sysPlatformInfoMarketingName => $self->{sysPlatformInfoMarketingName});
}
diff --git a/plugins-scripts/Classes/F5/F5BIGIP/Component/ConfigSubsystem.pm b/plugins-scripts/Classes/F5/F5BIGIP/Component/ConfigSubsystem.pm
new file mode 100644
index 00000000..4d394bbf
--- /dev/null
+++ b/plugins-scripts/Classes/F5/F5BIGIP/Component/ConfigSubsystem.pm
@@ -0,0 +1,77 @@
+package Classes::F5::F5BIGIP::Component::ConfigSubsystem;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
+use strict;
+use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
+
+sub init {
+ my $self = shift;
+ $self->get_snmp_objects('F5-BIGIP-SYSTEM-MIB', (qw(sysCmSyncStatusId sysCmSyncStatusColor sysCmSyncStatusSummary)));
+ $self->get_snmp_tables('F5-BIGIP-SYSTEM-MIB', [
+ ['details', 'sysCmSyncStatusDetailsTable', 'Classes::F5::F5BIGIP::Component::ConfigSubsystem::Details'],
+ ]);
+
+ # using role=standalone to adjust the check for clustered/standalone configurations
+ if (! $self->opts->role()) {
+ $self->opts->override_opt('role', 'active'); # active/standby/standalone
+ }
+}
+
+sub check {
+ my $self = shift;
+ my $info;
+
+ $self->add_info(sprintf "config sync state is %s (%s)\n%s",
+ $self->{sysCmSyncStatusId},
+ $self->{sysCmSyncStatusColor},
+ $self->{sysCmSyncStatusSummary}
+ );
+
+ # The sync status ID on the system.
+ # 0 unknown - the device is disconnected from the device group;
+ # 1 syncing - the device is joining the device group or has requested changes from device group or inconsistent with the group;
+ # 2 needManualSync - changes have been made on the device not syncd to the device group;
+ # 3 inSync - the device is consistent with the device group
+ # 4 syncFailed - the device is inconsistent with the device group, requires user intervention;
+ # 5 syncDisconnected - the device is not connected to any peers;
+ # 6 standalone - the device is in a standalone configuration;
+ # 7 awaitingInitialSync - the device is waiting for initial sync;
+ # 8 incompatibleVersion - the device's version is incompatible with rest of the devices in the device group;
+ # 9 partialSync - some but not all devices successfully received the last sync."
+ if ( $self->{sysCmSyncStatusId} eq 'inSync' ) {
+ # inSync
+ if ( $self->opts->role() eq 'standalone' ) {
+ $self->add_warning(sprintf "Unexpected sync status for standalone node: %s (%s)",
+ $self->{sysCmSyncStatusId}, $self->{sysCmSyncStatusColor});
+ } else {
+ $self->add_ok();
+ }
+ } elsif ( $self->{sysCmSyncStatusId} eq 'standalone' ) {
+ # standalone
+ if ( $self->opts->role() eq 'standalone' ) {
+ $self->add_ok();
+ } else {
+ $self->add_critical_mitigation();
+ }
+ } else {
+ # everything else - error
+ $self->add_critical_mitigation();
+ }
+
+ foreach (@{$self->{details}}) {
+ $_->check();
+ }
+}
+
+package Classes::F5::F5BIGIP::Component::ConfigSubsystem::Details;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
+use strict;
+
+sub check {
+ my $self = shift;
+
+ $self->add_ok(sprintf "%d: %s",
+ $self->{sysCmSyncStatusDetailsIndex},
+ $self->{sysCmSyncStatusDetailsDetails},
+ );
+}
+
diff --git a/plugins-scripts/Classes/F5/F5BIGIP/Component/ConnectionSubsystem.pm b/plugins-scripts/Classes/F5/F5BIGIP/Component/ConnectionSubsystem.pm
new file mode 100644
index 00000000..cd064799
--- /dev/null
+++ b/plugins-scripts/Classes/F5/F5BIGIP/Component/ConnectionSubsystem.pm
@@ -0,0 +1,26 @@
+package Classes::F5::F5BIGIP::Component::ConnectionSubsystem;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
+use strict;
+
+sub init {
+ my $self = shift;
+ $self->get_snmp_objects('F5-BIGIP-SYSTEM-MIB', (qw(sysStatClientCurConns sysStatServerCurConns)));
+}
+
+sub check {
+ my $self = shift;
+ $self->set_thresholds(warning => 500000, critical => 750000);
+ $self->add_info(sprintf '%d client connections in use', $self->{sysStatClientCurConns});
+ $self->add_message($self->check_thresholds(metric => 'client_cur_conns', value => $self->{sysStatClientCurConns}));
+ $self->add_perfdata(
+ label => 'client_cur_conns',
+ value => $self->{sysStatClientCurConns},
+ );
+ $self->add_info(sprintf '%d server connections in use', $self->{sysStatServerCurConns});
+ $self->add_message($self->check_thresholds(metric => 'server_cur_conns', value => $self->{sysStatServerCurConns}));
+ $self->add_perfdata(
+ label => 'server_cur_conns',
+ value => $self->{sysStatServerCurConns},
+ );
+}
+
diff --git a/plugins-scripts/Classes/F5/F5BIGIP/Component/CpuSubsystem.pm b/plugins-scripts/Classes/F5/F5BIGIP/Component/CpuSubsystem.pm
index bc8cfaff..6b581df1 100644
--- a/plugins-scripts/Classes/F5/F5BIGIP/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/F5/F5BIGIP/Component/CpuSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub new {
- my $class = shift;
+ my ($class) = @_;
my $self = {};
bless $self, $class;
if ($self->mode =~ /load/) {
@@ -15,7 +15,7 @@ sub new {
}
sub overall_init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('F5-BIGIP-SYSTEM-MIB', (qw(
sysStatTmTotalCycles sysStatTmIdleCycles sysStatTmSleepCycles)));
$self->valdiff({name => 'cpu'}, qw(sysStatTmTotalCycles sysStatTmIdleCycles sysStatTmSleepCycles ));
@@ -26,14 +26,14 @@ sub overall_init {
}
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('F5-BIGIP-SYSTEM-MIB', [
['cpus', 'sysCpuTable', 'Classes::F5::F5BIGIP::Component::CpuSubsystem::Cpu'],
]);
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking cpus');
if ($self->mode =~ /load/) {
$self->add_info(sprintf 'tmm cpu usage is %.2f%%',
@@ -58,7 +58,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'cpu %d has %dC (%drpm)',
$self->{sysCpuIndex},
$self->{sysCpuTemperature},
diff --git a/plugins-scripts/Classes/F5/F5BIGIP/Component/DiskSubsystem.pm b/plugins-scripts/Classes/F5/F5BIGIP/Component/DiskSubsystem.pm
index 2e680cef..dc574fbd 100644
--- a/plugins-scripts/Classes/F5/F5BIGIP/Component/DiskSubsystem.pm
+++ b/plugins-scripts/Classes/F5/F5BIGIP/Component/DiskSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('F5-BIGIP-SYSTEM-MIB', [
['disks', 'sysPhysicalDiskTable', 'Classes::F5::F5BIGIP::Component::DiskSubsystem::Disk'],
]);
@@ -14,7 +14,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'disk %s is %s',
$self->{sysPhysicalDiskName},
$self->{sysPhysicalDiskArrayStatus});
diff --git a/plugins-scripts/Classes/F5/F5BIGIP/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/F5/F5BIGIP/Component/EnvironmentalSubsystem.pm
index b79a9268..aceb6de6 100644
--- a/plugins-scripts/Classes/F5/F5BIGIP/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/F5/F5BIGIP/Component/EnvironmentalSubsystem.pm
@@ -2,16 +2,8 @@ package Classes::F5::F5BIGIP::Component::EnvironmentalSubsystem;
our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
-sub new {
- my $class = shift;
- my $self = {};
- bless $self, $class;
- $self->init();
- return $self;
-}
-
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{cpu_subsystem} =
Classes::F5::F5BIGIP::Component::CpuSubsystem->new();
$self->{fan_subsystem} =
@@ -25,7 +17,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{cpu_subsystem}->check();
$self->{fan_subsystem}->check();
$self->{temperature_subsystem}->check();
@@ -35,7 +27,7 @@ sub check {
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
$self->{cpu_subsystem}->dump();
$self->{fan_subsystem}->dump();
$self->{temperature_subsystem}->dump();
diff --git a/plugins-scripts/Classes/F5/F5BIGIP/Component/FanSubsystem.pm b/plugins-scripts/Classes/F5/F5BIGIP/Component/FanSubsystem.pm
index 82a8c219..90a3ffe7 100644
--- a/plugins-scripts/Classes/F5/F5BIGIP/Component/FanSubsystem.pm
+++ b/plugins-scripts/Classes/F5/F5BIGIP/Component/FanSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('F5-BIGIP-SYSTEM-MIB', [
['fans', 'sysChassisFanTable', 'Classes::F5::F5BIGIP::Component::FanSubsystem::Fan'],
]);
@@ -14,7 +14,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'chassis fan %d is %s (%drpm)',
$self->{sysChassisFanIndex},
$self->{sysChassisFanStatus},
diff --git a/plugins-scripts/Classes/F5/F5BIGIP/Component/GTM.pm b/plugins-scripts/Classes/F5/F5BIGIP/Component/GTM.pm
index c1e17b16..4e11958f 100644
--- a/plugins-scripts/Classes/F5/F5BIGIP/Component/GTM.pm
+++ b/plugins-scripts/Classes/F5/F5BIGIP/Component/GTM.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->mult_snmp_max_msg_size(10);
if ($self->mode =~ /device::wideip/) {
$self->get_snmp_tables('F5-BIGIP-GLOBAL-MIB', [
@@ -16,7 +16,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->SUPER::check();
if ($self->mode =~ /device::wideip/) {
if (scalar(@{$self->{wideips}}) == 0) {
@@ -39,7 +39,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'wide IP %s has status %s, is %s',
$self->{gtmWideipStatusName},
$self->{gtmWideipStatusAvailState},
@@ -66,7 +66,7 @@ use strict;
#
sub init {
- my $self = shift;
+ my ($self) = @_;
# ! merge gtmPoolStatus, gtmPoolMbrStatus, bec. gtmPoolAvailabilityState is deprecated
if ($self->mode =~ /pool::list/) {
$self->update_entry_cache(1, 'F5-BIGIP-GLOBAL-MIB', 'gtmPoolStatusTable', 'gtmPoolStatusName');
@@ -81,7 +81,7 @@ sub init {
push(@auxpools, $_);
}
if (! grep { $self->filter_name($_->{gtmPoolStatusName}) } @auxpools) {
- #$self->add_unknown("did not find any pools");
+ $self->add_unknown("did not find any pools");
$self->{pools} = [];
return;
}
@@ -155,7 +155,7 @@ sub init {
}
sub assign_members_to_pools {
- my $self = shift;
+ my ($self) = @_;
foreach my $pool (@{$self->{pools}}) {
foreach my $poolmember (@{$self->{poolmembers}}) {
if ($poolmember->{gtmPoolMbrPoolName} eq $pool->{gtmPoolName}) {
@@ -178,12 +178,12 @@ use strict;
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{members} = [];
}
sub check {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::lb::pool::comple/) {
my $pool_info = sprintf "pool %s is %s, avail state is %s, active members: %d of %d",
$self->{gtmPoolName},
@@ -225,7 +225,7 @@ sub check {
}
sub draw_html_table {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::lb::pool::comple/) {
my @headers = qw(Node Port Enabled Avail Reason);
my @columns = qw(gtmPoolMbrNodeName gtmPoolMbrPort gtmPoolMbrStatusEnabledState gtmPoolMbrStatusAvailState gtmPoolMbrStatusDetailReason);
@@ -284,7 +284,7 @@ use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
sub check {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::lb::pool::comple.*/) {
if ($self->{gtmPoolMbrStatusEnabledState} eq "enabled") {
if ($self->{gtmPoolMbrStatusAvailState} ne "green") {
diff --git a/plugins-scripts/Classes/F5/F5BIGIP/Component/HaSubsystem.pm b/plugins-scripts/Classes/F5/F5BIGIP/Component/HaSubsystem.pm
new file mode 100644
index 00000000..2eff27ee
--- /dev/null
+++ b/plugins-scripts/Classes/F5/F5BIGIP/Component/HaSubsystem.pm
@@ -0,0 +1,101 @@
+package Classes::F5::F5BIGIP::Component::HaSubsystem;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
+use strict;
+use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
+
+sub init {
+ my $self = shift;
+ if ($self->mode =~ /device::ha::role/) {
+ $self->get_snmp_objects('F5-BIGIP-SYSTEM-MIB', (qw(sysAttrFailoverIsRedundant sysCmFailoverStatusId sysCmFailoverStatusColor sysCmFailoverStatusSummary)));
+ $self->get_snmp_tables("F5-BIGIP-SYSTEM-MIB", [
+ ['failoverstatusdetails', 'sysCmFailoverStatusDetailsTable', 'Classes::F5::F5BIGIP::Component::HaSubsystem::FailoverStatusDetails'],
+ ]);
+ $self->get_snmp_tables("F5-BIGIP-SYSTEM-MIB", [
+ ['trafficgroupstatus', 'sysCmTrafficGroupStatusTable', 'Classes::F5::F5BIGIP::Component::HaSubsystem::TrafficGroupStatus'],
+ ]);
+ if (! $self->opts->role()) {
+ $self->opts->override_opt('role', 'active'); # active/standby/standalone
+ }
+ }
+}
+
+sub check {
+ my $self = shift;
+
+ # The color of the failover status on the system.
+ # 0 green - the system is functioning correctly;
+ # 1 yellow - the system may be functioning suboptimally;
+ # 2 red - the system requires attention to function correctly;
+ # 3 blue - the system's status is unknown or incomplete;
+ # 4 gray - the system is intentionally not functioning (offline);
+ # 5 black - the system is not connected to any peers."
+
+ my $msg = sprintf("ha %sstarted, role is %s (%s)",
+ $self->{sysAttrFailoverIsRedundant} eq 'true' ? '' : 'not ',
+ $self->{sysCmFailoverStatusId},
+ $self->{sysCmFailoverStatusColor});
+
+ # Note: verification needed that sysAttrFailoverIsRedundant is reliable to detect
+ # clustering enabled state
+ if ( $self->{sysAttrFailoverIsRedundant} ) {
+ if ( $self->opts->role() eq 'standalone' ) {
+ $self->add_warning(sprintf "Unexpected failover status for standalone node: %s (%s)",
+ $self->{sysCmFailoverStatusId},
+ $self->{sysCmFailoverStatusColor},
+ );
+ } else {
+ # failover is enabled, check node has proper state according to role
+ if ( $self->{sysCmFailoverStatusId} eq $self->opts->role() ) {
+ $self->add_ok($msg);
+ } else {
+ $self->add_critical_mitigation($msg);
+ $self->add_message(defined $self->opts->mitigation() ? $self->opts->mitigation() : WARNING,
+ sprintf "%s, expected role %s", $self->{sysCmFailoverStatusSummary}, $self->opts->role());
+ }
+ }
+ } else {
+ if ( $self->opts->role() eq 'standalone' ) {
+ $self->add_ok($msg);
+ } else {
+ $self->add_critical($msg);
+ }
+ }
+
+ if ( scalar(@{$self->{failoverstatusdetails}}) > 0 ) {
+ $self->add_info("Failover Status Details:");
+ foreach (@{$self->{failoverstatusdetails}}) {
+ $_->check();
+ }
+ }
+
+ if ( scalar(@{$self->{trafficgroupstatus}}) > 0 ) {
+ $self->add_info("Traffic Groups:");
+ foreach (@{$self->{trafficgroupstatus}}) {
+ $_->check();
+ }
+ }
+}
+
+package Classes::F5::F5BIGIP::Component::HaSubsystem::FailoverStatusDetails;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
+use strict;
+
+sub check {
+ my $self = shift;
+ $self->add_info($self->{sysCmFailoverStatusDetailsDetails});
+}
+
+package Classes::F5::F5BIGIP::Component::HaSubsystem::TrafficGroupStatus;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
+use strict;
+
+sub check {
+ my $self = shift;
+ # TODO: should probably add some real checking...
+ $self->add_info(sprintf "%s: %s -> %s",
+ $self->{sysCmTrafficGroupStatusTrafficGroup},
+ $self->{sysCmTrafficGroupStatusDeviceName},
+ $self->{sysCmTrafficGroupStatusFailoverStatus}
+ );
+}
+
diff --git a/plugins-scripts/Classes/F5/F5BIGIP/Component/LTM.pm b/plugins-scripts/Classes/F5/F5BIGIP/Component/LTM.pm
index c85ea238..0b8f1fff 100644
--- a/plugins-scripts/Classes/F5/F5BIGIP/Component/LTM.pm
+++ b/plugins-scripts/Classes/F5/F5BIGIP/Component/LTM.pm
@@ -7,13 +7,12 @@ use strict;
}
sub max_l4_connections : lvalue {
- my $self = shift;
+ my ($self) = @_;
$Classes::F5::F5BIGIP::Component::LTMSubsystem::max_l4_connections;
}
sub new {
- my $class = shift;
- my %params = @_;
+ my ($class, %params) = @_;
my $self = {
sysProductVersion => $params{sysProductVersion},
sysPlatformInfoMarketingName => $params{sysPlatformInfoMarketingName},
@@ -33,7 +32,7 @@ sub new {
}
sub set_max_l4_connections {
- my $self = shift;
+ my ($self) = @_;
if ($self->{sysPlatformInfoMarketingName} &&
$self->{sysPlatformInfoMarketingName} =~ /BIG-IP\s*(\d+)/i) {
if ($1 =~ /^(1500)$/) {
@@ -76,7 +75,7 @@ sub set_max_l4_connections {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking ltm pools');
if (scalar(@{$self->{pools}}) == 0) {
$self->add_unknown('no pools');
@@ -106,7 +105,7 @@ use strict;
#
sub init {
- my $self = shift;
+ my ($self) = @_;
# ! merge ltmPoolStatus, ltmPoolMemberStatus, bec. ltmPoolAvailabilityState is deprecated
if ($self->mode =~ /pool::list/) {
$self->update_entry_cache(1, 'F5-BIGIP-LOCAL-MIB', 'ltmPoolStatusTable', 'ltmPoolStatusName');
@@ -162,6 +161,8 @@ sub init {
$_->{ltmPoolMemberStatAddr} = $self->unhex_ip($_->{ltmPoolMemberStatAddr});
push(@auxpoolmemberstat, $_);
# ltmPoolMemberStatAddr is deprecated, use ltmPoolMemberStatNodeName
+ # (but for older devices which have no ltmPoolMemberStatNodeName,
+ # check ltmPoolMemberStatAddr(Type) as well
}
foreach ($self->get_snmp_table_objects_with_cache(
'F5-BIGIP-LOCAL-MIB', 'ltmPoolMemberTable', 'ltmPoolMemberPoolName')) {
@@ -179,8 +180,15 @@ sub init {
}
foreach my $auxmember (@auxpoolmemberstat) {
if ($_->{ltmPoolMemberPoolName} eq $auxmember->{ltmPoolMemberStatPoolName} &&
- $_->{ltmPoolMemberPort} eq $auxmember->{ltmPoolMemberStatPort} &&
- $_->{ltmPoolMemberNodeName} eq $auxmember->{ltmPoolMemberStatNodeName}) {
+ $_->{ltmPoolMemberPort} eq $auxmember->{ltmPoolMemberStatPort} && ((
+ $_->{ltmPoolMemberNodeName} && $auxmember->{ltmPoolMemberStatNodeName} &&
+ $_->{ltmPoolMemberNodeName} eq $auxmember->{ltmPoolMemberStatNodeName}
+ ) || (
+ $_->{ltmPoolMemberAddrType} eq $auxmember->{ltmPoolMemberStatAddrType}
+ &&
+ $_->{ltmPoolMemberAddr} eq $auxmember->{ltmPoolMemberStatAddr}
+ ))
+ ) {
foreach my $key (keys %{$auxmember}) {
next if $key =~ /.*indices$/;
$_->{$key} = $auxmember->{$key};
@@ -230,7 +238,7 @@ sub init {
}
sub assign_members_to_pools {
- my $self = shift;
+ my ($self) = @_;
foreach my $pool (@{$self->{pools}}) {
foreach my $poolmember (@{$self->{poolmembers}}) {
if ($poolmember->{ltmPoolMemberPoolName} eq $pool->{ltmPoolName}) {
@@ -255,13 +263,13 @@ use strict;
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{ltmPoolMemberMonitorRule} ||= $self->{ltmPoolMonitorRule};
$self->{members} = [];
}
sub check {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::lb::pool::comple/) {
my $pool_info = sprintf "pool %s is %s, avail state is %s, active members: %d of %d, connections: %d",
$self->{ltmPoolName},
@@ -316,7 +324,7 @@ sub check {
}
sub draw_html_table {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::lb::pool::comple/) {
my @headers = qw(Node Port Enabled Avail Reason);
my @columns = qw(ltmPoolMemberNodeName ltmPoolMemberPort ltmPoolMbrStatusEnabledState ltmPoolMbrStatusAvailState ltmPoolMbrStatusDetailReason);
@@ -374,12 +382,12 @@ use strict;
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
sub max_l4_connections {
- my $self = shift;
+ my ($self) = @_;
$Classes::F5::F5BIGIP::Component::LTMSubsystem::max_l4_connections;
}
sub finish {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::lb::pool::comple/) {
$self->{ltmPoolMemberNodeName} ||= $self->{ltmPoolMemberAddr};
}
@@ -408,7 +416,7 @@ sub finish {
}
sub rename {
- my $self = shift;
+ my ($self) = @_;
if ($self->{ltmPoolMemberNodeName} eq $self->{ltmPoolMemberAddr} &&
$self->{ltmNodeAddrStatusName}) {
$self->{ltmPoolMemberNodeName} = $self->{ltmNodeAddrStatusName};
@@ -416,7 +424,7 @@ sub rename {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::lb::pool::comple.*/) {
if ($self->{ltmPoolMbrStatusEnabledState} eq "enabled") {
if ($self->{ltmPoolMbrStatusAvailState} ne "green") {
@@ -459,7 +467,7 @@ our @ISA = qw(Classes::F5::F5BIGIP::Component::LTMSubsystem Monitoring::GLPlugin
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
foreach ($self->get_snmp_table_objects(
'LOAD-BAL-SYSTEM-MIB', 'poolTable')) {
if ($self->filter_name($_->{poolName})) {
@@ -478,7 +486,7 @@ sub init {
}
sub assign_members_to_pools {
- my $self = shift;
+ my ($self) = @_;
foreach my $pool (@{$self->{pools}}) {
foreach my $poolmember (@{$self->{poolmembers}}) {
if ($poolmember->{poolMemberPoolName} eq $pool->{poolName}) {
@@ -502,12 +510,12 @@ use strict;
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{members} = [];
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'pool %s active members: %d of %d', $self->{poolName},
$self->{poolActiveMemberCount},
$self->{poolMemberQty});
diff --git a/plugins-scripts/Classes/F5/F5BIGIP/Component/MemSubsystem.pm b/plugins-scripts/Classes/F5/F5BIGIP/Component/MemSubsystem.pm
index e0a8fd62..b5d15e89 100644
--- a/plugins-scripts/Classes/F5/F5BIGIP/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/F5/F5BIGIP/Component/MemSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('F5-BIGIP-SYSTEM-MIB', (qw(
sysStatMemoryTotal sysStatMemoryUsed sysHostMemoryTotal sysHostMemoryUsed)));
$self->{stat_mem_usage} = ($self->{sysStatMemoryUsed} / $self->{sysStatMemoryTotal}) * 100;
@@ -11,7 +11,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking memory');
$self->add_info(sprintf 'tmm memory usage is %.2f%%',
$self->{stat_mem_usage});
diff --git a/plugins-scripts/Classes/F5/F5BIGIP/Component/PowersupplySubsystem.pm b/plugins-scripts/Classes/F5/F5BIGIP/Component/PowersupplySubsystem.pm
index 4e1c8933..c5ca1e7b 100644
--- a/plugins-scripts/Classes/F5/F5BIGIP/Component/PowersupplySubsystem.pm
+++ b/plugins-scripts/Classes/F5/F5BIGIP/Component/PowersupplySubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('F5-BIGIP-SYSTEM-MIB', [
['powersupplies', 'sysChassisPowerSupplyTable', 'Classes::F5::F5BIGIP::Component::PowersupplySubsystem::Powersupply'],
]);
@@ -14,7 +14,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'chassis powersupply %d is %s',
$self->{sysChassisPowerSupplyIndex},
$self->{sysChassisPowerSupplyStatus});
diff --git a/plugins-scripts/Classes/F5/F5BIGIP/Component/TemperatureSubsystem.pm b/plugins-scripts/Classes/F5/F5BIGIP/Component/TemperatureSubsystem.pm
index 27170bf1..1a17ac3e 100644
--- a/plugins-scripts/Classes/F5/F5BIGIP/Component/TemperatureSubsystem.pm
+++ b/plugins-scripts/Classes/F5/F5BIGIP/Component/TemperatureSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('F5-BIGIP-SYSTEM-MIB', [
['temperatures', 'sysChassisTempTable', 'Classes::F5::F5BIGIP::Component::TemperatureSubsystem::Temperature'],
]);
@@ -14,7 +14,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'chassis temperature %d is %sC',
$self->{sysChassisTempIndex},
$self->{sysChassisTempTemperature});
diff --git a/plugins-scripts/Classes/FCEOS/Components/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/FCEOS/Components/EnvironmentalSubsystem.pm
index 3e5972eb..efbfb510 100644
--- a/plugins-scripts/Classes/FCEOS/Components/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/FCEOS/Components/EnvironmentalSubsystem.pm
@@ -3,19 +3,19 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub overall_init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('FCEOS-MIB', (qw(
fcEosSysOperStatus)));
}
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{fru_subsystem} =
Classes::FCEOS::Component::FruSubsystem->new();
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{fru_subsystem}->check();
if (! $self->check_messages()) {
$self->add_ok("environmental hardware working fine");
diff --git a/plugins-scripts/Classes/FCEOS/Components/FruSubsystem.pm b/plugins-scripts/Classes/FCEOS/Components/FruSubsystem.pm
index 7e98c23d..c1639947 100644
--- a/plugins-scripts/Classes/FCEOS/Components/FruSubsystem.pm
+++ b/plugins-scripts/Classes/FCEOS/Components/FruSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('FCEOS-MIB', [
['frus', 'fcEosFruTable', 'Classes::FCEOS::Component::FruSubsystem::Fcu'],
]);
@@ -14,7 +14,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf '%s fru (pos %s) is %s',
$self->{fcEosFruCode},
$self->{fcEosFruPosition},
diff --git a/plugins-scripts/Classes/FCMGMT/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/FCMGMT/Component/EnvironmentalSubsystem.pm
index 99026cf4..3a2a5998 100644
--- a/plugins-scripts/Classes/FCMGMT/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/FCMGMT/Component/EnvironmentalSubsystem.pm
@@ -3,13 +3,13 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{sensor_subsystem} =
Classes::FCMGMT::Component::SensorSubsystem->new();
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{sensor_subsystem}->check();
if (! $self->check_messages()) {
$self->add_ok("environmental hardware working fine");
@@ -17,7 +17,7 @@ sub check {
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
$self->{sensor_subsystem}->dump();
}
diff --git a/plugins-scripts/Classes/FCMGMT/Component/SensorSubsystem.pm b/plugins-scripts/Classes/FCMGMT/Component/SensorSubsystem.pm
index a129d6ce..801d03a7 100644
--- a/plugins-scripts/Classes/FCMGMT/Component/SensorSubsystem.pm
+++ b/plugins-scripts/Classes/FCMGMT/Component/SensorSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('FCMGMT-MIB', [
['sensors', 'fcConnUnitSensorTable', 'Classes::FCMGMT::Component::SensorSubsystem::Sensor'],
]);
@@ -17,7 +17,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf '%s sensor %s (%s) is %s (%s)',
$self->{fcConnUnitSensorType},
$self->{fcConnUnitSensorIndex},
diff --git a/plugins-scripts/Classes/FabOS.pm b/plugins-scripts/Classes/FabOS.pm
index 8f00c80d..e72eb761 100644
--- a/plugins-scripts/Classes/FabOS.pm
+++ b/plugins-scripts/Classes/FabOS.pm
@@ -4,7 +4,7 @@ use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::FabOS::Component::EnvironmentalSubsystem");
} elsif ($self->mode =~ /device::hardware::load/) {
diff --git a/plugins-scripts/Classes/FabOS/Component/CpuSubsystem.pm b/plugins-scripts/Classes/FabOS/Component/CpuSubsystem.pm
index 26e4554b..54ea4db3 100644
--- a/plugins-scripts/Classes/FabOS/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/FabOS/Component/CpuSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
foreach (qw(swCpuUsage swCpuNoOfRetries swCpuUsageLimit swCpuPollingInterval
swCpuAction)) {
$self->{$_} = $self->valid_response('SW-MIB', $_, 0);
@@ -13,7 +13,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking cpus');
if (defined $self->{swCpuUsage}) {
my $maps = $self->{swCpuUsageLimit} == 0 ?
diff --git a/plugins-scripts/Classes/FabOS/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/FabOS/Component/EnvironmentalSubsystem.pm
index 6e0ff6ae..a48a15b1 100644
--- a/plugins-scripts/Classes/FabOS/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/FabOS/Component/EnvironmentalSubsystem.pm
@@ -3,13 +3,13 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{sensor_subsystem} =
Classes::FabOS::Component::SensorSubsystem->new();
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{sensor_subsystem}->check();
if (! $self->check_messages()) {
$self->add_ok("environmental hardware working fine");
@@ -17,7 +17,7 @@ sub check {
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
$self->{sensor_subsystem}->dump();
}
diff --git a/plugins-scripts/Classes/FabOS/Component/MemSubsystem.pm b/plugins-scripts/Classes/FabOS/Component/MemSubsystem.pm
index 2d0ebd87..63ff11a2 100644
--- a/plugins-scripts/Classes/FabOS/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/FabOS/Component/MemSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
foreach (qw(swMemUsage swMemUsageLimit1 swMemUsageLimit3 swMemPollingInterval
swMemNoOfRetries swMemAction)) {
$self->{$_} = $self->valid_response('SW-MIB', $_, 0);
@@ -13,10 +13,11 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking memory');
if (defined $self->{swMemUsage}) {
- my $maps = $self->{swMemUsageLimit1} == 0 && $self->{swMemUsageLimit3} == 0 ?
+ my $maps = (! defined $self->{swMemUsageLimit1} || $self->{swMemUsageLimit1} == 0) &&
+ (! defined $self->{swMemUsageLimit3} || $self->{swMemUsageLimit3} == 0) ?
'enabled' : 'disabled';
$self->add_info(sprintf 'maps is %s', $maps);
$self->add_info(sprintf 'memory usage is %.2f%%',
diff --git a/plugins-scripts/Classes/FabOS/Component/SensorSubsystem.pm b/plugins-scripts/Classes/FabOS/Component/SensorSubsystem.pm
index 3ebf3ea1..9eb5ce2e 100644
--- a/plugins-scripts/Classes/FabOS/Component/SensorSubsystem.pm
+++ b/plugins-scripts/Classes/FabOS/Component/SensorSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->bulk_is_baeh();
$self->get_snmp_tables('SW-MIB', [
['sensors', 'swSensorTable', 'Classes::FabOS::Component::SensorSubsystem::Sensor'],
@@ -16,7 +16,7 @@ use strict;
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf '%s sensor %s (%s) is %s',
$self->{swSensorType},
$self->{swSensorIndex},
@@ -41,27 +41,3 @@ sub check {
}
}
-
-package Classes::FabOS::Component::SensorSubsystem::SensorThreshold;
-our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
-use strict;
-
-sub new {
- my $class = shift;
- my %params = @_;
- my $self = {
- blacklisted => 0,
- info => undef,
- extendedinfo => undef,
- };
- foreach my $param (qw(entSensorThresholdRelation entSensorThresholdValue
- entSensorThresholdSeverity entSensorThresholdNotificationEnable
- entSensorThresholdEvaluation indices)) {
- $self->{$param} = $params{$param};
- }
- $self->{entPhysicalIndex} = $params{indices}[0];
- $self->{entSensorThresholdIndex} = $params{indices}[1];
- bless $self, $class;
- return $self;
-}
-
diff --git a/plugins-scripts/Classes/Fortigate.pm b/plugins-scripts/Classes/Fortigate.pm
index 878e4066..e61883eb 100644
--- a/plugins-scripts/Classes/Fortigate.pm
+++ b/plugins-scripts/Classes/Fortigate.pm
@@ -1,15 +1,17 @@
package Classes::Fortigate;
-our @ISA = qw(Classes::Brocade);
+our @ISA = qw(Classes::Device);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::Fortigate::Component::EnvironmentalSubsystem");
} elsif ($self->mode =~ /device::hardware::load/) {
$self->analyze_and_check_cpu_subsystem("Classes::Fortigate::Component::CpuSubsystem");
} elsif ($self->mode =~ /device::hardware::memory/) {
$self->analyze_and_check_mem_subsystem("Classes::Fortigate::Component::MemSubsystem");
+ } elsif ($self->mode =~ /device::ha::/) {
+ $self->analyze_and_check_mem_subsystem("Classes::Fortigate::Component::HaSubsystem");
} else {
$self->no_such_mode();
}
diff --git a/plugins-scripts/Classes/Fortigate/Component/CpuSubsystem.pm b/plugins-scripts/Classes/Fortigate/Component/CpuSubsystem.pm
index 803824fe..04ad7284 100644
--- a/plugins-scripts/Classes/Fortigate/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/Fortigate/Component/CpuSubsystem.pm
@@ -3,15 +3,14 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
- my %params = @_;
+ my ($self, %params) = @_;
my $type = 0;
$self->get_snmp_objects('FORTINET-FORTIGATE-MIB', (qw(
fgSysCpuUsage)));
}
sub check {
- my $self = shift;
+ my ($self) = @_;
my $errorfound = 0;
$self->add_info('checking cpus');
$self->add_info(sprintf 'cpu usage is %.2f%%', $self->{fgSysCpuUsage});
diff --git a/plugins-scripts/Classes/Fortigate/Component/DiskSubsystem.pm b/plugins-scripts/Classes/Fortigate/Component/DiskSubsystem.pm
index a07b07d0..bce72967 100644
--- a/plugins-scripts/Classes/Fortigate/Component/DiskSubsystem.pm
+++ b/plugins-scripts/Classes/Fortigate/Component/DiskSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('FORTINET-FORTIGATE-MIB', (qw(
fgSysDiskUsage fgSysDiskCapacity)));
$self->{usage} = $self->{fgSysDiskCapacity} ?
@@ -11,7 +11,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking disks');
if (! defined $self->{usage}) {
$self->add_info(sprintf 'system has no disk');
diff --git a/plugins-scripts/Classes/Fortigate/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Fortigate/Component/EnvironmentalSubsystem.pm
index 4bbc3e8d..71443f65 100644
--- a/plugins-scripts/Classes/Fortigate/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/Fortigate/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{sensor_subsystem} =
Classes::Fortigate::Component::SensorSubsystem->new();
$self->{disk_subsystem} =
@@ -11,7 +11,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{sensor_subsystem}->check();
$self->{disk_subsystem}->check();
if (! $self->check_messages()) {
@@ -20,7 +20,7 @@ sub check {
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
$self->{sensor_subsystem}->dump();
$self->{disk_subsystem}->dump();
}
diff --git a/plugins-scripts/Classes/Fortigate/Component/HaSubsystem.pm b/plugins-scripts/Classes/Fortigate/Component/HaSubsystem.pm
new file mode 100644
index 00000000..01848cf4
--- /dev/null
+++ b/plugins-scripts/Classes/Fortigate/Component/HaSubsystem.pm
@@ -0,0 +1,79 @@
+package Classes::Fortigate::Component::HaSubsystem;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
+use strict;
+
+sub init {
+ my ($self) = @_;
+ $self->get_snmp_objects('FORTINET-CORE-MIB', (qw(
+ fnSysSerial
+ )));
+ $self->get_snmp_objects('FORTINET-FORTIGATE-MIB', (qw(
+ fgHaStatsSyncStatus fgHaSystemMode fgHaOverride fgHaAutoSync
+ fgHaGroupName fgFcSwSerial fgFcSwName
+ )));
+ $self->get_snmp_tables('FORTINET-FORTIGATE-MIB', [
+ ['fgHaStatsTable', 'fgHaStatsTable', 'Classes::Fortigate::Component::HaSubsystem::SyncStatus'],
+ ['fgVdTable', 'fgVdTable', 'Monitoring::GLPlugin::SNMP::TableItem'],
+ ]);
+ if ($self->mode =~ /device::ha::role/) {
+ $self->opts->override_opt('role', 'active');
+ # fgHaSystemMode: activePassive, activeActive or standalone
+ }
+ foreach (@{$self->{fgHaStatsTable}}) {
+ $_->{fnSysSerial} = $self->{fnSysSerial};
+ $_->{fgHaSystemMode} = $self->{fgHaSystemMode};
+ }
+}
+
+# Specify threshold values, so that you understand when the number of units
+# decreases, for example we have only 2 units in stack, so we should get
+# warning state if one of unit goes down:
+# ./check_nwc_health --hostname 10.10.10.2 --mode ha-status --warning 2:
+# OK - stack have 2 units | 'units'=2;2:;0:;;
+# and when only one unit left:
+# WARNING - stack have 1 units | 'units'=1;2:;0:;;
+
+sub check {
+ my ($self) = @_;
+ if ($self->{fgHaSystemMode} eq "standalone") {
+ $self->add_warning_mitigation("this is a standalone system");
+ } else {
+ foreach (@{$self->{fgHaStatsTable}}) {
+ $_->check();
+ }
+ $self->add_info(sprintf "cluster has %d nodes", scalar(@{$self->{fgHaStatsTable}}));
+ $self->add_ok();
+ }
+}
+
+
+package Classes::Fortigate::Component::HaSubsystem::SyncStatus;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
+use strict;
+
+sub check {
+ my ($self) = @_;
+ if ($self->{fgHaStatsSerial} eq $self->{fnSysSerial}) {
+ if ($self->mode eq "device::ha::role") {
+ $self->{iammaster} = $self->{fgHaStatsMasterSerial} eq $self->{fnSysSerial} ? 1 : 0;
+ $self->add_info(sprintf "this is a %s node in a %s setup", $self->opts->role, $self->{fgHaSystemMode});
+ if ($self->opts->role eq "active" && $self->{iammaster}) {
+ $self->add_ok();
+ } elsif ($self->opts->role eq "passive" && ! $self->{iammaster}) {
+ $self->add_ok();
+ } else {
+ $self->add_critical();
+ }
+ } elsif ($self->mode eq "device::ha::status") {
+ $self->add_info(sprintf "ha sync status is %s", $self->{fgHaStatsSyncStatus});
+ if ($self->{fgHaStatsSyncStatus} eq "synchronized") {
+ $self->add_ok();
+ } else {
+ $self->add_critical();
+ }
+ }
+ } else {
+ # this row is not relevant for the local node
+ }
+}
+
diff --git a/plugins-scripts/Classes/Fortigate/Component/MemSubsystem.pm b/plugins-scripts/Classes/Fortigate/Component/MemSubsystem.pm
index 11d65618..d376d7f2 100644
--- a/plugins-scripts/Classes/Fortigate/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/Fortigate/Component/MemSubsystem.pm
@@ -3,13 +3,13 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('FORTINET-FORTIGATE-MIB', (qw(
fgSysMemUsage)));
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking memory');
if (defined $self->{fgSysMemUsage}) {
$self->add_info(sprintf 'memory usage is %.2f%%',
diff --git a/plugins-scripts/Classes/Fortigate/Component/SensorSubsystem.pm b/plugins-scripts/Classes/Fortigate/Component/SensorSubsystem.pm
index 7d969539..277fc2af 100644
--- a/plugins-scripts/Classes/Fortigate/Component/SensorSubsystem.pm
+++ b/plugins-scripts/Classes/Fortigate/Component/SensorSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('FORTINET-FORTIGATE-MIB', [
['sensors', 'fgHwSensorTable', 'Classes::Fortigate::Component::SensorSubsystem::Sensor'],
]);
@@ -13,19 +13,122 @@ package Classes::Fortigate::Component::SensorSubsystem::Sensor;
our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
+sub finish {
+ my ($self) = @_;
+ $self->{fgHwSensorEntAlarmStatus} ||= "false";
+ $self->{fgHwSensorEntValue} = -1 if ! defined $self->{fgHwSensorEntValue};
+ if ($self->{fgHwSensorEntValue} == -1) {
+ # empty, this case is handled in the default sensor class
+ } elsif ($self->{fgHwSensorEntName} =~ /Fan/) {
+ bless $self, "Classes::Fortigate::Component::SensorSubsystem::Fan";
+ } elsif ($self->{fgHwSensorEntName} =~ /PS.*Status/) {
+ bless $self, "Classes::Fortigate::Component::SensorSubsystem::Powersupply";
+ } elsif ($self->{fgHwSensorEntName} =~ /(LM75)|(Temp)|(^(TD|TR)\d+)|(DTS\d+)/) {
+ # thermal diode/resistor, dingsbums thermal sensor
+ bless $self, "Classes::Fortigate::Component::SensorSubsystem::Temperature";
+ } elsif ($self->{fgHwSensorEntName} =~ /(VOUT)|(VIN)|(VCC)|(P\d+V\d+)|(_\d+V\d+_)|(DDR)|(VCORE)|(DVDD)/) {
+ # VPP_DDR, VTT_DDR sind irgendwelche voltage regulatory devices
+ # DVDD irgendein Realtec digital voltage drecksdeil
+ bless $self, "Classes::Fortigate::Component::SensorSubsystem::Voltage";
+ } else {
+$self->{UNKNOWN} = 1;
+ }
+}
+
sub check {
- my $self = shift;
+ my ($self) = @_;
+ if ($self->{fgHwSensorEntValue} == -1) {
+ $self->add_info(sprintf '%s is not installed',
+ $self->{fgHwSensorEntName});
+ return;
+ }
$self->add_info(sprintf 'sensor %s alarm status is %s',
$self->{fgHwSensorEntName},
- $self->{fgHwSensorEntValueStatus});
- if ($self->{fgHwSensorEntValueStatus} && $self->{fgHwSensorEntValueStatus} eq "true") {
+ $self->{fgHwSensorEntAlarmStatus});
+ if ($self->{fgHwSensorEntAlarmStatus} && $self->{fgHwSensorEntAlarmStatus} eq "true") {
$self->add_critical();
}
if ($self->{fgHwSensorEntValue}) {
$self->add_perfdata(
label => sprintf('sensor_%s', $self->{fgHwSensorEntName}),
- value => $self->{swSensorValue},
+ value => $self->{fgHwSensorEntValue},
);
}
}
+package Classes::Fortigate::Component::SensorSubsystem::Fan;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
+use strict;
+
+sub check {
+ my ($self) = @_;
+ $self->add_info(sprintf '%s%s alarm status is %s',
+ $self->{fgHwSensorEntName} =~ /Fan/i ? "" : "Fan ",
+ $self->{fgHwSensorEntName},
+ $self->{fgHwSensorEntAlarmStatus});
+ if ($self->{fgHwSensorEntAlarmStatus} eq "true") {
+ $self->add_critical();
+ }
+ if (defined $self->{fgHwSensorEntValue}) {
+ $self->add_perfdata(
+ label => sprintf('rpm_%s', $self->{fgHwSensorEntName}),
+ value => $self->{fgHwSensorEntValue},
+ );
+ }
+}
+
+package Classes::Fortigate::Component::SensorSubsystem::Temperature;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
+use strict;
+
+sub check {
+ my ($self) = @_;
+ $self->add_info(sprintf '%s%s alarm status is %s',
+ $self->{fgHwSensorEntName} =~ /Temp/i ? "" : "Temp ",
+ $self->{fgHwSensorEntName},
+ $self->{fgHwSensorEntAlarmStatus});
+ if ($self->{fgHwSensorEntAlarmStatus} eq "true") {
+ $self->add_critical();
+ }
+ if (defined $self->{fgHwSensorEntValue}) {
+ $self->add_perfdata(
+ label => sprintf('temp_%s', $self->{fgHwSensorEntName}),
+ value => $self->{fgHwSensorEntValue},
+ );
+ }
+}
+
+package Classes::Fortigate::Component::SensorSubsystem::Voltage;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
+use strict;
+
+sub check {
+ my ($self) = @_;
+ $self->add_info(sprintf '%s alarm status is %s',
+ $self->{fgHwSensorEntName},
+ $self->{fgHwSensorEntAlarmStatus});
+ if ($self->{fgHwSensorEntAlarmStatus} eq "true") {
+ $self->add_critical();
+ }
+ if (defined $self->{fgHwSensorEntValue}) {
+ $self->add_perfdata(
+ label => sprintf('volt_%s', $self->{fgHwSensorEntName}),
+ value => $self->{fgHwSensorEntValue},
+ );
+ }
+}
+
+package Classes::Fortigate::Component::SensorSubsystem::Powersupply;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
+use strict;
+
+sub check {
+ my ($self) = @_;
+ $self->add_info(sprintf '%s alarm status is %s',
+ $self->{fgHwSensorEntName},
+ $self->{fgHwSensorEntAlarmStatus});
+ if ($self->{fgHwSensorEntAlarmStatus} eq "true") {
+ $self->add_critical();
+ }
+}
+
diff --git a/plugins-scripts/Classes/Foundry.pm b/plugins-scripts/Classes/Foundry.pm
index 124d5f99..3c828d2a 100644
--- a/plugins-scripts/Classes/Foundry.pm
+++ b/plugins-scripts/Classes/Foundry.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Device);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::Foundry::Component::EnvironmentalSubsystem");
} elsif ($self->mode =~ /device::hardware::load/) {
diff --git a/plugins-scripts/Classes/Foundry/Component/CpuSubsystem.pm b/plugins-scripts/Classes/Foundry/Component/CpuSubsystem.pm
index 1fef3f4b..ee0215ef 100644
--- a/plugins-scripts/Classes/Foundry/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/Foundry/Component/CpuSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('FOUNDRY-SN-AGENT-MIB', [
['cpus', 'snAgentCpuUtilTable', 'Classes::Foundry::Component::CpuSubsystem::Cpu'],
]);
@@ -12,7 +12,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
if (scalar (@{$self->{cpus}}) == 0) {
$self->overall_check();
} else {
@@ -26,7 +26,7 @@ sub check {
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
$self->overall_dump();
foreach (@{$self->{cpus}}) {
$_->dump();
@@ -34,7 +34,7 @@ sub dump {
}
sub overall_check {
- my $self = shift;
+ my ($self) = @_;
my $errorfound = 0;
$self->add_info('checking cpus');
$self->add_info(sprintf 'cpu usage is %.2f%%', $self->{snAgGblCpuUtil1MinAvg});
@@ -49,7 +49,7 @@ sub overall_check {
}
sub overall_dump {
- my $self = shift;
+ my ($self) = @_;
printf "[CPU]\n";
foreach (qw(snAgGblCpuUtil1SecAvg snAgGblCpuUtil5SecAvg
snAgGblCpuUtil1MinAvg)) {
@@ -63,7 +63,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
# newer mibs have snAgentCpuUtilPercent and snAgentCpuUtil100thPercent
# snAgentCpuUtilValue is deprecated
$self->{snAgentCpuUtilValue} = $self->{snAgentCpuUtil100thPercent} / 100
diff --git a/plugins-scripts/Classes/Foundry/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Foundry/Component/EnvironmentalSubsystem.pm
index 20f66a40..b721893f 100644
--- a/plugins-scripts/Classes/Foundry/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/Foundry/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{powersupply_subsystem} =
Classes::Foundry::Component::PowersupplySubsystem->new();
$self->{fan_subsystem} =
@@ -15,7 +15,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{powersupply_subsystem}->check();
$self->{fan_subsystem}->check();
$self->{temperature_subsystem}->check();
@@ -24,7 +24,7 @@ sub check {
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
$self->{powersupply_subsystem}->dump();
$self->{fan_subsystem}->dump();
$self->{temperature_subsystem}->dump();
diff --git a/plugins-scripts/Classes/Foundry/Component/FanSubsystem.pm b/plugins-scripts/Classes/Foundry/Component/FanSubsystem.pm
index 191ee588..ddb1400c 100644
--- a/plugins-scripts/Classes/Foundry/Component/FanSubsystem.pm
+++ b/plugins-scripts/Classes/Foundry/Component/FanSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('FOUNDRY-SN-AGENT-MIB', [
['fans', 'snChasFanTable', 'Classes::Foundry::Component::FanSubsystem::Fan'],
]);
@@ -15,12 +15,12 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{snChasFanDescription} ||= 'fan '.$self->{snChasFanIndex};
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf '%s status is %s',
$self->{snChasFanDescription},
$self->{snChasFanOperStatus});
diff --git a/plugins-scripts/Classes/Foundry/Component/MemSubsystem.pm b/plugins-scripts/Classes/Foundry/Component/MemSubsystem.pm
index 56b3c8ea..a4acbc8d 100644
--- a/plugins-scripts/Classes/Foundry/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/Foundry/Component/MemSubsystem.pm
@@ -3,13 +3,13 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('FOUNDRY-SN-AGENT-MIB', (qw(
snAgGblDynMemUtil snAgGblDynMemTotal snAgGblDynMemFree)));
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking memory');
if (defined $self->{snAgGblDynMemUtil}) {
$self->add_info(sprintf 'memory usage is %.2f%%',
diff --git a/plugins-scripts/Classes/Foundry/Component/ModuleSubsystem.pm b/plugins-scripts/Classes/Foundry/Component/ModuleSubsystem.pm
index 56fd68cf..d15684dd 100644
--- a/plugins-scripts/Classes/Foundry/Component/ModuleSubsystem.pm
+++ b/plugins-scripts/Classes/Foundry/Component/ModuleSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('FOUNDRY-SN-AGENT-MIB', [
['boards', 'snAgentBrdTable', 'Classes::Foundry::Component::ModuleSubsystem::Module', undef, ['snAgentBrdMainBrdDescription', 'snAgentBrdMainBrdId', 'snAgentBrdExpBrdDescription', 'snAgentBrdModuleStatus', 'snAgentBrdRedundantStatus']],
]);
@@ -15,7 +15,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'module %s status is %s, redundancy status is %s',
$self->{snAgentBrdMainBrdDescription},
$self->{snAgentBrdModuleStatus},
diff --git a/plugins-scripts/Classes/Foundry/Component/PowersupplySubsystem.pm b/plugins-scripts/Classes/Foundry/Component/PowersupplySubsystem.pm
index ebe13cc1..4cfea3ac 100644
--- a/plugins-scripts/Classes/Foundry/Component/PowersupplySubsystem.pm
+++ b/plugins-scripts/Classes/Foundry/Component/PowersupplySubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('FOUNDRY-SN-AGENT-MIB', [
['powersupplies', 'snChasPwrSupplyTable', 'Classes::Foundry::Component::PowersupplySubsystem::Powersupply'],
]);
@@ -15,7 +15,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf '%s oper status %s',
$self->{snChasPwrSupplyDescription},
$self->{snChasPwrSupplyOperStatus}
diff --git a/plugins-scripts/Classes/Foundry/Component/SLBSubsystem.pm b/plugins-scripts/Classes/Foundry/Component/SLBSubsystem.pm
index f37fbf5a..9eb2e84c 100644
--- a/plugins-scripts/Classes/Foundry/Component/SLBSubsystem.pm
+++ b/plugins-scripts/Classes/Foundry/Component/SLBSubsystem.pm
@@ -3,8 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub update_caches {
- my $self = shift;
- my $force = shift;
+ my ($self, $force) = @_;
$self->update_entry_cache($force, 'FOUNDRY-SN-SW-L4-SWITCH-GROUP-MIB', 'snL4BindTable', 'snL4BindVirtualServerName');
$self->update_entry_cache($force, 'FOUNDRY-SN-SW-L4-SWITCH-GROUP-MIB', 'snL4VirtualServerTable', 'snL4VirtualServerName');
$self->update_entry_cache($force, 'FOUNDRY-SN-SW-L4-SWITCH-GROUP-MIB', 'snL4VirtualServerPortTable', 'snL4VirtualServerPortServerName');
@@ -13,7 +12,7 @@ sub update_caches {
}
sub init {
- my $self = shift;
+ my ($self) = @_;
# opt->name can be servername:serverport
my $original_name = $self->opts->name;
if ($self->mode =~ /device::lb::session::usage/) {
@@ -154,7 +153,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking slb virtual servers');
if ($self->mode =~ /device::lb::session::usage/) {
$self->add_info('checking session usage');
@@ -197,13 +196,12 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{ports} = [];
}
sub check {
- my $self = shift;
- my %params = @_;
+ my ($self) = @_;
$self->add_info(sprintf "vis %s is %s",
$self->{snL4VirtualServerName},
$self->{snL4VirtualServerAdminStatus});
@@ -228,7 +226,7 @@ sub check {
}
sub add_port {
- my $self = shift;
+ my ($self) = @_;
push(@{$self->{ports}}, shift);
}
@@ -238,12 +236,12 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{ports} = [];
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf "vpo %s:%d is %s (%d connections to %d real ports)",
$self->{snL4VirtualServerPortServerName},
$self->{snL4VirtualServerPortPort},
@@ -331,7 +329,7 @@ sub check {
}
sub add_port {
- my $self = shift;
+ my ($self) = @_;
push(@{$self->{ports}}, shift);
}
@@ -341,7 +339,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
if ($self->{slbPoolMbrStatusEnabledState} eq "enabled") {
if ($self->{slbPoolMbrStatusAvailState} ne "green") {
$self->add_critical(sprintf
@@ -361,8 +359,7 @@ use strict;
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
sub check {
- my $self = shift;
- my %params = @_;
+ my ($self) = @_;
$self->add_info(sprintf "rpo %s:%d is %s",
$self->{snL4RealServerPortStatusServerName},
$self->{snL4RealServerPortStatusPort},
diff --git a/plugins-scripts/Classes/Foundry/Component/TemperatureSubsystem.pm b/plugins-scripts/Classes/Foundry/Component/TemperatureSubsystem.pm
index 2a964050..6a7c6c63 100644
--- a/plugins-scripts/Classes/Foundry/Component/TemperatureSubsystem.pm
+++ b/plugins-scripts/Classes/Foundry/Component/TemperatureSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
my $temp = 0;
$self->get_snmp_objects('FOUNDRY-SN-AGENT-MIB', (qw(
snChasActualTemperature snChasWarningTemperature
@@ -16,7 +16,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
if (defined $self->{snChasActualTemperature}) {
$self->{snChasActualTemperature} /= 2;
$self->{snChasWarningTemperature} /= 2;
@@ -53,7 +53,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
($self->{snAgentTempSlotNum}, $self->{snAgentTempSensorId}) =
@{$self->{indices}};
$self->{snAgentTempValue} /= 2 if ($self->{snAgentTempValue});
@@ -63,7 +63,7 @@ sub finish {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
return if (!$self->{snAgentTempValue});
$self->add_info(sprintf 'temperature %s in slot %s is %.2fC',
$self->{snAgentTempSensorId},
diff --git a/plugins-scripts/Classes/HH3C.pm b/plugins-scripts/Classes/HH3C.pm
index 56554225..47334d09 100644
--- a/plugins-scripts/Classes/HH3C.pm
+++ b/plugins-scripts/Classes/HH3C.pm
@@ -4,7 +4,7 @@ our @ISA = qw(Classes::Device);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::HH3C::Component::EnvironmentalSubsystem");
} elsif ($self->mode =~ /device::hardware::load/) {
diff --git a/plugins-scripts/Classes/HH3C/Component/CpuSubsystem.pm b/plugins-scripts/Classes/HH3C/Component/CpuSubsystem.pm
index d69dafe5..f317b903 100644
--- a/plugins-scripts/Classes/HH3C/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/HH3C/Component/CpuSubsystem.pm
@@ -3,22 +3,19 @@ our @ISA = qw(Classes::HH3C::Component::EntitySubsystem);
use strict;
sub init {
- my $self = shift;
-
- $self->get_entities('Classes::HH3C::Component::CpuSubsystem::EntityState',
- sub { my $o = shift; $o->{entPhysicalClass} eq 'module' and $o->{entPhysicalName} =~ /board/i; } );
-
- foreach ($self->get_sub_table('HH3C-ENTITY-EXT-MIB', [ 'hh3cEntityExtCpuAvgUsage' ])) {
- push @{$self->{entityext}}, $_;
- }
-
- $self->join_table($self->{entities}, $self->{entityext});
+ my ($self) = @_;
+ $self->get_snmp_tables("ENTITY-MIB", [
+ ["entities", "entPhysicalTable", "Classes::HH3C::Component::CpuSubsystem::Entity", sub { my ($o) = @_; $o->{entPhysicalClass} eq 'module' and $o->{entPhysicalName} =~ /board/i; }, ["entPhysicalDescr", "entPhysicalName", "entPhysicalClass"]]
+ ]);
+ $self->get_snmp_tables("HH3C-ENTITY-EXT-MIB", [
+ ["entitystates", "hh3cEntityExtStateTable", "Classes::HH3C::Component::CpuSubsystem::EntityState", undef, ["hh3cEntityExtCpuAvgUsage"]]
+ ]);
+ $self->merge_tables("entities", "entitystates");
}
sub check {
- my $self = shift;
-
- $self->add_info('checking board');
+ my ($self) = @_;
+ $self->add_info('checking cpus');
if (scalar (@{$self->{entities}}) == 0) {
$self->add_unknown('no board found');
} else {
@@ -33,10 +30,12 @@ package Classes::HH3C::Component::CpuSubsystem::EntityState;
our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
-sub check {
- my $self = shift;
- my $id = shift;
+package Classes::HH3C::Component::CpuSubsystem::Entity;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
+use strict;
+sub check {
+ my ($self, $id) = @_;
$self->add_info(sprintf 'CPU %s usage is %s%%',
$id,
$self->{hh3cEntityExtCpuAvgUsage});
diff --git a/plugins-scripts/Classes/HH3C/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/HH3C/Component/EnvironmentalSubsystem.pm
index e51ba1d6..f94ae63e 100644
--- a/plugins-scripts/Classes/HH3C/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/HH3C/Component/EnvironmentalSubsystem.pm
@@ -3,23 +3,18 @@ our @ISA = qw(Classes::HH3C::Component::EntitySubsystem);
use strict;
sub init {
- my $self = shift;
-
- $self->get_entities('Classes::HH3C::Component::EnvironmentalSubsystem::EntityState');
-
- my $i = 0;
- foreach my $h ($self->get_sub_table('HH3C-ENTITY-EXT-MIB', [ 'hh3cEntityExtErrorStatus' ])) {
- foreach (keys %$h) {
- next if $_ =~ /indices/;
- @{$self->{entities}}[$i]->{$_} = $h->{$_};
- }
- $i++;
- }
+ my ($self) = @_;
+ $self->get_snmp_tables("ENTITY-MIB", [
+ ["entities", "entPhysicalTable", "Classes::HH3C::Component::EnvironmentalSubsystem::Entity", undef, ["entPhysicalDescr", "entPhysicalName", "entPhysicalClass"]]
+ ]);
+ $self->get_snmp_tables("HH3C-ENTITY-EXT-MIB", [
+ ["entitystates", "hh3cEntityExtStateTable", "Classes::HH3C::Component::EnvironmentalSubsystem::EntityState", undef, ["hh3cEntityExtErrorStatus"]]
+ ]);
+ $self->merge_tables("entities", "entitystates");
}
sub check {
- my $self = shift;
-
+ my ($self) = @_;
$self->add_info('checking entities');
if (scalar (@{$self->{entities}}) == 0) {
$self->add_unknown('no entities found');
@@ -28,7 +23,7 @@ sub check {
$_->check();
}
if (! $self->check_messages()) {
- $self->add_ok("environmental hardware working fine");
+ $self->reduce_messages_short("environmental hardware working fine");
}
}
}
@@ -37,14 +32,21 @@ package Classes::HH3C::Component::EnvironmentalSubsystem::EntityState;
our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
+package Classes::HH3C::Component::EnvironmentalSubsystem::Entity;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
+use strict;
+
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf '%s (%s) is %s',
- $self->{entPhysicalDescr},
+ $self->{entPhysicalName} || $self->{entPhysicalDescr},
$self->{entPhysicalClass},
$self->{hh3cEntityExtErrorStatus});
- if ($self->{hh3cEntityExtErrorStatus} eq "normal") {
+ if ($self->{hh3cEntityExtErrorStatus} eq "notSupported") {
+ # no health check implemented for this entity
+ $self->add_ok();
+ } elsif ($self->{hh3cEntityExtErrorStatus} eq "normal") {
$self->add_ok();
} elsif (
$self->{hh3cEntityExtErrorStatus} eq "entityAbsent" or
@@ -55,3 +57,4 @@ sub check {
$self->add_critical();
}
}
+
diff --git a/plugins-scripts/Classes/HH3C/Component/MemSubsystem.pm b/plugins-scripts/Classes/HH3C/Component/MemSubsystem.pm
index aa065410..c7ebde08 100644
--- a/plugins-scripts/Classes/HH3C/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/HH3C/Component/MemSubsystem.pm
@@ -3,22 +3,19 @@ our @ISA = qw(Classes::HH3C::Component::EntitySubsystem);
use strict;
sub init {
- my $self = shift;
-
- $self->get_entities('Classes::HH3C::Component::MemSubsystem::EntityState',
- sub { my $o = shift; $o->{entPhysicalClass} eq 'module' and $o->{entPhysicalName} =~ /board/i; } );
-
- foreach ($self->get_sub_table('HH3C-ENTITY-EXT-MIB', [ 'hh3cEntityExtMemAvgUsage' ])) {
- push @{$self->{entityext}}, $_;
- }
-
- $self->join_table($self->{entities}, $self->{entityext});
+ my ($self) = @_;
+ $self->get_snmp_tables("ENTITY-MIB", [
+ ["entities", "entPhysicalTable", "Classes::HH3C::Component::MemSubsystem::Entity", sub { my ($o) = @_; $o->{entPhysicalClass} eq 'module' and $o->{entPhysicalName} =~ /board/i; }, ["entPhysicalDescr", "entPhysicalName", "entPhysicalClass"]]
+ ]);
+ $self->get_snmp_tables("HH3C-ENTITY-EXT-MIB", [
+ ["entitystates", "hh3cEntityExtStateTable", "Classes::HH3C::Component::MemSubsystem::EntityState", undef, ["hh3cEntityExtMemAvgUsage"]]
+ ]);
+ $self->merge_tables("entities", "entitystates");
}
sub check {
- my $self = shift;
-
- $self->add_info('checking board');
+ my ($self) = @_;
+ $self->add_info('checking memory');
if (scalar (@{$self->{entities}}) == 0) {
$self->add_unknown('no board found');
} else {
@@ -33,10 +30,12 @@ package Classes::HH3C::Component::MemSubsystem::EntityState;
our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
-sub check {
- my $self = shift;
- my $id = shift;
+package Classes::HH3C::Component::MemSubsystem::Entity;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
+use strict;
+sub check {
+ my ($self, $id) = @_;
$self->add_info(sprintf 'Memory %s usage is %s%%',
$id,
$self->{hh3cEntityExtMemAvgUsage});
diff --git a/plugins-scripts/Classes/HOSTRESOURCESMIB.pm b/plugins-scripts/Classes/HOSTRESOURCESMIB.pm
index 7a5febc1..dc7ac919 100644
--- a/plugins-scripts/Classes/HOSTRESOURCESMIB.pm
+++ b/plugins-scripts/Classes/HOSTRESOURCESMIB.pm
@@ -2,3 +2,20 @@ package Classes::HOSTRESOURCESMIB;
our @ISA = qw(Classes::Device);
use strict;
+sub init {
+ my ($self) = @_;
+ if ($self->mode =~ /device::hardware::health/) {
+ $self->analyze_and_check_environmental_subsystem("Classes::HOSTRESOURCESMIB::Component::EnvironmentalSubsystem");
+ $self->analyze_and_check_environmental_subsystem("Classes::LMSENSORSMIB::Component::EnvironmentalSubsystem");
+ if (! $self->check_messages()) {
+ $self->reduce_messages("hardware working fine");
+ }
+ } elsif ($self->mode =~ /device::hardware::load/) {
+ $self->analyze_and_check_cpu_subsystem("Classes::HOSTRESOURCESMIB::Component::CpuSubsystem");
+ } elsif ($self->mode =~ /device::hardware::memory/) {
+ $self->analyze_and_check_mem_subsystem("Classes::HOSTRESOURCESMIB::Component::MemSubsystem");
+ } else {
+ $self->no_such_mode();
+ }
+}
+
diff --git a/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/ClockSubsystem.pm b/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/ClockSubsystem.pm
new file mode 100644
index 00000000..05f126ad
--- /dev/null
+++ b/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/ClockSubsystem.pm
@@ -0,0 +1,26 @@
+package Classes::HOSTRESOURCESMIB::Component::ClockSubsystem;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
+use strict;
+
+sub init {
+ my ($self) = @_;
+ $self->get_snmp_objects('HOST-RESOURCES-MIB', qw(
+ hrSystemDate
+ ));
+ $self->{localSystemDate} = time;
+}
+
+sub check {
+ my ($self) = @_;
+ if ($self->{hrSystemDate}) {
+ $self->add_info(sprintf "monitoring clock and device clock differ by %ds",
+ $self->{hrSystemDate} - $self->{localSystemDate});
+ $self->set_thresholds(metric => 'clock_deviation',
+ warning => 60, critical => 120);
+ $self->add_message($self->check_thresholds(metric => 'clock_deviation',
+ value => abs($self->{hrSystemDate} - $self->{localSystemDate})));
+ $self->add_perfdata(label => 'clock_deviation',
+ value => $self->{hrSystemDate} - $self->{localSystemDate});
+ }
+}
+
diff --git a/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/CpuSubsystem.pm b/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/CpuSubsystem.pm
index 16780870..450eb2be 100644
--- a/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/CpuSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
my $idx = 0;
$self->get_snmp_tables('HOST-RESOURCES-MIB', [
['cpus', 'hrProcessorTable', 'Classes::HOSTRESOURCESMIB::Component::CpuSubsystem::Cpu'],
@@ -18,7 +18,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'cpu %s is %.2f%%',
$self->{hrProcessorIndex},
$self->{hrProcessorLoad});
diff --git a/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/DeviceSubsystem.pm b/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/DeviceSubsystem.pm
index c0c5b191..7a15a892 100644
--- a/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/DeviceSubsystem.pm
+++ b/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/DeviceSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('HOST-RESOURCES-MIB', [
['devices', 'hrDeviceTable', 'Classes::HOSTRESOURCESMIB::Component::DeviceSubsystem::Device'],
]);
@@ -14,16 +14,39 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
+ my $class = ref($self);
+ my $newclass = $class."::".$self->{hrDeviceType};
+ {
+ no strict 'refs';
+ if (! scalar %{$newclass."::"}) {
+ *{ ${newclass}."::ISA" } = \@{ ${class}."::ISA" };
+ *{ ${newclass}."::check" } = \&{ ${class}."::check" };
+ if ($self->{hrDeviceType} eq "hrDeviceNetwork") {
+ *{ ${newclass}."::internal_name" } = sub {
+ my ($this) = (@_);
+ $this->{hrDeviceDescr} =~ /network interface (.*)/;
+ if ($1) {
+ return (uc $this->{hrDeviceType})."_".$1;
+ } else {
+ return $this->SUPER::internal_name();
+ }
+ };
+ }
+ }
+ }
+ bless $self, $newclass;
if ($self->{hrDeviceDescr} =~ /Guessing/ && ! $self->{hrDeviceStatus}) {
# found on an F5: Guessing that there's a floating point co-processor.
# if you guess there's a device, then i guess it's running.
$self->{hrDeviceStatus} = 'running';
+ } elsif ($self->{hrDeviceType} eq 'hrDeviceDiskStorage' && ! $self->{hrDeviceStatus}) {
+ $self->{hrDeviceStatus} = 'running';
}
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf '%s (%s) has status %s',
$self->{hrDeviceType}, $self->{hrDeviceDescr},
$self->{hrDeviceStatus}
@@ -44,3 +67,4 @@ sub check {
}
}
+
diff --git a/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/DiskSubsystem.pm b/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/DiskSubsystem.pm
index a67f33dc..644ae406 100644
--- a/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/DiskSubsystem.pm
+++ b/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/DiskSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('HOST-RESOURCES-MIB', [
['storages', 'hrStorageTable', 'Classes::HOSTRESOURCESMIB::Component::DiskSubsystem::Storage', sub { return shift->{hrStorageType} eq 'hrStorageFixedDisk' } ],
]);
@@ -14,7 +14,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
if ($self->{hrStorageDescr} =~ /(.*?),*\s+mounted on:\s+(.*)/) {
my ($dev, $mnt) = ($1, $2);
if ($dev =~ /^dev/) {
@@ -30,7 +30,8 @@ sub finish {
$self->{name} = $self->{hrStorageDescr};
}
if ($self->{hrStorageDescr} eq "/dev" || $self->{hrStorageDescr} =~ /^devfs/ ||
- $self->{hrStorageDescr} =~ /.*cdrom.*/ || $self->{hrStorageSize} == 0) {
+ $self->{hrStorageDescr} =~ /.*cdrom.*/ || $self->{hrStorageSize} == 0 ||
+ $self->{hrStorageDescr} =~ /.*iso$/) {
$self->{special} = 1;
} else {
$self->{special} = 0;
@@ -38,7 +39,7 @@ sub finish {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
my $free = 100;
eval {
$free = 100 - 100 * $self->{hrStorageUsed} / $self->{hrStorageSize};
diff --git a/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/EnvironmentalSubsystem.pm
index 7222b4e1..a1d2bf9f 100644
--- a/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,8 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
+ $self->get_snmp_object('HOST-RESOURCES-MIB', 'hrSystemDate');
$self->{disk_subsystem} =
Classes::HOSTRESOURCESMIB::Component::DiskSubsystem->new();
$self->{device_subsystem} =
@@ -11,14 +12,22 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{disk_subsystem}->check();
$self->{device_subsystem}->check();
+ if ($self->{hrSystemDate}) {
+ $self->set_thresholds(metric => 'clock_deviation',
+ warning => 60, critical => 120);
+ $self->add_message($self->check_thresholds(metric => 'clock_deviation',
+ value => abs(time - $self->{hrSystemDate})));
+ $self->add_perfdata(label => 'clock_deviation',
+ value => $self->{hrSystemDate} - time);
+ }
$self->reduce_messages_short('environmental hardware working fine');
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
$self->{disk_subsystem}->dump();
$self->{device_subsystem}->dump();
}
diff --git a/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/MemSubsystem.pm b/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/MemSubsystem.pm
index f8e15738..89eef945 100644
--- a/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/MemSubsystem.pm
@@ -3,18 +3,49 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('HOST-RESOURCES-MIB', [
['storagesram', 'hrStorageTable', 'Classes::HOSTRESOURCESMIB::Component::MemSubsystem::Ram', sub { return shift->{hrStorageType} eq 'hrStorageRam' } ],
]);
}
+sub check {
+ my ($self) = @_;
+ my $ramsignature =
+ join "_", sort map { $_->{hrStorageDescr} } @{$self->{storagesram}};
+ if ($ramsignature eq "RAM_RAM (Buffers)_RAM (Cache)") {
+ # https://eos.arista.com/introduction-to-managing-eos-devices-memory-utilisation/
+ my ($total, $used, $buffers, $cached) = (0, 0, 0, 0);
+ foreach (@{$self->{storagesram}}) {
+ $used = $_->{hrStorageUsed} if $_->{hrStorageDescr} eq "RAM";
+ $buffers = $_->{hrStorageUsed} if $_->{hrStorageDescr} eq "RAM (Buffers)";
+ $cached = $_->{hrStorageUsed} if $_->{hrStorageDescr} eq "RAM (Cache)";
+ $total = $_->{hrStorageSize} if $_->{hrStorageDescr} eq "RAM";
+ }
+ my $free = ($total - $used) + $buffers + $cached;
+ my $usage = 100 * ($total - $free) / $total;
+ $self->add_info(sprintf 'memory usage is %.2f%%', $usage);
+ my $label = 'memory_usage';
+ $self->set_thresholds(metric => $label, warning => '90', critical => '95');
+ $self->add_message($self->check_thresholds(metric => $label,
+ value => $usage));
+ $self->add_perfdata(
+ label => $label,
+ value => $usage,
+ uom => '%',
+ );
+ } else {
+ $self->SUPER::check();
+ }
+}
+
+
package Classes::HOSTRESOURCESMIB::Component::MemSubsystem::Ram;
our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
my $used = 100;
eval {
$used = 100 * $self->{hrStorageUsed} / $self->{hrStorageSize};
diff --git a/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/UptimeSubsystem.pm b/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/UptimeSubsystem.pm
index b9cc3869..56c2cad7 100644
--- a/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/UptimeSubsystem.pm
+++ b/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/UptimeSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
my $hrSystemUptime = $self->get_snmp_object('HOST-RESOURCES-MIB', 'hrSystemUptime');
$self->{uptime} = $self->timeticks($hrSystemUptime);
$self->debug(sprintf 'uptime: %s', $self->{uptime});
@@ -12,7 +12,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'device is up since %s',
$self->human_timeticks($self->{uptime}));
$self->set_thresholds(warning => '15:', critical => '5:');
diff --git a/plugins-scripts/Classes/HP.pm b/plugins-scripts/Classes/HP.pm
index 5439e2a8..3a20d3ea 100644
--- a/plugins-scripts/Classes/HP.pm
+++ b/plugins-scripts/Classes/HP.pm
@@ -12,7 +12,7 @@ use constant trees => (
);
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->{productname} =~ /Procurve/i ||
($self->implements_mib('HP-ICF-CHASSIS') &&
$self->implements_mib('NETSWITCH-MIB'))) {
diff --git a/plugins-scripts/Classes/HP/Procurve.pm b/plugins-scripts/Classes/HP/Procurve.pm
index bb9e0814..81dd0f76 100644
--- a/plugins-scripts/Classes/HP/Procurve.pm
+++ b/plugins-scripts/Classes/HP/Procurve.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::HP);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::HP::Procurve::Component::EnvironmentalSubsystem");
} elsif ($self->mode =~ /device::hardware::load/) {
diff --git a/plugins-scripts/Classes/HP/Procurve/Component/CpuSubsystem.pm b/plugins-scripts/Classes/HP/Procurve/Component/CpuSubsystem.pm
index 3dcdd553..0b35d97c 100644
--- a/plugins-scripts/Classes/HP/Procurve/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/HP/Procurve/Component/CpuSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('STATISTICS-MIB', (qw(
hpSwitchCpuStat)));
if (! defined $self->{hpSwitchCpuStat}) {
@@ -13,7 +13,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking cpus');
$self->add_info(sprintf 'cpu usage is %.2f%%', $self->{hpSwitchCpuStat});
$self->set_thresholds(warning => 80, critical => 90); # maybe lower, because the switching is done in hardware
diff --git a/plugins-scripts/Classes/HP/Procurve/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/HP/Procurve/Component/EnvironmentalSubsystem.pm
index 552c163b..ccc96a11 100644
--- a/plugins-scripts/Classes/HP/Procurve/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/HP/Procurve/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->implements_mib('HP-ICF-CHASSIS-MIB')) {
$self->analyze_and_check_sensor_subsystem('Classes::HP::Procurve::Component::SensorSubsystem');
} else {
diff --git a/plugins-scripts/Classes/HP/Procurve/Component/MemSubsystem.pm b/plugins-scripts/Classes/HP/Procurve/Component/MemSubsystem.pm
index b1cb2c10..4781d719 100644
--- a/plugins-scripts/Classes/HP/Procurve/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/HP/Procurve/Component/MemSubsystem.pm
@@ -3,14 +3,14 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('NETSWITCH-MIB', [
['mem', 'hpLocalMemTable', 'Classes::HP::Procurve::Component::MemSubsystem::Memory'],
]);
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking memory');
if (scalar (@{$self->{mem}}) == 0) {
} else {
@@ -26,7 +26,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{usage} = $self->{hpLocalMemAllocBytes} /
$self->{hpLocalMemTotalBytes} * 100;
$self->add_info(sprintf 'memory %s usage is %.2f',
diff --git a/plugins-scripts/Classes/HP/Procurve/Component/SensorSubsystem.pm b/plugins-scripts/Classes/HP/Procurve/Component/SensorSubsystem.pm
index 02c045d7..bb012e89 100644
--- a/plugins-scripts/Classes/HP/Procurve/Component/SensorSubsystem.pm
+++ b/plugins-scripts/Classes/HP/Procurve/Component/SensorSubsystem.pm
@@ -3,14 +3,14 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('HP-ICF-CHASSIS-MIB', [
['sensors', 'hpicfSensorTable', 'Classes::HP::Procurve::Component::SensorSubsystem::Sensor'],
]);
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking sensors');
if (scalar (@{$self->{sensors}}) == 0) {
$self->add_ok('no sensors');
@@ -27,7 +27,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'sensor %s (%s) is %s',
$self->{hpicfSensorIndex},
$self->{hpicfSensorDescr},
diff --git a/plugins-scripts/Classes/HSRP/Component/HSRPSubsystem.pm b/plugins-scripts/Classes/HSRP/Component/HSRPSubsystem.pm
index e5130b81..88958bcb 100644
--- a/plugins-scripts/Classes/HSRP/Component/HSRPSubsystem.pm
+++ b/plugins-scripts/Classes/HSRP/Component/HSRPSubsystem.pm
@@ -3,21 +3,17 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{groups} = [];
if ($self->mode =~ /device::hsrp/) {
- foreach ($self->get_snmp_table_objects(
- 'CISCO-HSRP-MIB', 'cHsrpGrpTable')) {
- my $group = Classes::HSRP::Component::HSRPSubsystem::Group->new(%{$_});
- if ($self->filter_name($group->{name})) {
- push(@{$self->{groups}}, $group);
- }
- }
+ $self->get_snmp_tables('CISCO-HSRP-MIB', [
+ ['groups', 'cHsrpGrpTable', 'Classes::HSRP::Component::HSRPSubsystem::Group', sub { my ($o) = @_; $self->filter_name($o->{name})}],
+ ]);
}
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking hsrp groups');
if ($self->mode =~ /device::hsrp::list/) {
foreach (@{$self->{groups}}) {
@@ -41,10 +37,9 @@ use strict;
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
sub finish {
- my $self = shift;
- my %params = @_;
- $self->{ifIndex} = $params{indices}->[0];
- $self->{cHsrpGrpNumber} = $params{indices}->[1];
+ my ($self) = @_;
+ $self->{ifIndex} = $self->{indices}->[0];
+ $self->{cHsrpGrpNumber} = $self->{indices}->[1];
$self->{name} = $self->{cHsrpGrpNumber}.':'.$self->{ifIndex};
if ($self->mode =~ /device::hsrp::state/) {
if (! $self->opts->role()) {
@@ -55,7 +50,7 @@ sub finish {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hsrp::state/) {
$self->add_info(sprintf 'hsrp group %s (interface %s) state is %s (active router is %s, standby router is %s)',
$self->{cHsrpGrpNumber}, $self->{ifIndex},
@@ -109,7 +104,7 @@ sub check {
}
sub list {
- my $self = shift;
+ my ($self) = @_;
printf "%s %s %s %s\n", $self->{name}, $self->{cHsrpGrpVirtualIpAddr},
$self->{cHsrpGrpActiveRouter}, $self->{cHsrpGrpStandbyRouter};
}
diff --git a/plugins-scripts/Classes/Huawei.pm b/plugins-scripts/Classes/Huawei.pm
index 2e88a2ef..c90ac68d 100644
--- a/plugins-scripts/Classes/Huawei.pm
+++ b/plugins-scripts/Classes/Huawei.pm
@@ -3,11 +3,19 @@ our @ISA = qw(Classes::Device);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
my $sysobj = $self->get_snmp_object('MIB-2-MIB', 'sysObjectID', 0);
if ($sysobj =~ /^\.*1\.3\.6\.1\.4\.1\.2011\.2\.239/) {
bless $self, 'Classes::Huawei::CloudEngine';
$self->debug('using Classes::Huawei::CloudEngine');
+ } elsif ($self->mode =~ /device::hardware::health/) {
+ $self->analyze_and_check_environmental_subsystem("Classes::Huawei::Component::EnvironmentalSubsystem");
+ } elsif ($self->mode =~ /device::hardware::load/) {
+ $self->analyze_and_check_cpu_subsystem("Classes::Huawei::Component::CpuSubsystem");
+ } elsif ($self->mode =~ /device::hardware::memory/) {
+ $self->analyze_and_check_mem_subsystem("Classes::Huawei::Component::MemSubsystem");
+ } else {
+ $self->no_such_mode();
}
if (ref($self) ne "Classes::Huawei") {
$self->init();
diff --git a/plugins-scripts/Classes/Huawei/CloudEngine.pm b/plugins-scripts/Classes/Huawei/CloudEngine.pm
index 6288ff1d..f46ce28a 100644
--- a/plugins-scripts/Classes/Huawei/CloudEngine.pm
+++ b/plugins-scripts/Classes/Huawei/CloudEngine.pm
@@ -3,654 +3,8 @@ our @ISA = qw(Classes::Huawei);
use strict;
sub init {
- my $self = shift;
-my $work_in_progress = {
-#$Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{'HUAWEI-ENTITY-EXTENT-MIB'} = {
- hwEntityExtentMIB => '1.3.6.1.4.1.2011.5.25.31',
- hwEntityExtObjects => '1.3.6.1.4.1.2011.5.25.31.1',
- hwEntityState => '1.3.6.1.4.1.2011.5.25.31.1.1',
- hwEntityStateTable => '1.3.6.1.4.1.2011.5.25.31.1.1.1',
- hwEntityStateEntry => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1',
- hwEntityAdminStatus => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.1',
- hwEntityAdminStatusDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::HwAdminState',
- hwEntityOperStatus => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.2',
- hwEntityOperStatusDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::HwOperState',
- hwEntityStandbyStatus => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.3',
- hwEntityStandbyStatusDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::HwStandbyStatus',
- hwEntityAlarmLight => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.4',
- hwEntityCpuUsage => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.5',
- hwEntityCpuUsageThreshold => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.6',
- hwEntityMemUsage => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.7',
- hwEntityMemUsageThreshold => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.8',
- hwEntityMemSize => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.9',
- hwEntityUpTime => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.10',
- hwEntityTemperature => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.11',
- hwEntityTemperatureThreshold => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.12',
- hwEntityVoltage => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.13',
- hwEntityVoltageLowThreshold => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.14',
- hwEntityVoltageHighThreshold => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.15',
- hwEntityTemperatureLowThreshold => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.16',
- hwEntityOpticalPower => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.17',
- hwEntityCurrent => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.18',
- hwEntityMemSizeMega => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.19',
- hwEntityPortType => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.20',
- hwEntityPortTypeDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityPortType',
- hwEntityDuplex => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.21',
- hwEntityDuplexDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityDuplex',
- hwEntityOpticalPowerRx => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.22',
- hwEntityCpuUsageLowThreshold => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.23',
- hwEntityBoardPower => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.24',
- hwEntityCpuFrequency => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.25',
- hwEntitySupportFlexCard => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.26',
- hwEntitySupportFlexCardDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntitySupportFlexCard',
- hwEntityBoardClass => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.27',
- hwEntityBoardClassDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityBoardClass',
- hwNseOpmStatus => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.28',
- hwEntityCpuMaxUsage => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.29',
- hwEntityCPUType => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.30',
- hwEntityMemoryType => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.31',
- hwEntityFlashSize => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.32',
- hwEntityIfUpTimes => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.33',
- hwEntityIfDownTimes => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.34',
- hwEntityCPUAvgUsage => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.35',
- hwEntityMemoryAvgUsage => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.36',
- hwEntityMemUsed => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.37',
- hwEntityTotalFanNum => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.38',
- hwEntityNomalFanNum => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.39',
- hwEntityTotalPwrNum => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.40',
- hwEntityNomalPwrNum => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.41',
- hwEntityFaultLight => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.42',
- hwEntityFaultLightDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityFaultLight',
- hwEntityBoardName => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.43',
- hwEntityBoardDescription => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.44',
- hwEntity5MinCpuUsage => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.45',
- hwEntityStartMode => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.46',
- hwEntityStartModeDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityStartMode',
- hwEntitySplitAttribute => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.47',
- hwEntityFaultLightKeepTime => '1.3.6.1.4.1.2011.5.25.31.1.1.1.1.48',
- hwRUModuleInfoTable => '1.3.6.1.4.1.2011.5.25.31.1.1.2',
- hwRUModuleInfoEntry => '1.3.6.1.4.1.2011.5.25.31.1.1.2.1',
- hwEntityBomId => '1.3.6.1.4.1.2011.5.25.31.1.1.2.1.1',
- hwEntityBomEnDesc => '1.3.6.1.4.1.2011.5.25.31.1.1.2.1.2',
- hwEntityBomLocalDesc => '1.3.6.1.4.1.2011.5.25.31.1.1.2.1.3',
- hwEntityManufacturedDate => '1.3.6.1.4.1.2011.5.25.31.1.1.2.1.4',
- hwEntityManufactureCode => '1.3.6.1.4.1.2011.5.25.31.1.1.2.1.5',
- hwEntityCLEICode => '1.3.6.1.4.1.2011.5.25.31.1.1.2.1.6',
- hwEntityUpdateLog => '1.3.6.1.4.1.2011.5.25.31.1.1.2.1.7',
- hwEntityArchivesInfoVersion => '1.3.6.1.4.1.2011.5.25.31.1.1.2.1.8',
- hwEntityOpenBomId => '1.3.6.1.4.1.2011.5.25.31.1.1.2.1.9',
- hwEntityIssueNum => '1.3.6.1.4.1.2011.5.25.31.1.1.2.1.10',
- hwEntityBoardType => '1.3.6.1.4.1.2011.5.25.31.1.1.2.1.11',
- hwOpticalModuleInfoTable => '1.3.6.1.4.1.2011.5.25.31.1.1.3',
- hwOpticalModuleInfoEntry => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1',
- hwEntityOpticalMode => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.1',
- hwEntityOpticalModeDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityOpticalMode',
- hwEntityOpticalWaveLength => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.2',
- hwEntityOpticalTransDistance => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.3',
- hwEntityOpticalVendorSn => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.4',
- hwEntityOpticalTemperature => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.5',
- hwEntityOpticalVoltage => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.6',
- hwEntityOpticalBiasCurrent => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.7',
- hwEntityOpticalRxPower => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.8',
- hwEntityOpticalTxPower => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.9',
- hwEntityOpticalType => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.10',
- hwEntityOpticalTypeDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityOpticalType',
- hwEntityOpticalTransBW => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.11',
- hwEntityOpticalFiberType => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.12',
- hwEntityOpticalFiberTypeDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityOpticalFiberType',
- hwEntityOpticalRxLowThreshold => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.13',
- hwEntityOpticalRxHighThreshold => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.14',
- hwEntityOpticalTxLowThreshold => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.15',
- hwEntityOpticalTxHighThreshold => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.16',
- hwEntityOpticalPlug => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.17',
- hwEntityOpticalPlugDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityOpticalPlug',
- hwEntityOpticalDirectionType => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.18',
- hwEntityOpticalDirectionTypeDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityOpticalDirectionType',
- hwEntityOpticalUserEeprom => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.19',
- hwEntityOpticalRxLowWarnThreshold => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.20',
- hwEntityOpticalRxHighWarnThreshold => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.21',
- hwEntityOpticalTxLowWarnThreshold => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.22',
- hwEntityOpticalTxHighWarnThreshold => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.23',
- hwEntityOpticalVenderName => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.24',
- hwEntityOpticalVenderPn => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.25',
- hwEntityOpticalAuthenticationStatus => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.26',
- hwEntityOpticalAuthenticationStatusDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityOpticalAuthenticationStatus',
- hwEntityOpticalTunableType => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.27',
- hwEntityOpticalTunableTypeDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityOpticalTunableType',
- hwEntityOpticalWaveLengthDecimal => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.28',
- hwEntityOpticalTunableModuleChannel => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.29',
- hwEntityOpticalWaveBand => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.30',
- hwEntityOpticalWaveBandDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityOpticalWaveBand',
- hwEntityOpticalLaneBiasCurrent => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.31',
- hwEntityOpticalLaneRxPower => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.32',
- hwEntityOpticalLaneTxPower => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.33',
- hwEntityOpticalVendorOUI => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.34',
- hwEntityOpticalVendorRev => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.35',
- hwEntityOpticalGponSN => '1.3.6.1.4.1.2011.5.25.31.1.1.3.1.36',
- hwMonitorInputTable => '1.3.6.1.4.1.2011.5.25.31.1.1.4',
- hwMonitorInputEntry => '1.3.6.1.4.1.2011.5.25.31.1.1.4.1',
- hwMonitorInputIndex => '1.3.6.1.4.1.2011.5.25.31.1.1.4.1.1',
- hwMonitorInputName => '1.3.6.1.4.1.2011.5.25.31.1.1.4.1.2',
- hwMonitorInputState => '1.3.6.1.4.1.2011.5.25.31.1.1.4.1.3',
- hwMonitorInputStateEnable => '1.3.6.1.4.1.2011.5.25.31.1.1.4.1.4',
- hwMonitorInputRowStatus => '1.3.6.1.4.1.2011.5.25.31.1.1.4.1.5',
- hwMonitorOutputTable => '1.3.6.1.4.1.2011.5.25.31.1.1.5',
- hwMonitorOutputEntry => '1.3.6.1.4.1.2011.5.25.31.1.1.5.1',
- hwMonitorOutputIndex => '1.3.6.1.4.1.2011.5.25.31.1.1.5.1.1',
- hwMonitorOutputRuleIndex => '1.3.6.1.4.1.2011.5.25.31.1.1.5.1.2',
- hwMonitorOutputMask => '1.3.6.1.4.1.2011.5.25.31.1.1.5.1.3',
- hwMonitorOutputKey => '1.3.6.1.4.1.2011.5.25.31.1.1.5.1.4',
- hwMonitorOutputRowStatus => '1.3.6.1.4.1.2011.5.25.31.1.1.5.1.5',
- hwEntPowerUsedInfoTable => '1.3.6.1.4.1.2011.5.25.31.1.1.6',
- hwEntPowerUsedInfoEntry => '1.3.6.1.4.1.2011.5.25.31.1.1.6.1',
- hwEntPowerUsedInfoBoardName => '1.3.6.1.4.1.2011.5.25.31.1.1.6.1.1',
- hwEntPowerUsedInfoBoardType => '1.3.6.1.4.1.2011.5.25.31.1.1.6.1.2',
- hwEntPowerUsedInfoBoardSlot => '1.3.6.1.4.1.2011.5.25.31.1.1.6.1.3',
- hwEntPowerUsedInfoPower => '1.3.6.1.4.1.2011.5.25.31.1.1.6.1.4',
- hwVirtualCableTestTable => '1.3.6.1.4.1.2011.5.25.31.1.1.7',
- hwVirtualCableTestEntry => '1.3.6.1.4.1.2011.5.25.31.1.1.7.1',
- hwVirtualCableTestIfIndex => '1.3.6.1.4.1.2011.5.25.31.1.1.7.1.1',
- hwVirtualCableTestPairStatus => '1.3.6.1.4.1.2011.5.25.31.1.1.7.1.2',
- hwVirtualCableTestPairStatusDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwVirtualCableTestPairStatus',
- hwVirtualCableTestPairLength => '1.3.6.1.4.1.2011.5.25.31.1.1.7.1.3',
- hwVirtualCableTestOperation => '1.3.6.1.4.1.2011.5.25.31.1.1.7.1.4',
- hwVirtualCableTestOperationDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwVirtualCableTestOperation',
- hwVirtualCableTestLastTime => '1.3.6.1.4.1.2011.5.25.31.1.1.7.1.5',
- hwVirtualCableTestPairAStatus => '1.3.6.1.4.1.2011.5.25.31.1.1.7.1.6',
- hwVirtualCableTestPairAStatusDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwVirtualCableTestPairAStatus',
- hwVirtualCableTestPairBStatus => '1.3.6.1.4.1.2011.5.25.31.1.1.7.1.7',
- hwVirtualCableTestPairBStatusDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwVirtualCableTestPairBStatus',
- hwVirtualCableTestPairCStatus => '1.3.6.1.4.1.2011.5.25.31.1.1.7.1.8',
- hwVirtualCableTestPairCStatusDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwVirtualCableTestPairCStatus',
- hwVirtualCableTestPairDStatus => '1.3.6.1.4.1.2011.5.25.31.1.1.7.1.9',
- hwVirtualCableTestPairDStatusDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwVirtualCableTestPairDStatus',
- hwVirtualCableTestPairALength => '1.3.6.1.4.1.2011.5.25.31.1.1.7.1.10',
- hwVirtualCableTestPairBLength => '1.3.6.1.4.1.2011.5.25.31.1.1.7.1.11',
- hwVirtualCableTestPairCLength => '1.3.6.1.4.1.2011.5.25.31.1.1.7.1.12',
- hwVirtualCableTestPairDLength => '1.3.6.1.4.1.2011.5.25.31.1.1.7.1.13',
- hwTemperatureThresholdTable => '1.3.6.1.4.1.2011.5.25.31.1.1.8',
- hwTemperatureThresholdEntry => '1.3.6.1.4.1.2011.5.25.31.1.1.8.1',
- hwEntityTempSlotId => '1.3.6.1.4.1.2011.5.25.31.1.1.8.1.1',
- hwEntityTempI2CId => '1.3.6.1.4.1.2011.5.25.31.1.1.8.1.2',
- hwEntityTempAddr => '1.3.6.1.4.1.2011.5.25.31.1.1.8.1.3',
- hwEntityTempChannel => '1.3.6.1.4.1.2011.5.25.31.1.1.8.1.4',
- hwEntityTempStatus => '1.3.6.1.4.1.2011.5.25.31.1.1.8.1.5',
- hwEntityTempStatusDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityTempStatus',
- hwEntityTempValue => '1.3.6.1.4.1.2011.5.25.31.1.1.8.1.6',
- hwEntityTempMinorAlmThreshold => '1.3.6.1.4.1.2011.5.25.31.1.1.8.1.7',
- hwEntityTempMajorAlmThreshold => '1.3.6.1.4.1.2011.5.25.31.1.1.8.1.8',
- hwEntityTempFatalAlmThreshold => '1.3.6.1.4.1.2011.5.25.31.1.1.8.1.9',
- hwVoltageInfoTable => '1.3.6.1.4.1.2011.5.25.31.1.1.9',
- hwVoltageInfoEntry => '1.3.6.1.4.1.2011.5.25.31.1.1.9.1',
- hwEntityVolSlot => '1.3.6.1.4.1.2011.5.25.31.1.1.9.1.1',
- hwEntityVolI2CId => '1.3.6.1.4.1.2011.5.25.31.1.1.9.1.2',
- hwEntityVolAddr => '1.3.6.1.4.1.2011.5.25.31.1.1.9.1.3',
- hwEntityVolChannel => '1.3.6.1.4.1.2011.5.25.31.1.1.9.1.4',
- hwEntityVolStatus => '1.3.6.1.4.1.2011.5.25.31.1.1.9.1.5',
- hwEntityVolStatusDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityVolStatus',
- hwEntityVolRequired => '1.3.6.1.4.1.2011.5.25.31.1.1.9.1.6',
- hwEntityVolCurValue => '1.3.6.1.4.1.2011.5.25.31.1.1.9.1.7',
- hwEntityVolRatio => '1.3.6.1.4.1.2011.5.25.31.1.1.9.1.8',
- hwEntityVolLowAlmMajor => '1.3.6.1.4.1.2011.5.25.31.1.1.9.1.9',
- hwEntityVolLowAlmFatal => '1.3.6.1.4.1.2011.5.25.31.1.1.9.1.10',
- hwEntityVolHighAlmMajor => '1.3.6.1.4.1.2011.5.25.31.1.1.9.1.11',
- hwEntityVolHighAlmFatal => '1.3.6.1.4.1.2011.5.25.31.1.1.9.1.12',
- hwFanStatusTable => '1.3.6.1.4.1.2011.5.25.31.1.1.10',
- hwFanStatusEntry => '1.3.6.1.4.1.2011.5.25.31.1.1.10.1',
- hwEntityFanSlot => '1.3.6.1.4.1.2011.5.25.31.1.1.10.1.1',
- hwEntityFanSn => '1.3.6.1.4.1.2011.5.25.31.1.1.10.1.2',
- hwEntityFanReg => '1.3.6.1.4.1.2011.5.25.31.1.1.10.1.3',
- hwEntityFanRegDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityFanReg',
- hwEntityFanSpdAdjMode => '1.3.6.1.4.1.2011.5.25.31.1.1.10.1.4',
- hwEntityFanSpdAdjModeDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityFanSpdAdjMode',
- hwEntityFanSpeed => '1.3.6.1.4.1.2011.5.25.31.1.1.10.1.5',
- hwEntityFanPresent => '1.3.6.1.4.1.2011.5.25.31.1.1.10.1.6',
- hwEntityFanPresentDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityFanPresent',
- hwEntityFanState => '1.3.6.1.4.1.2011.5.25.31.1.1.10.1.7',
- hwEntityFanStateDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityFanState',
- hwEntityFanDesc => '1.3.6.1.4.1.2011.5.25.31.1.1.10.1.8',
- hwEntityGlobalPara => '1.3.6.1.4.1.2011.5.25.31.1.1.11',
- hwEntityServiceType => '1.3.6.1.4.1.2011.5.25.31.1.1.11.1',
- hwEntityServiceTypeDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityServiceType',
- hwDeviceServiceType => '1.3.6.1.4.1.2011.5.25.31.1.1.11.2',
- hwEntityManufacturerOUI => '1.3.6.1.4.1.2011.5.25.31.1.1.11.3',
- hwPortBip8StatisticsTable => '1.3.6.1.4.1.2011.5.25.31.1.1.12',
- hwPortBip8StatisticsEntry => '1.3.6.1.4.1.2011.5.25.31.1.1.12.1',
- hwPhysicalPortBip8StatisticsEB => '1.3.6.1.4.1.2011.5.25.31.1.1.12.1.1',
- hwPhysicalPortBip8StatisticsES => '1.3.6.1.4.1.2011.5.25.31.1.1.12.1.2',
- hwPhysicalPortBip8StatisticsSES => '1.3.6.1.4.1.2011.5.25.31.1.1.12.1.3',
- hwPhysicalPortBip8StatisticsUAS => '1.3.6.1.4.1.2011.5.25.31.1.1.12.1.4',
- hwPhysicalPortBip8StatisticsBBE => '1.3.6.1.4.1.2011.5.25.31.1.1.12.1.5',
- hwPhysicalPortSpeed => '1.3.6.1.4.1.2011.5.25.31.1.1.12.1.6',
- hwStorageEntTable => '1.3.6.1.4.1.2011.5.25.31.1.1.13',
- hwStorageEntEntry => '1.3.6.1.4.1.2011.5.25.31.1.1.13.1',
- hwStorageEntIndex => '1.3.6.1.4.1.2011.5.25.31.1.1.13.1.1',
- hwStorageEntType => '1.3.6.1.4.1.2011.5.25.31.1.1.13.1.2',
- hwStorageEntSpace => '1.3.6.1.4.1.2011.5.25.31.1.1.13.1.3',
- hwStorageEntSpaceFree => '1.3.6.1.4.1.2011.5.25.31.1.1.13.1.4',
- hwStorageEntName => '1.3.6.1.4.1.2011.5.25.31.1.1.13.1.5',
- hwStorageEntDescr => '1.3.6.1.4.1.2011.5.25.31.1.1.13.1.6',
- hwSystemPowerTable => '1.3.6.1.4.1.2011.5.25.31.1.1.14',
- hwSystemPowerEntry => '1.3.6.1.4.1.2011.5.25.31.1.1.14.1',
- hwSystemPowerDeviceID => '1.3.6.1.4.1.2011.5.25.31.1.1.14.1.1',
- hwSystemPowerTotalPower => '1.3.6.1.4.1.2011.5.25.31.1.1.14.1.2',
- hwSystemPowerUsedPower => '1.3.6.1.4.1.2011.5.25.31.1.1.14.1.3',
- hwSystemPowerRemainPower => '1.3.6.1.4.1.2011.5.25.31.1.1.14.1.4',
- hwSystemPowerReservedPower => '1.3.6.1.4.1.2011.5.25.31.1.1.14.1.5',
- hwBatteryInfoTable => '1.3.6.1.4.1.2011.5.25.31.1.1.15',
- hwBatteryInfoEntry => '1.3.6.1.4.1.2011.5.25.31.1.1.15.1',
- hwBatteryState => '1.3.6.1.4.1.2011.5.25.31.1.1.15.1.1',
- hwBatteryStateDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwBatteryState',
- hwBatteryTemperatureLow => '1.3.6.1.4.1.2011.5.25.31.1.1.15.1.2',
- hwBatteryTemperatureHigh => '1.3.6.1.4.1.2011.5.25.31.1.1.15.1.3',
- hwBatteryRemainPercent => '1.3.6.1.4.1.2011.5.25.31.1.1.15.1.4',
- hwBatteryRemainTime => '1.3.6.1.4.1.2011.5.25.31.1.1.15.1.5',
- hwBatteryElecTimes => '1.3.6.1.4.1.2011.5.25.31.1.1.15.1.6',
- hwBatteryLifeThreshold => '1.3.6.1.4.1.2011.5.25.31.1.1.15.1.7',
- hwGPSLocationInfo => '1.3.6.1.4.1.2011.5.25.31.1.1.16',
- hwGPSLongitude => '1.3.6.1.4.1.2011.5.25.31.1.1.16.1',
- hwGPSLatitude => '1.3.6.1.4.1.2011.5.25.31.1.1.16.2',
- hwGPSVelocity => '1.3.6.1.4.1.2011.5.25.31.1.1.16.3',
- hwAdmPortTable => '1.3.6.1.4.1.2011.5.25.31.1.1.17',
- hwAdmPortEntry => '1.3.6.1.4.1.2011.5.25.31.1.1.17.1',
- hwAdmPortDescription => '1.3.6.1.4.1.2011.5.25.31.1.1.17.1.1',
- hwPwrStatusTable => '1.3.6.1.4.1.2011.5.25.31.1.1.18',
- hwPwrStatusEntry => '1.3.6.1.4.1.2011.5.25.31.1.1.18.1',
- hwEntityPwrSlot => '1.3.6.1.4.1.2011.5.25.31.1.1.18.1.1',
- hwEntityPwrSn => '1.3.6.1.4.1.2011.5.25.31.1.1.18.1.2',
- hwEntityPwrReg => '1.3.6.1.4.1.2011.5.25.31.1.1.18.1.3',
- hwEntityPwrRegDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityPwrReg',
- hwEntityPwrMode => '1.3.6.1.4.1.2011.5.25.31.1.1.18.1.4',
- hwEntityPwrModeDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityPwrMode',
- hwEntityPwrPresent => '1.3.6.1.4.1.2011.5.25.31.1.1.18.1.5',
- hwEntityPwrPresentDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityPwrPresent',
- hwEntityPwrState => '1.3.6.1.4.1.2011.5.25.31.1.1.18.1.6',
- hwEntityPwrStateDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityPwrState',
- hwEntityPwrCurrent => '1.3.6.1.4.1.2011.5.25.31.1.1.18.1.7',
- hwEntityPwrVoltage => '1.3.6.1.4.1.2011.5.25.31.1.1.18.1.8',
- hwEntityPwrDesc => '1.3.6.1.4.1.2011.5.25.31.1.1.18.1.9',
- hwEntityPhysicalSpecTable => '1.3.6.1.4.1.2011.5.25.31.1.2',
- hwEntityPhysicalSpecRack => '1.3.6.1.4.1.2011.5.25.31.1.2.1',
- hwEntityPhysicalSpecFrame => '1.3.6.1.4.1.2011.5.25.31.1.2.2',
- hwEntityPhysicalSpecSlot => '1.3.6.1.4.1.2011.5.25.31.1.2.3',
- hwEntityPhysicalSpecBoard => '1.3.6.1.4.1.2011.5.25.31.1.2.4',
- hwEntityPhysicalSpecSubSlot => '1.3.6.1.4.1.2011.5.25.31.1.2.5',
- hwEntityPhysicalSpecSubBoard => '1.3.6.1.4.1.2011.5.25.31.1.2.6',
- hwEntityPhysicalSpecPort => '1.3.6.1.4.1.2011.5.25.31.1.2.7',
- hwEntityPhysicalSpecEmu => '1.3.6.1.4.1.2011.5.25.31.1.2.8',
- hwEntityPhysicalSpecPowerframe => '1.3.6.1.4.1.2011.5.25.31.1.2.9',
- hwEntityPhysicalSpecPowermodule => '1.3.6.1.4.1.2011.5.25.31.1.2.10',
- hwEntityPhysicalSpecBattery => '1.3.6.1.4.1.2011.5.25.31.1.2.11',
- hwEntityExtTraps => '1.3.6.1.4.1.2011.5.25.31.2',
- hwEntityExtTrapsPrefix => '1.3.6.1.4.1.2011.5.25.31.2.0',
- hwEntityExtTrapObject => '1.3.6.1.4.1.2011.5.25.31.2.1',
- hwEntityExtTrapBaseSoftwareVersion => '1.3.6.1.4.1.2011.5.25.31.2.1.1',
- hwEntityExtTrapBoardSoftwareVersion => '1.3.6.1.4.1.2011.5.25.31.2.1.2',
- hwPhysicalName => '1.3.6.1.4.1.2011.5.25.31.2.1.3',
- hwEntityExtTrap => '1.3.6.1.4.1.2011.5.25.31.2.2',
- hwDevicePowerInfoObjects => '1.3.6.1.4.1.2011.5.25.31.3',
- hwDevicePowerInfoTotalPower => '1.3.6.1.4.1.2011.5.25.31.3.1',
- hwDevicePowerInfoUsedPower => '1.3.6.1.4.1.2011.5.25.31.3.2',
- hwEntityExtConformance => '1.3.6.1.4.1.2011.5.25.31.4',
- hwEntityExtCompliances => '1.3.6.1.4.1.2011.5.25.31.4.1',
- hwEntityExtGroups => '1.3.6.1.4.1.2011.5.25.31.4.2',
- hwPnpObjects => '1.3.6.1.4.1.2011.5.25.31.5',
- hwPnpInfo => '1.3.6.1.4.1.2011.5.25.31.5.1',
- hwHardwareCapaSequenceNo => '1.3.6.1.4.1.2011.5.25.31.5.1.1',
- hwAlarmPnPSequenceNo => '1.3.6.1.4.1.2011.5.25.31.5.1.2',
- hwPnpTraps => '1.3.6.1.4.1.2011.5.25.31.5.2',
- hwPnpOperateTable => '1.3.6.1.4.1.2011.5.25.31.5.3',
- hwPnpOperateEntry => '1.3.6.1.4.1.2011.5.25.31.5.3.1',
- hwFileGeneIndex => '1.3.6.1.4.1.2011.5.25.31.5.3.1.1',
- hwFileGeneOperState => '1.3.6.1.4.1.2011.5.25.31.5.3.1.2',
- hwFileGeneOperStateDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwFileGeneOperState',
- hwFileGeneResourceType => '1.3.6.1.4.1.2011.5.25.31.5.3.1.3',
- hwFileGeneResourceTypeDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwFileGeneResourceType',
- hwFileGeneResourceID => '1.3.6.1.4.1.2011.5.25.31.5.3.1.4',
- hwFileGeneDestinationFile => '1.3.6.1.4.1.2011.5.25.31.5.3.1.5',
- hwFileGeneRowStatus => '1.3.6.1.4.1.2011.5.25.31.5.3.1.6',
- hwSystemGlobalObjects => '1.3.6.1.4.1.2011.5.25.31.6',
- hwEntitySystemNetID => '1.3.6.1.4.1.2011.5.25.31.6.1',
- hwEntitySoftwareName => '1.3.6.1.4.1.2011.5.25.31.6.2',
- hwEntitySoftwareVersion => '1.3.6.1.4.1.2011.5.25.31.6.3',
- hwEntitySoftwareVendor => '1.3.6.1.4.1.2011.5.25.31.6.4',
- hwEntitySystemModel => '1.3.6.1.4.1.2011.5.25.31.6.5',
- hwEntitySystemTime => '1.3.6.1.4.1.2011.5.25.31.6.6',
- hwEntitySystemMacAddress => '1.3.6.1.4.1.2011.5.25.31.6.7',
- hwEntitySystemReset => '1.3.6.1.4.1.2011.5.25.31.6.8',
- hwEntitySystemResetDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntitySystemReset',
- hwEntitySystemHealthInterval => '1.3.6.1.4.1.2011.5.25.31.6.9',
- hwEntitySystemNEId => '1.3.6.1.4.1.2011.5.25.31.6.10',
- hwEntitySystemServiceType => '1.3.6.1.4.1.2011.5.25.31.6.11',
- hwHeartbeatObjects => '1.3.6.1.4.1.2011.5.25.31.7',
- hwHeartbeatConfig => '1.3.6.1.4.1.2011.5.25.31.7.1',
- hwEntityHeartbeatOnOff => '1.3.6.1.4.1.2011.5.25.31.7.1.1',
- hwEntityHeartbeatOnOffDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityHeartbeatOnOff',
- hwEntityHeartbeatPeriod => '1.3.6.1.4.1.2011.5.25.31.7.1.2',
- hwHeartbeatTrapPrefix => '1.3.6.1.4.1.2011.5.25.31.7.2',
- hwPreDisposeObjects => '1.3.6.1.4.1.2011.5.25.31.8',
- hwPreDisposeInfo => '1.3.6.1.4.1.2011.5.25.31.8.1',
- hwPreDisposeSequenceNo => '1.3.6.1.4.1.2011.5.25.31.8.1.1',
- hwPreDisposedTraps => '1.3.6.1.4.1.2011.5.25.31.8.2',
- hwPreDisposeConfigTable => '1.3.6.1.4.1.2011.5.25.31.8.3',
- hwPreDisposeConfigEntry => '1.3.6.1.4.1.2011.5.25.31.8.3.1',
- hwDisposeSlot => '1.3.6.1.4.1.2011.5.25.31.8.3.1.1',
- hwDisposeCardId => '1.3.6.1.4.1.2011.5.25.31.8.3.1.2',
- hwDisposeSbom => '1.3.6.1.4.1.2011.5.25.31.8.3.1.3',
- hwDisposeRowStatus => '1.3.6.1.4.1.2011.5.25.31.8.3.1.4',
- hwDisposeOperState => '1.3.6.1.4.1.2011.5.25.31.8.3.1.5',
- hwDisposeOperStateDefinition => 'HUAWEI-ENTITY-EXTENT-MIB::hwDisposeOperState',
- hwPreDisposeEntInfoTable => '1.3.6.1.4.1.2011.5.25.31.8.4',
- hwPreDisposeEntInfoEntry => '1.3.6.1.4.1.2011.5.25.31.8.4.1',
- hwDisposeEntPhysicalIndex => '1.3.6.1.4.1.2011.5.25.31.8.4.1.1',
- hwDisposeEntPhysicalDescr => '1.3.6.1.4.1.2011.5.25.31.8.4.1.2',
- hwDisposeEntPhysicalVendorType => '1.3.6.1.4.1.2011.5.25.31.8.4.1.3',
- hwDisposeEntPhysicalContainedIn => '1.3.6.1.4.1.2011.5.25.31.8.4.1.4',
- hwDisposeEntPhysicalClass => '1.3.6.1.4.1.2011.5.25.31.8.4.1.5',
- hwDisposeEntPhysicalParentRelPos => '1.3.6.1.4.1.2011.5.25.31.8.4.1.6',
- hwDisposeEntPhysicalName => '1.3.6.1.4.1.2011.5.25.31.8.4.1.7',
- hwOSPUnifyManageObjects => '1.3.6.1.4.1.2011.5.25.31.9',
- hwEntityExtOSPTrapsPrefix => '1.3.6.1.4.1.2011.5.25.31.9.1',
-};
+ my ($self) = @_;
-my $definitions_work_in_progress = {
-#$Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{'HUAWEI-ENTITY-EXTENT-MIB'} = {
- HwAdminState => {
- '1' => 'notSupported',
- '2' => 'locked',
- '3' => 'shuttingDown',
- '4' => 'unlocked',
- '11' => 'up',
- '12' => 'down',
- '13' => 'loopback',
- },
- HwOperState => {
- '1' => 'notSupported',
- '2' => 'disabled',
- '3' => 'enabled',
- '4' => 'offline',
- '11' => 'up',
- '12' => 'down',
- '13' => 'connect',
- '15' => 'protocolUp',
- '16' => 'linkUp',
- '17' => 'linkDown',
- },
- HwStandbyStatus => {
- '1' => 'notSupported',
- '2' => 'hotStandby',
- '3' => 'coldStandby',
- '4' => 'providingService',
- },
- hwEntitySupportFlexCard => {
- '1' => 'notSupported',
- '2' => 'flexible',
- '3' => 'unflexible',
- '4' => 'dummy',
- },
- hwEntityDuplex => {
- '1' => 'notSupported',
- '2' => 'full',
- '3' => 'half',
- },
- hwEntityVolStatus => {
- '1' => 'normal',
- '2' => 'major',
- '3' => 'fatal',
- },
- hwDisposeOperState => {
- '1' => 'opSuccess',
- '2' => 'opInProgress',
- '3' => 'opDevNotSupportPredispose',
- '4' => 'opCardNotSupportPredispose',
- '5' => 'opAlreadyPredispose',
- '6' => 'opCardConflict',
- '7' => 'opDevOperationError',
- },
- hwEntityFanReg => {
- '1' => 'yes',
- '2' => 'no',
- },
- hwVirtualCableTestPairAStatus => {
- '1' => 'normal',
- '2' => 'abnormalOpen',
- '3' => 'abnormalShort',
- '4' => 'abnormalOpenShort',
- '5' => 'abnormalCrossTalk',
- '6' => 'unknown',
- '7' => 'notSupport',
- },
- hwFileGeneResourceType => {
- '1' => 'pnpcard',
- '2' => 'pnpsubcard',
- '3' => 'pnphardcapability',
- '4' => 'pnpPreDisposeCapability',
- '5' => 'pnpframe',
- '6' => 'pnpdevtype',
- '7' => 'pnpalarm',
- },
- hwEntityOpticalDirectionType => {
- '1' => 'notSupported',
- '2' => 'twoFiberBidirection',
- '3' => 'oneFiberBidirection',
- '4' => 'twoFiberTwoPortBidirection',
- },
- hwEntityPortType => {
- '1' => 'notSupported',
- '2' => 'copper',
- '3' => 'fiber100',
- '4' => 'fiber1000',
- '5' => 'fiber10000',
- '6' => 'opticalnotExist',
- '7' => 'optical',
- },
- hwEntityTempStatus => {
- '1' => 'normal',
- '2' => 'minor',
- '3' => 'major',
- '4' => 'fatal',
- },
- hwEntityOpticalFiberType => {
- '0' => 'unknown',
- '1' => 'sc',
- '2' => 'style1CopperConnector',
- '3' => 'style2CopperConnector',
- '4' => 'bncTnc',
- '5' => 'coaxialHeaders',
- '6' => 'fiberJack',
- '7' => 'lc',
- '8' => 'mtRj',
- '9' => 'mu',
- '10' => 'sg',
- '11' => 'opticalPigtail',
- '12' => 'mpo',
- '20' => 'hssdcII',
- '21' => 'copperPigtail',
- },
- hwEntityPwrState => {
- '1' => 'supply',
- '2' => 'notSupply',
- '3' => 'sleep',
- '4' => 'unknown',
- },
- hwEntityPwrPresent => {
- '1' => 'present',
- '2' => 'absent',
- },
- hwVirtualCableTestOperation => {
- '1' => 'startTest',
- '2' => 'resetTestValue',
- '3' => 'readyStartTest',
- },
- hwEntityStartMode => {
- '1' => 'notSupported',
- '2' => 'cold',
- '3' => 'warm',
- '4' => 'unknown',
- },
- hwFileGeneOperState => {
- '1' => 'opInProgress',
- '2' => 'opSuccess',
- '3' => 'opGetFileError',
- '4' => 'opInvalidDestName',
- '5' => 'opNoFlashSpace',
- '6' => 'opWriteFileError',
- '7' => 'opDestoryError',
- },
- hwEntityPwrMode => {
- '1' => 'unknown',
- '2' => 'dc',
- '3' => 'ac',
- },
- hwEntityOpticalPlug => {
- '0' => 'notSupported',
- '1' => 'true',
- '2' => 'false',
- },
- hwEntityFanState => {
- '1' => 'normal',
- '2' => 'abnormal',
- },
- hwEntityBoardClass => {
- '1' => 'notSupported',
- '2' => 'mpu',
- '3' => 'lpu',
- '4' => 'sfu',
- '5' => 'icu',
- '6' => 'ecu',
- '7' => 'fan',
- '8' => 'power',
- '9' => 'lcd',
- '10' => 'pmu',
- '11' => 'cmu',
- },
- hwVirtualCableTestPairCStatus => {
- '1' => 'normal',
- '2' => 'abnormalOpen',
- '3' => 'abnormalShort',
- '4' => 'abnormalOpenShort',
- '5' => 'abnormalCrossTalk',
- '6' => 'unknown',
- '7' => 'notSupport',
- },
- hwEntityPwrReg => {
- '1' => 'yes',
- '2' => 'no',
- },
- hwEntityFaultLight => {
- '1' => 'notSupported',
- '2' => 'normal',
- '3' => 'underRepair',
- },
- hwEntityFanPresent => {
- '1' => 'present',
- '2' => 'absent',
- },
- hwEntityFanSpdAdjMode => {
- '1' => 'auto',
- '2' => 'manual',
- '3' => 'unknown',
- },
- hwVirtualCableTestPairBStatus => {
- '1' => 'normal',
- '2' => 'abnormalOpen',
- '3' => 'abnormalShort',
- '4' => 'abnormalOpenShort',
- '5' => 'abnormalCrossTalk',
- '6' => 'unknown',
- '7' => 'notSupport',
- },
- hwEntitySystemReset => {
- '1' => 'normal',
- '2' => 'restart',
- },
- hwEntityOpticalAuthenticationStatus => {
- '0' => 'unknown',
- '1' => 'authenticated',
- '2' => 'unauthenticated',
- },
- hwEntityOpticalWaveBand => {
- '0' => 'unknown',
- '1' => 'clBand',
- '2' => 'cBand',
- '3' => 'lBand',
- '4' => 'c32Band',
- '5' => 'ramancBand',
- '6' => 'ramanlBand',
- '7' => 'cwdmBand',
- '8' => 'smcBand',
- '9' => 'c96bBand',
- '10' => 'c192bBand',
- },
- hwEntityOpticalMode => {
- '1' => 'notSupported',
- '2' => 'singleMode',
- '3' => 'multiMode5',
- '4' => 'multiMode6',
- '5' => 'noValue',
- },
- hwVirtualCableTestPairStatus => {
- '1' => 'normal',
- '2' => 'abnormalOpen',
- '3' => 'abnormalShort',
- '4' => 'abnormalOpenShort',
- '5' => 'abnormalCrossTalk',
- '6' => 'unknown',
- '7' => 'notSupport',
- },
- hwBatteryState => {
- '1' => 'charge',
- '2' => 'discharge',
- '3' => 'full',
- '4' => 'abnormal',
- },
- hwEntityServiceType => {
- '1' => 'sslvpn',
- '2' => 'firewall',
- '3' => 'loadBalance',
- '4' => 'ipsec',
- '5' => 'netstream',
- '6' => 'wlan',
- },
- hwEntityOpticalType => {
- '0' => 'unknown',
- '1' => 'sc',
- '2' => 'gbic',
- '3' => 'sfp',
- '4' => 'esfp',
- '5' => 'rj45',
- '6' => 'xfp',
- '7' => 'xenpak',
- '8' => 'transponder',
- '9' => 'cfp',
- '10' => 'smb',
- '11' => 'sfpplus',
- '12' => 'cxp',
- '13' => 'qsfp',
- '14' => 'qsfpplus',
- '15' => 'cfp2',
- '16' => 'dwdmsfp',
- },
- hwVirtualCableTestPairDStatus => {
- '1' => 'normal',
- '2' => 'abnormalOpen',
- '3' => 'abnormalShort',
- '4' => 'abnormalOpenShort',
- '5' => 'abnormalCrossTalk',
- '6' => 'unknown',
- '7' => 'notSupport',
- },
- hwEntityHeartbeatOnOff => {
- '1' => 'on',
- '2' => 'off',
- },
- hwEntityOpticalTunableType => {
- '1' => 'notSupported',
- '2' => 'notTunable',
- '3' => 'tunable',
- '4' => 'supportTunableType',
- },
-};
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::Huawei::Component::EnvironmentalSubsystem");
} elsif ($self->mode =~ /device::hardware::load/) {
@@ -685,7 +39,7 @@ hwPnpOperateTable
hwPreDisposeConfigTable
hwPreDisposeEntInfoTable)) {
$self->get_snmp_tables('HUAWEI-ENTITY-EXTENT-MIB', [
-# [$ding, $ding, 'Monitoring::GLPlugin::SNMP::TableItem'],
+ [$ding, $ding, 'Monitoring::GLPlugin::SNMP::TableItem'],
]);
}
diff --git a/plugins-scripts/Classes/Huawei/Component/CpuSubsystem.pm b/plugins-scripts/Classes/Huawei/Component/CpuSubsystem.pm
index edb51d4d..be803257 100644
--- a/plugins-scripts/Classes/Huawei/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/Huawei/Component/CpuSubsystem.pm
@@ -3,9 +3,9 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('ENTITY-MIB', [
- ['entities', 'entPhysicalTable', 'Classes::Huawei::Component::CpuSubsystem::Cpu', sub { my $o = shift; $o->{entPhysicalClass} eq 'module' }, ['entPhysicalClass', 'entPhysicalDescr', 'entPhysicalName']],
+ ['entities', 'entPhysicalTable', 'Classes::Huawei::Component::CpuSubsystem::Cpu', sub { my ($o) = @_; $o->{entPhysicalClass} eq 'module' }, ['entPhysicalClass', 'entPhysicalDescr', 'entPhysicalName']],
]);
$self->get_snmp_tables('HUAWEI-ENTITY-EXTENT-MIB', [
['entitystates', 'hwEntityStateTable', 'Monitoring::GLPlugin::SNMP::TableItem', undef, ['hwEntityCpuUsage', 'hwEntityCpuUsageThreshold']],
@@ -19,13 +19,12 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{name} = $self->{entPhysicalName};
}
sub check {
- my $self = shift;
- my $id = shift;
+ my ($self, $id) = @_;
$self->add_info(sprintf 'CPU %s usage is %s%%',
$self->{name}, $self->{hwEntityCpuUsage});
$self->set_thresholds(
diff --git a/plugins-scripts/Classes/Huawei/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Huawei/Component/EnvironmentalSubsystem.pm
index eb103a70..9e2dfdf6 100644
--- a/plugins-scripts/Classes/Huawei/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/Huawei/Component/EnvironmentalSubsystem.pm
@@ -3,19 +3,19 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('ENTITY-MIB', [
['modules', 'entPhysicalTable',
'Classes::Huawei::Component::EnvironmentalSubsystem::Module',
- sub { my $o = shift; $o->{entPhysicalClass} eq 'module' },
+ sub { my ($o) = @_; $o->{entPhysicalClass} eq 'module' },
['entPhysicalClass', 'entPhysicalDescr', 'entPhysicalName']],
['fans', 'entPhysicalTable',
'Classes::Huawei::Component::EnvironmentalSubsystem::Fan',
- sub { my $o = shift; $o->{entPhysicalClass} eq 'fan' },
+ sub { my ($o) = @_; $o->{entPhysicalClass} eq 'fan' },
['entPhysicalClass', 'entPhysicalDescr', 'entPhysicalName']],
['powersupplies', 'entPhysicalTable',
'Classes::Huawei::Component::EnvironmentalSubsystem::Powersupply',
- sub { my $o = shift; $o->{entPhysicalClass} eq 'powerSupply' },
+ sub { my ($o) = @_; $o->{entPhysicalClass} eq 'powerSupply' },
['entPhysicalClass', 'entPhysicalDescr', 'entPhysicalName']],
]);
$self->get_snmp_tables('HUAWEI-ENTITY-EXTENT-MIB', [
@@ -28,12 +28,20 @@ sub init {
]);
$self->merge_tables($_, "entitystates");
}
- $self->merge_tables_with_code("fans", "fanstates", sub {
- my $fan = shift;
- my $fanstate = shift;
- return ($fan->{entPhysicalName} eq sprintf("FAN %d/%d",
- $fanstate->{hwEntityFanSlot}, $fanstate->{hwEntityFanSn})) ? 1 : 0;
- });
+ if (@{$self->{fanstates}} && ! @{$self->{fans}}) {
+ # gibts auch, d.h. retten, was zu retten ist
+ foreach (@{$self->{fanstates}}) {
+ bless $_, "Classes::Huawei::Component::EnvironmentalSubsystem::Fan";
+ $_->{entPhysicalName} = $_->{flat_indices};
+ $_->finish();
+ }
+ } else {
+ $self->merge_tables_with_code("fans", "fanstates", sub {
+ my ($fan, $fanstate) = @_;
+ return ($fan->{entPhysicalName} eq sprintf("FAN %d/%d",
+ $fanstate->{hwEntityFanSlot}, $fanstate->{hwEntityFanSn})) ? 1 : 0;
+ });
+ }
}
@@ -41,8 +49,15 @@ package Classes::Huawei::Component::EnvironmentalSubsystem::Fan;
our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
+sub finish {
+ my ($self) = @_;
+ # kommt auch vor, dass die nicht existieren. Im Zweifelsfall "up"
+ $self->{hwEntityAdminStatus} ||= "up";
+ $self->{hwEntityOperStatus} ||= "up";
+}
+
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'fan %s is %s, state is %s, admin status is %s, oper status is %s',
$self->{entPhysicalName}, $self->{hwEntityFanPresent},
$self->{hwEntityFanState},
@@ -64,7 +79,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'powersupply %s has admin status is %s, oper status is %s',
$self->{entPhysicalName},
$self->{hwEntityAdminStatus}, $self->{hwEntityOperStatus});
@@ -79,13 +94,12 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{name} = $self->{entPhysicalName};
}
sub check {
- my $self = shift;
- #my $id = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'module %s admin status is %s, oper status is %s',
$self->{name}, $self->{hwEntityAdminStatus}, $self->{hwEntityOperStatus});
$self->add_info(sprintf 'module %s temperature is %.2f',
diff --git a/plugins-scripts/Classes/Huawei/Component/MemSubsystem.pm b/plugins-scripts/Classes/Huawei/Component/MemSubsystem.pm
index a40745f3..1fe92e18 100644
--- a/plugins-scripts/Classes/Huawei/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/Huawei/Component/MemSubsystem.pm
@@ -3,9 +3,9 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('ENTITY-MIB', [
- ['entities', 'entPhysicalTable', 'Classes::Huawei::Component::MemSubsystem::Mem', sub { my $o = shift; $o->{entPhysicalClass} eq 'module' }, ['entPhysicalClass', 'entPhysicalDescr', 'entPhysicalName']],
+ ['entities', 'entPhysicalTable', 'Classes::Huawei::Component::MemSubsystem::Mem', sub { my ($o) = @_; $o->{entPhysicalClass} eq 'module' }, ['entPhysicalClass', 'entPhysicalDescr', 'entPhysicalName']],
]);
$self->get_snmp_tables('HUAWEI-ENTITY-EXTENT-MIB', [
['entitystates', 'hwEntityStateTable', 'Monitoring::GLPlugin::SNMP::TableItem', undef, ['hwEntityMemUsage', 'hwEntityMemUsageThreshold', 'hwEntityMemSizeMega']],
@@ -19,15 +19,20 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{name} = $self->{entPhysicalName};
}
sub check {
- my $self = shift;
- my $id = shift;
- $self->add_info(sprintf 'Memory %s usage is %s%% (of %dMB)',
- $self->{name}, $self->{hwEntityMemUsage}, $self->{hwEntityMemSizeMega});
+ my ($self) = @_;
+ if ($self->{hwEntityMemSizeMega}) {
+ $self->add_info(sprintf 'Memory %s usage is %s%% (of %dMB)',
+ $self->{name}, $self->{hwEntityMemUsage},
+ $self->{hwEntityMemSizeMega});
+ } else {
+ $self->add_info(sprintf 'Memory %s usage is %s%%',
+ $self->{name}, $self->{hwEntityMemUsage});
+ }
$self->set_thresholds(
metric => 'cpu_'.$self->{name},
warning => $self->{hwEntityMemUsageThreshold},
diff --git a/plugins-scripts/Classes/IFMIB.pm b/plugins-scripts/Classes/IFMIB.pm
index 9fa0638a..892d798a 100644
--- a/plugins-scripts/Classes/IFMIB.pm
+++ b/plugins-scripts/Classes/IFMIB.pm
@@ -1,4 +1,4 @@
package Classes::IFMIB;
-our @ISA = qw(Classes::Device);
+our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
diff --git a/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm b/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm
index 6d6536f1..15020eb2 100644
--- a/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm
+++ b/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm
@@ -25,6 +25,9 @@ sub init {
ifHCInBroadcastPkts ifHCOutBroadcastPkts
ifHCInUcastPkts ifHCOutUcastPkts
));
+ # kostenpflichtiges feature # push(@ethertable_columns, qw(
+ # dot3StatsDuplexStatus
+ #));
} elsif ($self->mode =~ /device::interfaces::usage/) {
push(@iftable_columns, qw(
ifInOctets ifOutOctets ifSpeed ifOperStatus
@@ -113,6 +116,17 @@ sub init {
etherStatsDataSource
));
}
+ } elsif ($self->mode =~ /device::interfaces::duplex/) {
+ push(@iftable_columns, qw(
+ ifType ifSpeed ifOperStatus ifAdminStatus ifHighSpeed
+ ));
+ push(@ethertable_columns, qw(
+ dot3StatsDuplexStatus
+ ));
+ } elsif ($self->mode =~ /device::interfaces::uptime/) {
+ push(@iftable_columns, qw(
+ ifLastChange
+ ));
} else {
@iftable_columns = ();
}
@@ -154,7 +168,7 @@ sub init {
@indices = ();
$self->bulk_is_baeh(10);
}
- if (! $self->opts->name || scalar(@indices) > 0) {
+ if ((! $self->opts->name && ! $self->opts->name3) || scalar(@indices) > 0) {
my @save_indices = @indices; # die werden in get_snmp_table_objects geshiftet
foreach ($self->get_snmp_table_objects(
'IFMIB', 'ifTable+ifXTable', \@indices, \@iftable_columns)) {
@@ -167,7 +181,8 @@ sub init {
$interface->{columns} = [@iftable_columns];
push(@{$self->{interfaces}}, $interface);
}
- if ($self->mode =~ /device::interfaces::etherstats/) {
+ # kostenpflichtiges feature # if ($self->mode =~ /device::interfaces::(duplex|etherstats|complete)/) {
+ if ($self->mode =~ /device::interfaces::(duplex|etherstats)/) {
@indices = @save_indices;
my @etherindices = ();
my @etherhcindices = ();
@@ -212,13 +227,13 @@ sub init {
# es gibt interfaces mit ifSpeed == 4294967295
# aber nix in dot3HCStatsTable. also dann dot3StatsTable fuer alle
foreach my $etherstat ($self->get_snmp_table_objects(
- 'ETHERLIKE-MIB', 'dot3StatsTable', \@etherindices, \@ethertable_columns)) {
+ 'EtherLike-MIB', 'dot3StatsTable', \@etherindices, \@ethertable_columns)) {
foreach my $interface (@{$self->{interfaces}}) {
if ($interface->{ifIndex} == $etherstat->{flat_indices}) {
foreach my $key (grep /^dot3/, keys %{$etherstat}) {
$interface->{$key} = $etherstat->{$key};
+ push(@{$interface->{columns}}, $key);
}
- push(@{$interface->{columns}}, @ethertable_columns);
last;
}
}
@@ -226,13 +241,13 @@ sub init {
}
if (@ethertablehc_columns && scalar(@etherhcindices)) {
foreach my $etherstat ($self->get_snmp_table_objects(
- 'ETHERLIKE-MIB', 'dot3HCStatsTable', \@etherhcindices, \@ethertablehc_columns)) {
+ 'EtherLike-MIB', 'dot3HCStatsTable', \@etherhcindices, \@ethertablehc_columns)) {
foreach my $interface (@{$self->{interfaces}}) {
if ($interface->{ifIndex} == $etherstat->{flat_indices}) {
foreach my $key (grep /^dot3/, keys %{$etherstat}) {
$interface->{$key} = $etherstat->{$key};
+ push(@{$interface->{columns}}, $key);
}
- push(@{$interface->{columns}}, @ethertablehc_columns);
if (grep /^dot3HCStatsFCSErrors/, @{$interface->{columns}}) {
@{$interface->{columns}} = grep {
$_ if $_ ne 'dot3StatsFCSErrors';
@@ -257,8 +272,8 @@ sub init {
if ('1.3.6.1.2.1.2.2.1.1.'.$interface->{ifIndex} eq $etherstat->{etherStatsDataSource}) {
foreach my $key (grep /^etherStats/, keys %{$etherstat}) {
$interface->{$key} = $etherstat->{$key};
+ push(@{$interface->{columns}}, $key);
}
- push(@{$interface->{columns}}, @rmontable_columns);
last;
}
}
@@ -286,7 +301,7 @@ sub init {
$interface->init_etherstats;
}
if (scalar(@{$self->{interfaces}}) == 0) {
- $self->add_unknown('device probably has no RMON-MIB or ETHERLIKE-MIB');
+ $self->add_unknown('device probably has no RMON-MIB or EtherLike-MIB');
}
}
}
@@ -497,7 +512,7 @@ sub load_interface_cache {
require $statefile;
};
if($@) {
- printf "rumms\n";
+ printf "FATAL: Could not load cache!\n";
}
$self->debug(sprintf "load %s", Data::Dumper::Dumper($VAR1));
$self->{interface_cache} = $VAR1;
@@ -592,28 +607,34 @@ sub finish {
$self->{ifDescr} = $1;
}
}
- # Manche Stinkstiefel haben ifName, ifHighSpeed und z.b. ifInMulticastPkts,
- # aber keine ifHC*Octets. Gesehen bei Cisco Switch Interface Nul0 o.ae.
- if ($self->{ifName} && defined $self->{ifHCInOctets} &&
- defined $self->{ifHCOutOctets} && $self->{ifHCInOctets} ne "noSuchObject") {
- $self->{ifAlias} ||= $self->{ifName};
- $self->{ifName} = unpack("Z*", $self->{ifName});
- $self->{ifAlias} = unpack("Z*", $self->{ifAlias});
- $self->{ifAlias} =~ s/\|/!/g if $self->{ifAlias};
- bless $self, 'Classes::IFMIB::Component::InterfaceSubsystem::Interface::64bit';
- }
- if ((! exists $self->{ifInOctets} && ! exists $self->{ifOutOctets} &&
- $self->mode =~ /device::interfaces::(usage|complete)/) ||
- (! exists $self->{ifInErrors} && ! exists $self->{ifOutErrors} &&
- $self->mode =~ /device::interfaces::(errors|complete)/) ||
- (! exists $self->{ifInDiscards} && ! exists $self->{ifOutDiscards} &&
- $self->mode =~ /device::interfaces::(discards|complete)/) ||
- (! exists $self->{ifInUcastPkts} && ! exists $self->{ifOutUcastPkts} &&
- $self->mode =~ /device::interfaces::(broadcast|complete)/)) {
- bless $self, 'Classes::IFMIB::Component::InterfaceSubsystem::Interface::StackSub';
- }
- if ($self->{ifPhysAddress}) {
- $self->{ifPhysAddress} = join(':', unpack('(H2)*', $self->{ifPhysAddress}));
+ if ($self->mode =~ /device::interfaces::duplex/) {
+ } elsif ($self->mode =~ /device::interfaces::uptime/) {
+ $self->{sysUptime} = $self->get_snmp_object('MIB-2-MIB', 'sysUpTime', 0) / 100;
+ $self->{sysUptime64} = $self->uptime();
+ } else {
+ # Manche Stinkstiefel haben ifName, ifHighSpeed und z.b. ifInMulticastPkts,
+ # aber keine ifHC*Octets. Gesehen bei Cisco Switch Interface Nul0 o.ae.
+ if ($self->{ifName} && defined $self->{ifHCInOctets} &&
+ defined $self->{ifHCOutOctets} && $self->{ifHCInOctets} ne "noSuchObject") {
+ $self->{ifAlias} ||= $self->{ifName};
+ $self->{ifName} = unpack("Z*", $self->{ifName});
+ $self->{ifAlias} = unpack("Z*", $self->{ifAlias});
+ $self->{ifAlias} =~ s/\|/!/g if $self->{ifAlias};
+ bless $self, 'Classes::IFMIB::Component::InterfaceSubsystem::Interface::64bit';
+ }
+ if ((! exists $self->{ifInOctets} && ! exists $self->{ifOutOctets} &&
+ $self->mode =~ /device::interfaces::(usage|complete)/) ||
+ (! exists $self->{ifInErrors} && ! exists $self->{ifOutErrors} &&
+ $self->mode =~ /device::interfaces::(errors|complete)/) ||
+ (! exists $self->{ifInDiscards} && ! exists $self->{ifOutDiscards} &&
+ $self->mode =~ /device::interfaces::(discards|complete)/) ||
+ (! exists $self->{ifInUcastPkts} && ! exists $self->{ifOutUcastPkts} &&
+ $self->mode =~ /device::interfaces::(broadcast|complete)/)) {
+ bless $self, 'Classes::IFMIB::Component::InterfaceSubsystem::Interface::StackSub';
+ }
+ if ($self->{ifPhysAddress}) {
+ $self->{ifPhysAddress} = join(':', unpack('(H2)*', $self->{ifPhysAddress}));
+ }
}
$self->init();
}
@@ -738,6 +759,18 @@ sub init {
$self->{ifSpeedText} = sprintf "%.2fB", $speed;
}
$self->{ifSpeedText} =~ s/\.00//g;
+ } elsif ($self->mode =~ /device::interfaces::uptime/) {
+ $self->{ifLastChangeRaw} = $self->{ifLastChange} / 100;
+ # recalc ticks
+ $self->{ifLastChange} = time - $self->uptime() + $self->{ifLastChange} / 100;
+ $self->{ifLastChangeHuman} = scalar localtime $self->{ifLastChange};
+ $self->{ifDuration} = time - $self->{ifLastChange};
+ $self->{ifDurationMinutes} = $self->{ifDuration} / 60; # minutes
+ # wenn sysUptime ueberlaeuft, dann wird's schwammig. Denn dann kann
+ # ich nicht sagen, ob ein ifLastChange ganz am Anfang passiert ist,
+ # unmittelbar nach dem Booten, oder grad eben vor drei Minuten, als
+ # der Ueberlauf stattfand. Ergo ist dieser Mode nach einer Uptime von
+ # 497 Tagen nicht mehr brauchbar.
}
return $self;
}
@@ -768,6 +801,20 @@ sub init_etherstats {
100 * $self->{'delta_'.$stat} /
($self->{delta_InPkts} + $self->{delta_OutPkts}) : 0;
}
+ } elsif ($self->mode =~ /device::interfaces::duplex/) {
+ if (defined $self->{dot3StatsDuplexStatus}) {
+ } elsif (! defined $self->{dot3StatsDuplexStatus} && $self->{ifType} !~ /ether/i) {
+ $self->{dot3StatsDuplexStatus} = "notApplicable";
+ } elsif (! defined $self->{dot3StatsDuplexStatus} && $self->implements_mib('EtherLike-MIB')) {
+ if (defined $self->opts->mitigation() &&
+ $self->opts->mitigation() eq 'ok') {
+ $self->{dot3StatsDuplexStatus} = "fullDuplex";
+ } else {
+ $self->{dot3StatsDuplexStatus} = "unknown";
+ }
+ } else {
+ $self->{dot3StatsDuplexStatus} = "unknown";
+ }
}
return $self;
}
@@ -783,6 +830,7 @@ sub check {
$Monitoring::GLPlugin::mode = "device::interfaces::operstatus";
$self->check();
if ($self->{ifOperStatus} eq "up") {
+ # kostenpflichtiges feature # device::interfaces::duplex
foreach my $mode (qw(device::interfaces::usage
device::interfaces::errors device::interfaces::discards
device::interfaces::broadcast)) {
@@ -926,38 +974,44 @@ sub check {
value => $self->{outputDiscardRate},
);
} elsif ($self->mode =~ /device::interfaces::broadcast/) {
- $self->add_info(sprintf 'interface %s broadcast in:%.2f%% out:%.2f%% ',
+ $self->add_info(sprintf 'interface %s broadcast in:%.2f out:%.2f ',
$full_descr,
- $self->{broadcastInPercent} , $self->{broadcastOutPercent});
+ $self->{broadcastInPercent} / 100 * $self->{inputRate} , $self->{broadcastOutPercent} / 100 * $self->{outputRate} );
$self->set_thresholds(
metric => $self->{ifDescr}.'_broadcast_in',
- warning => 10,
- critical => 20
+ warning => $self->{maxInputRate} / 100 * 10,
+ critical => $self->{maxInputRate} / 100 * 20,
);
my $in = $self->check_thresholds(
metric => $self->{ifDescr}.'_broadcast_in',
- value => $self->{broadcastInPercent}
+ value => $self->{broadcastInPercent} / 100 * $self->{inputRate},
);
$self->set_thresholds(
metric => $self->{ifDescr}.'_broadcast_out',
- warning => 10,
- critical => 20
+ warning => $self->{maxOutputRate} / 100 * 10,
+ critical => $self->{maxOutputRate} / 100 * 20,
);
my $out = $self->check_thresholds(
metric => $self->{ifDescr}.'_broadcast_out',
- value => $self->{broadcastOutPercent}
+ value => $self->{broadcastOutPercent} / 100 * $self->{outputRate},
);
my $level = ($in > $out) ? $in : ($out > $in) ? $out : $in;
$self->add_message($level);
$self->add_perfdata(
label => $self->{ifDescr}.'_broadcast_in',
- value => $self->{broadcastInPercent},
- uom => '%',
+ value => $self->{broadcastInPercent} / 100 * $self->{inputRate},
+ uom => $self->opts->units =~ /^(B|KB|MB|GB|TB)$/ ? $self->opts->units : undef,
+ places => 2,
+ min => 0,
+ max => $self->{maxInputRate},
);
$self->add_perfdata(
label => $self->{ifDescr}.'_broadcast_out',
- value => $self->{broadcastOutPercent},
- uom => '%',
+ value => $self->{broadcastOutPercent} / 100 * $self->{outputRate},
+ uom => $self->opts->units =~ /^(B|KB|MB|GB|TB)$/ ? $self->opts->units : undef,
+ places => 2,
+ min => 0,
+ max => $self->{maxOutputRate},
);
} elsif ($self->mode =~ /device::interfaces::operstatus/) {
#rfc2863
@@ -1023,6 +1077,37 @@ sub check {
uom => '%',
);
}
+ } elsif ($self->mode =~ /device::interfaces::duplex/) {
+ $self->add_info(sprintf "%s duplex status is %s",
+ $self->{ifDescr}, $self->{dot3StatsDuplexStatus}
+ );
+ if ($self->{ifOperStatus} ne "up") {
+ $self->annotate_info(sprintf "oper %s", $self->{ifOperStatus});
+ $self->add_ok();
+ } elsif ($self->{dot3StatsDuplexStatus} eq "notApplicable") {
+ $self->add_ok();
+ } else {
+ if ($self->{dot3StatsDuplexStatus} eq "unknown") {
+ $self->add_unknown();
+ } elsif ($self->{dot3StatsDuplexStatus} eq "fullDuplex") {
+ $self->add_ok();
+ } else {
+ # kein critical, weil so irgendwie funktionierts ja
+ $self->add_warning();
+ }
+ }
+ } elsif ($self->mode =~ /device::interfaces::uptime/) {
+ $self->add_info(sprintf "%s was changed %s ago",
+ $full_descr, $self->human_timeticks($self->{ifDuration}));
+ $self->set_thresholds(metric => $self->{ifDescr}."_duration",
+ warning => "15:", critical => "5:");
+ $self->add_message($self->check_thresholds(
+ metric => $self->{ifDescr}."_duration",
+ value => $self->{ifDurationMinutes}));
+ $self->add_perfdata(
+ label => $self->{ifDescr}."_duration",
+ value => $self->{ifDurationMinutes},
+ );
}
}
@@ -1174,6 +1259,8 @@ sub check {
" (alias ".$self->{ifAlias}.")" : "";
if ($self->mode =~ /device::interfaces::operstatus/) {
$self->SUPER::check();
+ } elsif ($self->mode =~ /device::interfaces::duplex/) {
+ $self->SUPER::check();
} else {
$self->add_ok(sprintf '%s has no traffic', $full_descr);
}
diff --git a/plugins-scripts/Classes/IFMIB/Component/LinkAggregation.pm b/plugins-scripts/Classes/IFMIB/Component/LinkAggregation.pm
index 6aa15790..a760f436 100644
--- a/plugins-scripts/Classes/IFMIB/Component/LinkAggregation.pm
+++ b/plugins-scripts/Classes/IFMIB/Component/LinkAggregation.pm
@@ -3,16 +3,8 @@ our @ISA = qw(Classes::IFMIB);
use strict;
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
-sub new {
- my $class = shift;
- my $self = {};
- bless $self, $class;
- $self->init();
- return $self;
-}
-
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->opts->name) {
my @ifs = split(",", $self->opts->name);
$self->{name} = shift @ifs;
@@ -39,7 +31,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking link aggregation');
if (scalar(@{$self->{components}->{interface_subsystem}->{interfaces}}) == 0) {
$self->add_unknown('no interfaces');
diff --git a/plugins-scripts/Classes/IFMIB/Component/StackSubsystem.pm b/plugins-scripts/Classes/IFMIB/Component/StackSubsystem.pm
index aee86477..b617f9e5 100644
--- a/plugins-scripts/Classes/IFMIB/Component/StackSubsystem.pm
+++ b/plugins-scripts/Classes/IFMIB/Component/StackSubsystem.pm
@@ -7,192 +7,226 @@ sub init {
my ($self) = @_;
my @iftable_columns = qw(ifDescr ifAlias ifOperStatus ifAdminStatus);
$self->update_interface_cache(0);
- my @higher_indices = $self->get_interface_indices();
+ my @selected_indices = $self->get_interface_indices();
if (! $self->opts->name) {
# get_table erzwingen
- @higher_indices = ();
+ @selected_indices = ();
+ } elsif (scalar(@selected_indices)) {
+ @selected_indices = map { $_->[0] } @selected_indices;
+ } else {
+ @selected_indices = ();
}
$self->get_snmp_tables("IFMIB", [
['stacks', 'ifStackTable', 'Classes::IFMIB::Component::StackSubsystem::Relationship'],
]);
+ my @higher_indices = ();
my @lower_indices = ();
foreach my $rel (@{$self->{stacks}}) {
- if ($self->opts->name) {
- if (grep { $rel->{ifStackHigherLayer} == $_ } map { $_->[0]; } @higher_indices) {
- push(@lower_indices, [$rel->{ifStackLowerLayer}]);
+ if (@selected_indices) {
+ if (defined $rel->{ifStackLowerLayer} && grep { $rel->{ifStackHigherLayer} == $_ } @selected_indices) {
+ #push(@higher_indices, $rel->{ifStackHigherLayer}) if $rel->{ifStackLowerLayer};
+ push(@higher_indices, $rel->{ifStackHigherLayer});
+ push(@lower_indices, $rel->{ifStackLowerLayer});
}
} else {
- if ($rel->{ifStackLowerLayer} && $rel->{ifStackHigherLayer}) {
- push(@higher_indices, [$rel->{ifStackHigherLayer}]);
- push(@lower_indices, [$rel->{ifStackLowerLayer}]);
+ if (defined $rel->{ifStackLowerLayer} && $rel->{ifStackHigherLayer}) {
+ push(@higher_indices, $rel->{ifStackHigherLayer}) if $rel->{ifStackLowerLayer};
+ push(@lower_indices, $rel->{ifStackLowerLayer});
}
}
}
- @higher_indices = map { [$_] } keys %{{map {($_->[0] => 1)} @higher_indices}};
- @lower_indices = grep { $_->[0] != 0 } map { [$_] } keys %{{map {($_->[0] => 1)} @lower_indices}};
- my @indices = map { [$_] } keys %{{map {($_->[0] => 1)} (@higher_indices, @lower_indices)}};
- my $higher_interfaces = {};
- my $lower_interfaces = {};
- $self->{interfaces} = [];
+ @higher_indices = grep { $_ != 0 } keys %{{map {($_ => 1)} @higher_indices}};
+ if (! @{$self->{stacks}} && @selected_indices) {
+ # those which don't have a ifStackTable at all
+ @higher_indices = @selected_indices;
+ }
+ @lower_indices = grep { $_ != 0 } keys %{{map {($_ => 1)} @lower_indices}};
+ my @indices = map { [$_] } keys %{{map {($_ => 1)} (@higher_indices, @lower_indices, @selected_indices)}};
+ $self->{interface_hash} = {};
if (! $self->opts->name || scalar(@higher_indices) > 0) {
- my $indices = {};
foreach ($self->get_snmp_table_objects(
- 'IFMIB', 'ifTable+ifXTable', \@indices, \@iftable_columns)) {
+ 'IFMIB', 'ifTable+ifXTable', @selected_indices ? \@indices : [], \@iftable_columns)) {
my $interface = Classes::IFMIB::Component::InterfaceSubsystem::Interface->new(%{$_});
- $higher_interfaces->{$interface->{ifIndex}} = $interface if grep { $interface->{ifIndex} == $_->[0] } @higher_indices;
- $lower_interfaces->{$interface->{ifIndex}} = $interface if grep { $interface->{ifIndex} == $_->[0] } @lower_indices;
- push(@{$self->{interfaces}}, $interface);
+ $self->{interface_hash}->{$interface->{ifIndex}} = $interface;
+ if (@selected_indices && grep { $interface->{ifIndex} == $_ } @selected_indices) {
+ $interface->{lower_interfaces} = [];
+ $interface->{stack_status} = [];
+ } elsif (grep { $interface->{ifIndex} == $_ } @higher_indices) {
+ $interface->{lower_interfaces} = [];
+ $interface->{stack_status} = [];
+ }
+ }
+ }
+ #$self->arista_schlamperei();
+ $self->link_stack_to_interfaces(@higher_indices);
+}
+
+sub link_stack_to_interfaces {
+ my ($self, @higher_indices) = @_;
+ $self->{interfaces} = [];
+ foreach my $rel (@{$self->{stacks}}) {
+ if ($rel->{ifStackHigherLayer} != 0 && grep { $rel->{ifStackHigherLayer} == $_ } @higher_indices) {
+ if ($rel->{ifStackLowerLayer} == 0) {
+ # sowas hier.
+ # IF-MIB::ifStackStatus.0.1000004 = INTEGER: active(1)
+ # IF-MIB::ifStackStatus.1000004.0 = INTEGER: active(1)
+ # IF-MIB::ifStackStatus.1000004.50 = INTEGER: active(1)
+ # Arista macht sowas gelegentlich. Der mittlere, falsche Eintrag wird einfach ignoriert.
+ # und noch so eine Besonderheit von Arista.
+ # Die IF-MIB::ifStackStatus.1000004.[>0] verschwinden einfach, wenn die lower
+ # Interfaces wegbrechen. Die Upper-Lower-Zuordnung ist dann nur noch
+ # in der Konsole sichtbar.
+ $self->{interface_hash}->{$rel->{ifStackHigherLayer}}->{ifStackStatus} = $rel->{ifStackStatus};
+ } elsif (exists $self->{interface_hash}->{$rel->{ifStackHigherLayer}}) {
+ push(@{$self->{interface_hash}->{$rel->{ifStackHigherLayer}}->{lower_interfaces}},
+ $self->{interface_hash}->{$rel->{ifStackLowerLayer}});
+ push(@{$self->{interface_hash}->{$rel->{ifStackHigherLayer}}->{stack_status}},
+ $rel->{ifStackStatus});
+ }
}
}
- $self->{higher_interfaces} = $higher_interfaces;
- $self->{lower_interfaces} = $lower_interfaces;
- $self->arista_schlamperei();
+ @{$self->{interfaces}} = sort {
+ $a->{ifIndex} <=> $b->{ifIndex}
+ } values %{$self->{interface_hash}};
}
sub arista_schlamperei {
my ($self) = @_;
- # sowas hier.
- # IF-MIB::ifStackStatus.0.1000004 = INTEGER: active(1)
- # IF-MIB::ifStackStatus.1000004.0 = INTEGER: active(1)
- # IF-MIB::ifStackStatus.1000004.50 = INTEGER: active(1)
- my @liars = map {
+ my @have_lower = map {
$_->{ifStackHigherLayer}
} grep {
exists $self->{higher_interfaces}->{$_->{ifStackHigherLayer}}
} grep {
- $_->{ifStackLowerLayer} == 0
+ $_->{ifStackLowerLayer} != 0
} @{$self->{stacks}};
@{$self->{stacks}} = grep {
my $ref = $_;
- ! ($ref->{ifStackLowerLayer} == 0 && grep /^$ref->{ifStackHigherLayer}$/, @liars)
+ ! ($ref->{ifStackLowerLayer} == 0 && grep /^$ref->{ifStackHigherLayer}$/, @have_lower)
} @{$self->{stacks}};
}
sub check {
my ($self) = @_;
- my $higher_interfaces = $self->{higher_interfaces};
- my $lower_interfaces = $self->{lower_interfaces};
- my $lower_needed = {};
- my $lower_counter = {};
- if (! scalar keys %{$higher_interfaces}) {
- $self->add_ok("no portchannels found");
- } elsif (! scalar (@{$self->{stacks}})) {
+ my @selected_interfaces = sort {
+ $a->{ifIndex} <=> $b->{ifIndex}
+ } grep {
+ exists $_->{lower_interfaces}
+ } @{$self->{interfaces}};
+ if (! scalar (@{$self->{stacks}}) && ! scalar(@selected_interfaces)) {
$self->add_ok("no portchannels found, ifStackTable is empty or unreadable");
+ } elsif (! scalar(@selected_interfaces)) {
+ $self->add_ok("no portchannels found");
} else {
- foreach my $rel (@{$self->{stacks}}) {
- next if ! exists $higher_interfaces->{$rel->{ifStackHigherLayer}};
- $lower_counter->{$rel->{ifStackHigherLayer}} = 0
- if ! exists $lower_counter->{$rel->{ifStackHigherLayer}};
- $lower_needed->{$rel->{ifStackHigherLayer}} = 0
- if ! exists $lower_needed->{$rel->{ifStackHigherLayer}};
- if ($rel->{ifStackLowerLayer} == 0 && $higher_interfaces->{$rel->{ifStackHigherLayer}}->{ifAdminStatus} eq 'down') {
- if ($self->mode =~ /device::interfaces::ifstack::status/) {
- $self->add_ok(sprintf '%s (%s) is admin down',
- $higher_interfaces->{$rel->{ifStackHigherLayer}}->{ifDescr},
- $higher_interfaces->{$rel->{ifStackHigherLayer}}->{ifAlias},
- );
- }
- } elsif ($rel->{ifStackLowerLayer} == 0 && $higher_interfaces->{$rel->{ifStackHigherLayer}}->{ifOperStatus} eq 'lowerLayerDown' && defined $self->opts->mitigation()) {
- if ($self->mode =~ /device::interfaces::ifstack::status/) {
- # Port-channel members are supposed to be down, for example
- # in a firewall cluster setup.
- # So this _could_ be a desired state. In order to allow this
- # state, it must be mitigated.
- $self->add_ok(sprintf '%s (%s) has stack status %s but upper interface has lowerLayerDown and no sublayer interfaces', $higher_interfaces->{$rel->{ifStackHigherLayer}}->{ifDescr},
- $higher_interfaces->{$rel->{ifStackHigherLayer}}->{ifAlias},
- $rel->{ifStackStatus});
- }
- } elsif ($rel->{ifStackLowerLayer} == 0 && $rel->{ifStackStatus} ne 'notInService') {
- if ($self->mode =~ /device::interfaces::ifstack::status/) {
- $self->add_warning(sprintf '%s (%s) has stack status %s but no sub-layer interfaces', $higher_interfaces->{$rel->{ifStackHigherLayer}}->{ifDescr},
- $higher_interfaces->{$rel->{ifStackHigherLayer}}->{ifAlias},
- $rel->{ifStackStatus});
- }
- } elsif ($rel->{ifStackStatus} ne 'notInService' &&
- $lower_interfaces->{$rel->{ifStackLowerLayer}}->{ifOperStatus} ne 'up' &&
- $lower_interfaces->{$rel->{ifStackLowerLayer}}->{ifAdminStatus} ne 'down') {
- if ($self->mode =~ /device::interfaces::ifstack::status/) {
- $self->add_critical(sprintf '%s (%s) has a sub-layer interface %s with status %s',
- $higher_interfaces->{$rel->{ifStackHigherLayer}}->{ifDescr},
- $higher_interfaces->{$rel->{ifStackHigherLayer}}->{ifAlias},
- $lower_interfaces->{$rel->{ifStackLowerLayer}}->{ifDescr},
- $lower_interfaces->{$rel->{ifStackLowerLayer}}->{ifOperStatus});
- }
- $lower_needed->{$rel->{ifStackHigherLayer}}++;
- } elsif ($rel->{ifStackStatus} ne 'notInService' &&
- $higher_interfaces->{$rel->{ifStackHigherLayer}}->{ifOperStatus} eq 'lowerLayerDown') {
- if ($self->mode =~ /device::interfaces::ifstack::status/) {
- $self->add_critical(sprintf '%s (%s) has status %s',
- $higher_interfaces->{$rel->{ifStackHigherLayer}}->{ifDescr},
- $higher_interfaces->{$rel->{ifStackHigherLayer}}->{ifAlias},
- $higher_interfaces->{$rel->{ifStackHigherLayer}}->{ifOperStatus});
+ foreach my $interface (@selected_interfaces) {
+ # Liste der Sublayer Interfaces ist ggf. auch leer
+ $interface->{lower_interfaces_ok} = [];
+ $interface->{lower_interfaces_fail} = [];
+ my $index = 0;
+ foreach my $lower (@{$interface->{lower_interfaces}}) {
+ if ($lower->{ifOperStatus} ne 'up' && $lower->{ifAdminStatus} ne 'down' &&
+ $interface->{stack_status}->[$index] ne 'notInService') {
+ push(@{$interface->{lower_interfaces_fail}}, $lower);
+ } else {
+ push(@{$interface->{lower_interfaces_ok}}, $lower);
}
- $lower_counter->{$rel->{ifStackHigherLayer}}++;
- $lower_needed->{$rel->{ifStackHigherLayer}}++;
- } else {
- $lower_counter->{$rel->{ifStackHigherLayer}}++;
- $lower_needed->{$rel->{ifStackHigherLayer}}++;
+ $index++;
}
- }
- foreach my $interface (@{$self->{interfaces}}) {
- # gibt diese:
- # IF-MIB::ifStackStatus.0.1000201 = INTEGER: active(1)
- # IF-MIB::ifStackStatus.1000201.3 = INTEGER: active(1)
- # und diese
- # IF-MIB::ifStackStatus.0.1000501 = INTEGER: active(1)
- # der braeuchte eigentlich ein
- # IF-MIB::ifStackStatus.1000501.0 = INTEGER: active(1)
- # hat er aber nicht. deshalb waere $lower_counter/lower_needed
- # uninitialized, wenn nicht wieder mal der Lausser den
- # Drecksmurkssnmpimplementierungen hinterherraeumen wuerde.
- if (! exists $lower_counter->{$interface->{ifIndex}}) {
- $lower_counter->{$interface->{ifIndex}} = 0;
- }
- if (! exists $lower_needed->{$interface->{ifIndex}}) {
- $lower_needed->{$interface->{ifIndex}} = 0;
- }
- # und gleich nochmal.
- # IF-MIB::ifStackStatus.0.1000027 = INTEGER: active(1)
- # IF-MIB::ifStackStatus.1000027.0 = INTEGER: active(1)
- # IF-MIB::ifStackStatus.0.1000051 = INTEGER: active(1)
- # IF-MIB::ifStackStatus.1000051.35 = INTEGER: active(1)
- # IF-MIB::ifStackStatus.0.1000052 = INTEGER: active(1)
- # Schammts eich, Cisco. Pfui Deifl!
- }
- foreach my $index (keys %{$higher_interfaces}) {
if ($self->mode =~ /device::interfaces::ifstack::status/) {
- $self->add_ok(sprintf 'interface %s has %d sub-layers',
- $higher_interfaces->{$index}->{ifDescr},
- $lower_counter->{$index});
+ if (! scalar (@{$interface->{lower_interfaces}})) {
+ if ($interface->{ifAdminStatus} eq 'down') {
+ $self->add_ok(sprintf '%s (%s) is admin down',
+ $interface->{ifDescr},
+ $interface->{ifAlias},
+ );
+ } elsif ($interface->{ifOperStatus} eq 'lowerLayerDown') {
+ # Port-channel members are supposed to be down, for example
+ # in a firewall cluster setup.
+ # So this _could_ be a desired state. In order to allow this
+ # state, it must be mitigated.
+ $self->add_critical_mitigation(sprintf '%s%s has status lowerLayerDown and no sublayer interfaces',
+ $interface->{ifDescr},
+ $interface->{ifAlias} ? " (".$interface->{ifAlias}.")" : "",
+ );
+ } elsif (! $interface->{ifStackStatus} && $interface->{ifOperStatus} ne "up") {
+ # there is no ifStackTable, ifOperStatus is the only info
+ $self->add_warning(sprintf '%s%s has no stack status and no sub-layer interfaces. Oper status is %s',
+ $interface->{ifDescr},
+ $interface->{ifAlias} ? " (".$interface->{ifAlias}.")" : "",
+ $interface->{ifOperStatus},
+ );
+ } elsif ($interface->{ifStackStatus} && $interface->{ifStackStatus} ne 'notInService') {
+ $self->add_warning(sprintf '%s%s has stack status %s but no sub-layer interfaces. Oper status is %s',
+ $interface->{ifDescr},
+ $interface->{ifAlias} ? " (".$interface->{ifAlias}.")" : "",
+ $interface->{ifStackStatus},
+ $interface->{ifOperStatus},
+ );
+ } else {
+ $self->add_ok(sprintf '%s%s oper status is %s',
+ $interface->{ifDescr},
+ $interface->{ifAlias} ? " (".$interface->{ifAlias}.")" : "",
+ $interface->{ifOperStatus},
+ );
+ }
+ } else {
+ if (scalar(@{$interface->{lower_interfaces_fail}})) {
+ foreach my $lower (@{$interface->{lower_interfaces_fail}}) {
+ $self->add_critical(sprintf '%s%s has a sub-layer interface %s with status %s',
+ $interface->{ifDescr},
+ $interface->{ifAlias} ? " (".$interface->{ifAlias}.")" : "",
+ $lower->{ifDescr},
+ $lower->{ifOperStatus},
+ );
+ }
+ } elsif ($interface->{ifOperStatus} eq 'lowerLayerDown') {
+ # maybe something like what happens with Arista. Sub-Interface is configured
+ # but as soon as it is broken, it disappears fromthe ifStackTable
+ $self->add_critical_mitigation(sprintf '%s%s has status lowerLayerDown',
+ $interface->{ifDescr},
+ $interface->{ifAlias} ? " (".$interface->{ifAlias}.")" : "",
+ );
+ } else {
+ $self->add_ok(sprintf 'interface %s%s has %d sub-layers',
+ $interface->{ifDescr},
+ $interface->{ifAlias} ? " (".$interface->{ifAlias}.")" : "",
+ scalar(@{$interface->{lower_interfaces_ok}})
+ );
+ }
+ }
} elsif ($self->mode =~ /device::interfaces::ifstack::availability/) {
- my $availability = $lower_needed->{$index} ?
- (100 * $lower_counter->{$index} / $lower_needed->{$index}) : 0;
+ my $lower_interfaces_ok = scalar(@{$interface->{lower_interfaces_ok}});
+ my $lower_interfaces_all = scalar(@{$interface->{lower_interfaces_fail}}) + $lower_interfaces_ok;
+ my $availability = $lower_interfaces_all ?
+ (100 * $lower_interfaces_ok / $lower_interfaces_all) : 0;
my $cavailability = $availability == int($availability) ?
$availability + 1: int($availability + 1.0);
$self->add_info(sprintf '%s has %d of %d running sub-layer interfaces, availability is %.2f%%',
- $higher_interfaces->{$index}->{ifDescr},
- $lower_counter->{$index},
- $lower_needed->{$index},
+ $interface->{ifDescr},
+ $lower_interfaces_ok,
+ $lower_interfaces_all,
$availability);
$self->set_thresholds(
- metric => 'aggr_'.$higher_interfaces->{$index}->{ifDescr}.'_availability',
+ metric => 'aggr_'.$interface->{ifDescr}.'_availability',
warning => '100:',
critical => $cavailability.':'
);
$self->add_message($self->check_thresholds(
- metric => 'aggr_'.$higher_interfaces->{$index}->{ifDescr}.'_availability',
+ metric => 'aggr_'.$interface->{ifDescr}.'_availability',
value => $availability,
));
$self->add_perfdata(
- label => 'aggr_'.$higher_interfaces->{$index}->{ifDescr}.'_availability',
+ label => 'aggr_'.$interface->{ifDescr}.'_availability',
value => $availability,
uom => '%',
);
}
}
+ my $num_portchannels = scalar(grep {
+ exists $_->{lower_interfaces}
+ } @{$self->{interfaces}});
$self->reduce_messages_short(sprintf '%d portchannel%s working fine',
- scalar(keys %{$higher_interfaces}),
- scalar(keys %{$higher_interfaces}) ? 's' : '',
+ $num_portchannels,
+ $num_portchannels > 1 ? 's' : '',
);
}
}
diff --git a/plugins-scripts/Classes/IPFORWARDMIB/Component/RoutingSubsystem.pm b/plugins-scripts/Classes/IPFORWARDMIB/Component/RoutingSubsystem.pm
index 0666817f..339b2701 100644
--- a/plugins-scripts/Classes/IPFORWARDMIB/Component/RoutingSubsystem.pm
+++ b/plugins-scripts/Classes/IPFORWARDMIB/Component/RoutingSubsystem.pm
@@ -1,7 +1,7 @@
package Classes::IPFORWARDMIB::Component::RoutingSubsystem;
our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
-
+# plugins-scripts/check_nwc_health --mode list-routes --snmpwalk walks/simon.snmpwalk
# ipRouteTable 1.3.6.1.2.1.4.21
# replaced by
# ipForwardTable 1.3.6.1.2.1.4.24.2
@@ -11,7 +11,7 @@ use strict;
# inetCidrRouteTable 1.3.6.1.2.1.4.24.7
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{interfaces} = [];
$self->get_snmp_tables('IP-FORWARD-MIB', [
['routes', 'inetCidrRouteTable', 'Classes::IPFORWARDMIB::Component::RoutingSubsystem::inetCidrRoute' ],
@@ -20,7 +20,7 @@ sub init {
$self->get_snmp_tables('IP-FORWARD-MIB', [
['routes', 'ipCidrRouteTable', 'Classes::IPFORWARDMIB::Component::RoutingSubsystem::ipCidrRoute',
sub {
- my $o = shift;
+ my ($o) = @_;
if ($o->opts->name && $o->opts->name =~ /\//) {
my ($dest, $cidr) = split(/\//, $o->opts->name);
my $bits = ( 2 ** (32 - $cidr) ) - 1;
@@ -51,7 +51,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking routes');
if ($self->mode =~ /device::routes::list/) {
foreach (@{$self->{routes}}) {
@@ -92,7 +92,7 @@ package Classes::IPFORWARDMIB::Component::RoutingSubsystem::ipCidrRoute;
our @ISA = qw(Classes::IPFORWARDMIB::Component::RoutingSubsystem::Route);
sub finish {
- my $self = shift;
+ my ($self) = @_;
if (! defined $self->{ipCidrRouteDest}) {
# we can reconstruct a few attributes from the index
# one customer only made ipCidrRouteStatus visible
@@ -106,7 +106,7 @@ sub finish {
}
sub list {
- my $self = shift;
+ my ($self) = @_;
printf "%16s %16s %16s %11s %7s\n",
$self->{ipCidrRouteDest}, $self->{ipCidrRouteMask},
$self->{ipCidrRouteNextHop}, $self->{ipCidrRouteProto},
@@ -117,15 +117,20 @@ package Classes::IPFORWARDMIB::Component::RoutingSubsystem::inetCidrRoute;
our @ISA = qw(Classes::IPFORWARDMIB::Component::RoutingSubsystem::Route);
sub finish {
- my $self = shift;
+ my ($self) = @_;
# http://www.mibdepot.com/cgi-bin/vendor_index.cgi?r=ietf_rfcs
# INDEX { inetCidrRouteDestType, inetCidrRouteDest, inetCidrRoutePfxLen, inetCidrRoutePolicy, inetCidrRouteNextHopType, inetCidrRouteNextHop }
+ $self->{i_inetCidrRouteDestType} = $self->{indices}->[0];
+ $self->{i_inetCidrRouteDest} = $self->{indices}->[1];
+ $self->{i_inetCidrRoutePfxLen} = $self->{indices}->[2];
+ $self->{i_inetCidrRoutePolicy} = $self->{indices}->[3];
+ $self->{i_inetCidrRouteNextHopType} = $self->{indices}->[4];
+ $self->{i_inetCidrRouteNextHop} = $self->{indices}->[5];
$self->{inetCidrRouteDestType} = $self->mibs_and_oids_definition(
- 'RFC4001-MIB', 'inetAddressType', $self->{indices}->[0]);
+ 'INET-ADDRESS-MIB', 'InetAddressType', $self->{indices}->[0]);
if ($self->{inetCidrRouteDestType} eq "ipv4") {
$self->{inetCidrRouteDest} = $self->mibs_and_oids_definition(
- 'RFC4001-MIB', 'inetAddress', $self->{indices}->[1],
- $self->{indices}->[2], $self->{indices}->[3], $self->{indices}->[4]);
+ 'INET-ADDRESS-MIB', 'InetAddress', @{$self->{indices}});
} elsif ($self->{inetCidrRouteDestType} eq "ipv4") {
$self->{inetCidrRoutePfxLen} = $self->mibs_and_oids_definition(
'RFC4001-MIB', 'inetAddress', $self->{indices}->[1],
@@ -134,3 +139,10 @@ sub finish {
}
}
+sub list {
+ my ($self) = @_;
+ printf "%16s %16s %16s %11s %7s\n",
+ $self->{ipCidrRouteDest}, $self->{ipCidrRouteMask},
+ $self->{ipCidrRouteNextHop}, $self->{ipCidrRouteProto},
+ $self->{ipCidrRouteType};
+}
diff --git a/plugins-scripts/Classes/IPMIB/Component/RoutingSubsystem.pm b/plugins-scripts/Classes/IPMIB/Component/RoutingSubsystem.pm
index 5ce9e148..6dd5bbf4 100644
--- a/plugins-scripts/Classes/IPMIB/Component/RoutingSubsystem.pm
+++ b/plugins-scripts/Classes/IPMIB/Component/RoutingSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{interfaces} = [];
$self->get_snmp_tables('IP-MIB', [
['routes', 'ipRouteTable', 'Classes::IPMIB::Component::RoutingSubsystem::Route' ],
@@ -11,7 +11,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking routes');
if ($self->mode =~ /device::routes::list/) {
foreach (@{$self->{routes}}) {
diff --git a/plugins-scripts/Classes/Juniper.pm b/plugins-scripts/Classes/Juniper.pm
index c845fb9c..a2bedb3a 100644
--- a/plugins-scripts/Classes/Juniper.pm
+++ b/plugins-scripts/Classes/Juniper.pm
@@ -8,7 +8,7 @@ use constant trees => (
);
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->{productname} =~ /NetScreen/i) {
bless $self, 'Classes::Juniper::NetScreen';
$self->debug('using Classes::Juniper::NetScreen');
diff --git a/plugins-scripts/Classes/Juniper/IVE.pm b/plugins-scripts/Classes/Juniper/IVE.pm
index 89bdc67c..76b89299 100644
--- a/plugins-scripts/Classes/Juniper/IVE.pm
+++ b/plugins-scripts/Classes/Juniper/IVE.pm
@@ -8,7 +8,7 @@ use constant trees => (
);
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::Juniper::IVE::Component::EnvironmentalSubsystem");
} elsif ($self->mode =~ /device::hardware::load/) {
diff --git a/plugins-scripts/Classes/Juniper/IVE/Component/CpuSubsystem.pm b/plugins-scripts/Classes/Juniper/IVE/Component/CpuSubsystem.pm
index 3141afb0..569adceb 100644
--- a/plugins-scripts/Classes/Juniper/IVE/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/Juniper/IVE/Component/CpuSubsystem.pm
@@ -3,13 +3,13 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('JUNIPER-IVE-MIB', (qw(
iveCpuUtil)));
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking cpus');
$self->add_info(sprintf 'cpu usage is %.2f%%', $self->{iveCpuUtil});
# http://www.juniper.net/techpubs/software/ive/guides/howtos/SA-IC-MAG-SNMP-Monitoring-Guide.pdf
diff --git a/plugins-scripts/Classes/Juniper/IVE/Component/DiskSubsystem.pm b/plugins-scripts/Classes/Juniper/IVE/Component/DiskSubsystem.pm
index 8fd703b3..0e4002f2 100644
--- a/plugins-scripts/Classes/Juniper/IVE/Component/DiskSubsystem.pm
+++ b/plugins-scripts/Classes/Juniper/IVE/Component/DiskSubsystem.pm
@@ -3,13 +3,13 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('JUNIPER-IVE-MIB', (qw(
diskFullPercent)));
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking disks');
$self->add_info(sprintf 'disk is %.2f%% full',
$self->{diskFullPercent});
diff --git a/plugins-scripts/Classes/Juniper/IVE/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Juniper/IVE/Component/EnvironmentalSubsystem.pm
index d5eb3700..8d3c516a 100644
--- a/plugins-scripts/Classes/Juniper/IVE/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/Juniper/IVE/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{disk_subsystem} =
Classes::Juniper::IVE::Component::DiskSubsystem->new();
$self->get_snmp_objects('JUNIPER-IVE-MIB', (qw(
@@ -11,7 +11,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{disk_subsystem}->check();
$self->add_info(sprintf "temperature is %.2f deg", $self->{iveTemperature});
$self->set_thresholds(warning => 70, critical => 75);
@@ -37,7 +37,7 @@ sub check {
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
$self->{disk_subsystem}->dump();
}
diff --git a/plugins-scripts/Classes/Juniper/IVE/Component/MemSubsystem.pm b/plugins-scripts/Classes/Juniper/IVE/Component/MemSubsystem.pm
index 4298e318..bd03c76e 100644
--- a/plugins-scripts/Classes/Juniper/IVE/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/Juniper/IVE/Component/MemSubsystem.pm
@@ -3,13 +3,13 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('JUNIPER-IVE-MIB', (qw(
iveMemoryUtil iveSwapUtil)));
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking memory');
$self->add_info(sprintf 'memory usage is %.2f%%, swap usage is %.2f%%',
$self->{iveMemoryUtil}, $self->{iveSwapUtil});
diff --git a/plugins-scripts/Classes/Juniper/IVE/Component/UserSubsystem.pm b/plugins-scripts/Classes/Juniper/IVE/Component/UserSubsystem.pm
index fe024309..3a405e8b 100644
--- a/plugins-scripts/Classes/Juniper/IVE/Component/UserSubsystem.pm
+++ b/plugins-scripts/Classes/Juniper/IVE/Component/UserSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('JUNIPER-IVE-MIB', (qw(
iveSSLConnections iveVPNTunnels
signedInWebUsers signedInMailUsers meetingUserCount
@@ -17,7 +17,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking memory');
$self->add_info(sprintf 'Users: sslconns=%d cluster=%d, node=%d, web=%d, mail=%d, meeting=%d',
$self->{iveSSLConnections},
diff --git a/plugins-scripts/Classes/Juniper/JunOS.pm b/plugins-scripts/Classes/Juniper/JunOS.pm
index ec0bdd19..2325fc9f 100644
--- a/plugins-scripts/Classes/Juniper/JunOS.pm
+++ b/plugins-scripts/Classes/Juniper/JunOS.pm
@@ -8,7 +8,7 @@ use constant trees => (
);
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::bgp/) {
$self->analyze_and_check_bgp_subsystem("Classes::Juniper::JunOS::Component::BgpSubsystem");
} else {
diff --git a/plugins-scripts/Classes/Juniper/JunOS/Component/BgpSubsystem.pm b/plugins-scripts/Classes/Juniper/JunOS/Component/BgpSubsystem.pm
index 7763e3d8..481a056e 100644
--- a/plugins-scripts/Classes/Juniper/JunOS/Component/BgpSubsystem.pm
+++ b/plugins-scripts/Classes/Juniper/JunOS/Component/BgpSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item Monitoring::GLPlugin::SNMP::Table
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{peers} = [];
if ($self->mode =~ /device::bgp::peer::(list|count|watch)/) {
$self->update_entry_cache(1, 'JUNOS-BGP4V2-MIB', 'jnxBgpM2PeerTable', 'jnxBgpM2PeerRemoteAddr');
@@ -39,7 +39,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
my $errorfound = 0;
if ($self->mode =~ /prefix::count/) {
if (scalar(@{$self->{peers}}) == 0) {
@@ -188,8 +188,7 @@ use strict;
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
sub new {
- my $class = shift;
- my %params = @_;
+ my ($class, %params) = @_;
my $self = {};
foreach(keys %params) {
$self->{$_} = $params{$_};
@@ -205,7 +204,7 @@ sub new {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
if ($self->opts->name2) {
foreach my $as (split(",", $self->opts->name2)) {
if ($as =~ /(\d+)=(\w+)/) {
diff --git a/plugins-scripts/Classes/Juniper/NetScreen.pm b/plugins-scripts/Classes/Juniper/NetScreen.pm
index b288234b..3719fe76 100644
--- a/plugins-scripts/Classes/Juniper/NetScreen.pm
+++ b/plugins-scripts/Classes/Juniper/NetScreen.pm
@@ -8,7 +8,7 @@ use constant trees => (
);
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::load/) {
$self->analyze_and_check_cpu_subsystem("Classes::Juniper::NetScreen::Component::CpuSubsystem");
} elsif ($self->mode =~ /device::hardware::memory/) {
diff --git a/plugins-scripts/Classes/Juniper/NetScreen/Component/CpuSubsystem.pm b/plugins-scripts/Classes/Juniper/NetScreen/Component/CpuSubsystem.pm
index 882192dd..419a2fd5 100644
--- a/plugins-scripts/Classes/Juniper/NetScreen/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/Juniper/NetScreen/Component/CpuSubsystem.pm
@@ -3,13 +3,13 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('NETSCREEN-RESOURCE-MIB', (qw(
nsResCpuAvg)));
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking cpus');
$self->add_info(sprintf 'cpu usage is %.2f%%', $self->{nsResCpuAvg});
$self->set_thresholds(warning => 50, critical => 90);
diff --git a/plugins-scripts/Classes/Juniper/NetScreen/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Juniper/NetScreen/Component/EnvironmentalSubsystem.pm
index 59a5fc0f..91e20fbc 100644
--- a/plugins-scripts/Classes/Juniper/NetScreen/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/Juniper/NetScreen/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects("NETSCREEN-CHASSIS-MIB", (qw(
sysBatteryStatus)));
$self->get_snmp_tables("NETSCREEN-CHASSIS-MIB", [
@@ -15,7 +15,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
foreach (@{$self->{fans}}, @{$self->{power}}, @{$self->{slots}}, @{$self->{temperatures}}) {
$_->check();
}
@@ -27,7 +27,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf "fan %s (%s) is %s",
$self->{nsFanId}, $self->{nsFanDesc}, $self->{nsFanStatus});
if ($self->{nsFanStatus} eq "notInstalled") {
@@ -44,7 +44,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
if ($self->{nsPowerDesc}) {
$self->add_info(sprintf "power supply %s (%s) is %s",
$self->{nsPowerId}, $self->{nsPowerDesc}, $self->{nsPowerStatus});
@@ -65,12 +65,12 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{nsSlotSN} =~ s/^\s+//g;
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf "%s slot %s (%s) is %s",
$self->{nsSlotType}, $self->{nsSlotId}, $self->{nsSlotSN}, $self->{nsSlotStatus});
if ($self->{nsSlotStatus} eq "good") {
@@ -86,7 +86,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf "temperature %s (%s) is %sC",
$self->{nsTemperatureId}, $self->{nsTemperatureDesc}, $self->{nsTemperatureCur});
$self->add_ok();
diff --git a/plugins-scripts/Classes/Juniper/NetScreen/Component/MemSubsystem.pm b/plugins-scripts/Classes/Juniper/NetScreen/Component/MemSubsystem.pm
index f77c905a..67aec653 100644
--- a/plugins-scripts/Classes/Juniper/NetScreen/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/Juniper/NetScreen/Component/MemSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('NETSCREEN-RESOURCE-MIB', (qw(
nsResMemAllocate nsResMemLeft nsResMemFrag)));
my $mem_total = $self->{nsResMemAllocate} + $self->{nsResMemLeft};
@@ -11,7 +11,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking memory');
if (defined $self->{mem_usage}) {
$self->add_info(sprintf 'memory usage is %.2f%%', $self->{mem_usage});
diff --git a/plugins-scripts/Classes/Juniper/NetScreen/Component/VsdSubsystem.pm b/plugins-scripts/Classes/Juniper/NetScreen/Component/VsdSubsystem.pm
index 1d64b58b..a72ca510 100644
--- a/plugins-scripts/Classes/Juniper/NetScreen/Component/VsdSubsystem.pm
+++ b/plugins-scripts/Classes/Juniper/NetScreen/Component/VsdSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('NETSCREEN-NSRP-MIB', [
['members', 'nsrpVsdMemberTable', 'Classes::Juniper::NetScreen::Component::VsdSubsystem::Member'],
['clusters', 'nsrpClusterTable', 'Classes::Juniper::NetScreen::Component::VsdSubsystem::Cluster'],
@@ -16,7 +16,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
my $label = $self->{nsrpVsdMemberGroupId}.'_'.$self->{nsrpVsdMemberUnitId};
$self->add_info(sprintf 'vsd member %s has status %s',
$label, $self->{nsrpVsdMemberStatus});
diff --git a/plugins-scripts/Classes/Juniper/SRX.pm b/plugins-scripts/Classes/Juniper/SRX.pm
index f10f6cfa..50a645b9 100644
--- a/plugins-scripts/Classes/Juniper/SRX.pm
+++ b/plugins-scripts/Classes/Juniper/SRX.pm
@@ -4,7 +4,7 @@ use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::Juniper::SRX::Component::EnvironmentalSubsystem");
$self->{components}->{hostresource_subsystem} =
@@ -23,6 +23,7 @@ sub init {
}
} elsif ($self->mode =~ /device::hardware::load/) {
$self->analyze_and_check_cpu_subsystem("Classes::Juniper::SRX::Component::CpuSubsystem");
+ #$self->analyze_and_check_cpu_subsystem("Classes::HOSTRESOURCESMIB::Component::CpuSubsystem");
} elsif ($self->mode =~ /device::hardware::memory/) {
$self->analyze_and_check_mem_subsystem("Classes::Juniper::SRX::Component::MemSubsystem");
} else {
diff --git a/plugins-scripts/Classes/Juniper/SRX/Component/CpuSubsystem.pm b/plugins-scripts/Classes/Juniper/SRX/Component/CpuSubsystem.pm
index 76e45876..5de517fa 100644
--- a/plugins-scripts/Classes/Juniper/SRX/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/Juniper/SRX/Component/CpuSubsystem.pm
@@ -3,23 +3,30 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('JUNIPER-MIB', [
['operatins', 'jnxOperatingTable', 'Classes::Juniper::SRX::Component::CpuSubsystem::OperatingItem', sub { shift->{jnxOperatingDescr} =~ /engine/i; }],
-# siehe memory
-# ['objects', 'jnxJsSPUMonitoringObjectsTable ', 'Classes::Juniper::SRX::Component::CpuSubsystem::OperatingItem2'],
+ ]);
+ $self->get_snmp_tables('JUNIPER-SRX5000-SPU-MONITORING-MIB', [
+ ['monobjects', 'jnxJsSPUMonitoringObjectsTable', 'Classes::Juniper::SRX::Component::CpuSubsystem::OperatingItem2'],
]);
}
package Classes::Juniper::SRX::Component::CpuSubsystem::OperatingItem;
our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
+sub finish {
+ my ($self) = @_;
+ $self->{jnxOperatingRestartTimeHuman} =
+ scalar localtime($self->{jnxOperatingRestartTime});
+}
+
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf '%s cpu usage is %.2f%%',
$self->{jnxOperatingDescr}, $self->{jnxOperatingCPU});
my $label = 'cpu_'.$self->{jnxOperatingDescr}.'_usage';
- $self->set_thresholds(metric => $label, warning => 50, critical => 90);
+ $self->set_thresholds(metric => $label, warning => 85, critical => 95);
$self->add_message($self->check_thresholds(metric => $label,
value => $self->{jnxOperatingCPU}));
$self->add_perfdata(
@@ -33,13 +40,17 @@ package Classes::Juniper::SRX::Component::CpuSubsystem::OperatingItem2;
our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
sub check {
- my $self = shift;
- $self->add_info(sprintf 'cpu usage is %.2f%%', $self->{jnxJsSPUMonitoringCPUUsage});
- $self->set_thresholds(warning => 50, critical => 90);
- $self->add_message($self->check_thresholds($self->{jnxJsSPUMonitoringCPUUsage}));
+ my ($self) = @_;
+ $self->add_info(sprintf 'packet forwarding %s cpu usage is %.2f%%',
+ $self->{jnxJsSPUMonitoringNodeDescr}, $self->{jnxJsSPUMonitoringCPUUsage});
+ my $label = 'pf_cpu_'.$self->{jnxJsSPUMonitoringNodeDescr}.'_usage';
+ $self->set_thresholds(metric => $label, warning => 80, critical => 95);
+ $self->add_message($self->check_thresholds(metric => $label,
+ value => $self->{jnxJsSPUMonitoringCPUUsage}));
$self->add_perfdata(
- label => 'cpu_usage',
+ label => $label,
value => $self->{jnxJsSPUMonitoringCPUUsage},
uom => '%',
);
}
+
diff --git a/plugins-scripts/Classes/Juniper/SRX/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Juniper/SRX/Component/EnvironmentalSubsystem.pm
index 8e75fc33..64836242 100644
--- a/plugins-scripts/Classes/Juniper/SRX/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/Juniper/SRX/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('JUNIPER-MIB', [
['leds', 'jnxLEDTable', 'Classes::Juniper::SRX::Component::EnvironmentalSubsystem::Led'],
['operatins', 'jnxOperatingTable', 'Classes::Juniper::SRX::Component::EnvironmentalSubsystem::Operating'],
@@ -13,14 +13,24 @@ sub init {
['contents', 'jnxContentsTable', 'Classes::Juniper::SRX::Component::EnvironmentalSubsystem::Content'],
['filled', 'jnxFilledTable', 'Classes::Juniper::SRX::Component::EnvironmentalSubsystem::Fille'],
]);
+ $self->get_snmp_tables('JUNIPER-RPS-MIB', [
+ ['versions', 'jnxRPSVersionTable', 'GLPlugin::SNMP::TableItem'],
+ ['status', 'jnxRPSStatusTable', 'GLPlugin::SNMP::TableItem'],
+ ['powersupplies', 'jnxRPSPowerSupplyTable', 'GLPlugin::SNMP::TableItem'],
+ ['leds', 'jnxRPSLedPortStatusTable', 'GLPlugin::SNMP::TableItem'],
+ ['ports', 'jnxRPSPortStatusTable', 'GLPlugin::SNMP::TableItem'],
+ ]);
$self->merge_tables("operatins", "filled", "fru", "contents");
+ $self->get_snmp_objects('JUNIPER-ALARM-MIB', (qw(jnxYellowAlarmState
+ jnxYellowAlarmCount jnxYellowAlarmLastChange jnxRedAlarmState
+ jnxRedAlarmCount jnxRedAlarmLastChange)));
}
package Classes::Juniper::SRX::Component::EnvironmentalSubsystem::Led;
our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'led %s is %s', $self->{jnxLEDDescr},
$self->{jnxLEDState});
if ($self->{jnxLEDState} eq 'yellow') {
@@ -31,6 +41,8 @@ sub check {
$self->add_critical();
} elsif ($self->{jnxLEDState} eq 'green') {
$self->add_ok();
+ } elsif ($self->{jnxLEDState} eq 'blue') {
+ $self->add_ok();
}
}
@@ -55,21 +67,23 @@ package Classes::Juniper::SRX::Component::EnvironmentalSubsystem::Operating;
our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
sub finish {
- my $self = shift;
+ my ($self) = @_;
if ($self->{jnxOperatingDescr} =~ /Routing Engine$/) {
bless $self, "Classes::Juniper::SRX::Component::EnvironmentalSubsystem::Engine";
}
+ $self->{jnxOperatingRestartTimeHuman} =
+ scalar localtime($self->{jnxOperatingRestartTime});
}
package Classes::Juniper::SRX::Component::EnvironmentalSubsystem::Engine;
our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf '%s temperature is %.2f',
$self->{jnxOperatingDescr}, $self->{jnxOperatingTemp});
my $label = 'temp_'.$self->{jnxOperatingDescr};
- $self->set_thresholds(metric => $label, warning => 50, critical => 60);
+ $self->set_thresholds(metric => $label, warning => 89, critical => 91);
$self->add_message($self->check_thresholds(metric => $label,
value => $self->{jnxOperatingTemp}));
$self->add_perfdata(
@@ -78,3 +92,28 @@ sub check {
);
}
+__END__
+> show chassis temperature-thresholds
+node0:
+--------------------------------------------------------------------------
+ Fan speed Yellow alarm Red alarm Fire Shutdown
+ (degrees C) (degrees C) (degrees C) (degrees C)
+Item Normal High Normal Bad fan Normal Bad fan Normal
+FPC 0 System Temp1 - Front 43 60 60 60 65 65 70
+FPC 0 System Temp2 - Back 48 65 65 65 70 70 75
+FPC 0 CPU0 Temp 70 90 90 90 92 92 95
+FPC 0 CPU1 Temp 70 90 90 90 92 92 95
+
+node1:
+--------------------------------------------------------------------------
+ Fan speed Yellow alarm Red alarm Fire Shutdown
+ (degrees C) (degrees C) (degrees C) (degrees C)
+Item Normal High Normal Bad fan Normal Bad fan Normal
+FPC 0 System Temp1 - Front 43 60 60 60 65 65 70
+FPC 0 System Temp2 - Back 48 65 65 65 70 70 75
+FPC 0 CPU0 Temp 70 90 90 90 92 92 95
+FPC 0 CPU1 Temp 70 90 90 90 92 92 95
+
+{primary:node0}
+>
+
diff --git a/plugins-scripts/Classes/Juniper/SRX/Component/MemSubsystem.pm b/plugins-scripts/Classes/Juniper/SRX/Component/MemSubsystem.pm
index 23889952..e4d7a90a 100644
--- a/plugins-scripts/Classes/Juniper/SRX/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/Juniper/SRX/Component/MemSubsystem.pm
@@ -3,17 +3,18 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('JUNIPER-MIB', qw(jnxBoxKernelMemoryUsedPercent));
$self->get_snmp_tables('JUNIPER-MIB', [
['operatins', 'jnxOperatingTable', 'Classes::Juniper::SRX::Component::MemSubsystem::OperatingItem', sub { shift->{jnxOperatingDescr} =~ /engine/i; }],
-# nearly no documentytion exists for this
-# ['objects', 'jnxJsSPUMonitoringObjectsTable ', 'Classes::Juniper::SRX::Component::MemSubsystem::OperatingItem2'],
+ ]);
+ $self->get_snmp_tables('JUNIPER-SRX5000-SPU-MONITORING-MIB', [
+ ['objects', 'jnxJsSPUMonitoringObjectsTable', 'Classes::Juniper::SRX::Component::MemSubsystem::OperatingItem2'],
]);
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->SUPER::check();
if (exists $self->{jnxBoxKernelMemoryUsedPercent}) {
$self->add_info(sprintf 'kernel memory usage is %.2f%%',
@@ -34,12 +35,18 @@ sub check {
package Classes::Juniper::SRX::Component::MemSubsystem::OperatingItem;
our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
+sub finish {
+ my ($self) = @_;
+ $self->{jnxOperatingRestartTimeHuman} =
+ scalar localtime($self->{jnxOperatingRestartTime});
+}
+
sub check {
- my $self = shift;
- $self->add_info(sprintf '%s buffer usage is %.2f%%',
+ my ($self) = @_;
+ $self->add_info(sprintf 'routing engine %s buffer usage is %.2f%%',
$self->{jnxOperatingDescr}, $self->{jnxOperatingBuffer});
my $label = 'buffer_'.$self->{jnxOperatingDescr}.'_usage';
- $self->set_thresholds(metric => $label, warning => 90, critical => 95);
+ $self->set_thresholds(metric => $label, warning => 80, critical => 95);
$self->add_message($self->check_thresholds(metric => $label,
value => $self->{jnxOperatingBuffer}));
$self->add_perfdata(
@@ -53,13 +60,16 @@ package Classes::Juniper::SRX::Component::MemSubsystem::OperatingItem2;
our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
sub check {
- my $self = shift;
- $self->add_info(sprintf 'cpu usage is %.2f%%', $self->{jnxJsSPUMonitoringCPUUsage});
- $self->set_thresholds(warning => 50, critical => 90);
- $self->add_message($self->check_thresholds($self->{jnxJsSPUMonitoringCPUUsage}));
+ my ($self) = @_;
+ $self->add_info(sprintf 'packet forwarding %s memory usage is %.2f%%',
+ $self->{jnxJsSPUMonitoringNodeDescr}, $self->{jnxJsSPUMonitoringMemoryUsage});
+ my $label = 'pf_mem_'.$self->{jnxJsSPUMonitoringNodeDescr}.'_usage';
+ $self->set_thresholds(metric => $label, warning => 80, critical => 95);
+ $self->add_message($self->check_thresholds(metric => $label,
+ value => $self->{jnxJsSPUMonitoringMemoryUsage}));
$self->add_perfdata(
- label => 'cpu_usage',
- value => $self->{jnxJsSPUMonitoringCPUUsage},
+ label => $label,
+ value => $self->{jnxJsSPUMonitoringMemoryUsage},
uom => '%',
);
}
diff --git a/plugins-scripts/Classes/LMSENSORSMIB/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/LMSENSORSMIB/Component/EnvironmentalSubsystem.pm
index f7758fc6..ae3c4b4a 100644
--- a/plugins-scripts/Classes/LMSENSORSMIB/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/LMSENSORSMIB/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{fan_subsystem} =
Classes::LMSENSORSMIB::Component::FanSubsystem->new();
$self->{temperature_subsystem} =
@@ -11,13 +11,14 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{fan_subsystem}->check();
$self->{temperature_subsystem}->check();
+ $self->reduce_messages_short('lmsensors are fine');
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
$self->{fan_subsystem}->dump();
$self->{temperature_subsystem}->dump();
}
diff --git a/plugins-scripts/Classes/LMSENSORSMIB/Component/FanSubsystem.pm b/plugins-scripts/Classes/LMSENSORSMIB/Component/FanSubsystem.pm
index 326f1313..2986ce80 100644
--- a/plugins-scripts/Classes/LMSENSORSMIB/Component/FanSubsystem.pm
+++ b/plugins-scripts/Classes/LMSENSORSMIB/Component/FanSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('LM-SENSORS-MIB', [
['fans', 'lmFanSensorsTable', 'Classes::LMSENSORSMIB::Component::FanSubsystem::Fan'],
]);
@@ -14,7 +14,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'fan %s is %s',
$self->{lmFanSensorsDevice},
$self->{lmFanSensorsValue});
diff --git a/plugins-scripts/Classes/LMSENSORSMIB/Component/TemperatureSubsystem.pm b/plugins-scripts/Classes/LMSENSORSMIB/Component/TemperatureSubsystem.pm
index 699f2d83..1c616288 100644
--- a/plugins-scripts/Classes/LMSENSORSMIB/Component/TemperatureSubsystem.pm
+++ b/plugins-scripts/Classes/LMSENSORSMIB/Component/TemperatureSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('LM-SENSORS-MIB', [
['temperatures', 'lmTempSensorsTable', 'Classes::LMSENSORSMIB::Component::TemperatureSubsystem::Temperature'],
]);
@@ -14,12 +14,12 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{lmTempSensorsValue} /= 1000;
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'temp %s is %.2fC',
$self->{lmTempSensorsDevice},
$self->{lmTempSensorsValue});
diff --git a/plugins-scripts/Classes/Lancom.pm b/plugins-scripts/Classes/Lancom.pm
index 234dd7c4..fb489dc4 100644
--- a/plugins-scripts/Classes/Lancom.pm
+++ b/plugins-scripts/Classes/Lancom.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Device);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->bulk_is_baeh();
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::Lancom::Component::EnvironmentalSubsystem");
diff --git a/plugins-scripts/Classes/Lancom/Component/CpuSubsystem.pm b/plugins-scripts/Classes/Lancom/Component/CpuSubsystem.pm
index d05f77fb..3606af55 100644
--- a/plugins-scripts/Classes/Lancom/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/Lancom/Component/CpuSubsystem.pm
@@ -3,13 +3,13 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('LCOS-MIB', (qw(
lcsStatusHardwareInfoCpuLoadPercent)));
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking cpus');
$self->add_info(sprintf 'cpu usage is %.2f%%',
$self->{lcsStatusHardwareInfoCpuLoadPercent});
diff --git a/plugins-scripts/Classes/Lancom/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Lancom/Component/EnvironmentalSubsystem.pm
index 1ce69827..7f3c4cb6 100644
--- a/plugins-scripts/Classes/Lancom/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/Lancom/Component/EnvironmentalSubsystem.pm
@@ -3,13 +3,13 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('LCOS-MIB', (qw(
lcsStatusHardwareInfoTemperatureDegrees)));
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking temperature');
$self->add_info(sprintf 'temperature is is %.2f',
$self->{lcsStatusHardwareInfoTemperatureDegrees});
diff --git a/plugins-scripts/Classes/Lancom/Component/MemSubsystem.pm b/plugins-scripts/Classes/Lancom/Component/MemSubsystem.pm
index dbdd905b..92f98259 100644
--- a/plugins-scripts/Classes/Lancom/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/Lancom/Component/MemSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('LCOS-MIB', (qw(
lcsStatusHardwareInfoTotalMemoryKbytes
lcsStatusHardwareInfoFreeMemoryKbytes
@@ -15,7 +15,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking memory');
$self->add_info(sprintf 'memory usage is %.2f%%',
$self->{usage});
diff --git a/plugins-scripts/Classes/Lancom/Component/SensorSubsystem.pm b/plugins-scripts/Classes/Lancom/Component/SensorSubsystem.pm
index 8516c211..45c410be 100644
--- a/plugins-scripts/Classes/Lancom/Component/SensorSubsystem.pm
+++ b/plugins-scripts/Classes/Lancom/Component/SensorSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->bulk_is_baeh();
$self->get_snmp_tables('SW-MIB', [
['sensors', 'swSensorTable', 'Classes::Lancom::Component::SensorSubsystem::Sensor'],
@@ -16,7 +16,7 @@ use strict;
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf '%s sensor %s (%s) is %s',
$self->{swSensorType},
$self->{swSensorIndex},
@@ -41,27 +41,3 @@ sub check {
}
}
-
-package Classes::Lancom::Component::SensorSubsystem::SensorThreshold;
-our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
-use strict;
-
-sub new {
- my $class = shift;
- my %params = @_;
- my $self = {
- blacklisted => 0,
- info => undef,
- extendedinfo => undef,
- };
- foreach my $param (qw(entSensorThresholdRelation entSensorThresholdValue
- entSensorThresholdSeverity entSensorThresholdNotificationEnable
- entSensorThresholdEvaluation indices)) {
- $self->{$param} = $params{$param};
- }
- $self->{entPhysicalIndex} = $params{indices}[0];
- $self->{entSensorThresholdIndex} = $params{indices}[1];
- bless $self, $class;
- return $self;
-}
-
diff --git a/plugins-scripts/Classes/Lantronix/SLS.pm b/plugins-scripts/Classes/Lantronix/SLS.pm
index bf541e5a..67609e9e 100644
--- a/plugins-scripts/Classes/Lantronix/SLS.pm
+++ b/plugins-scripts/Classes/Lantronix/SLS.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Lantronix);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::Lantronix::SLS::Component::EnvironmentalSubsystem");
} else {
@@ -17,12 +17,12 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('LARA-MIB', qw(checkHostPower));
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'host power status is %s', $self->{checkHostPower});
if ($self->{checkHostPower} eq 'hasPower') {
$self->add_ok();
diff --git a/plugins-scripts/Classes/MEOS.pm b/plugins-scripts/Classes/MEOS.pm
index 4b5e6cca..28fa6de7 100644
--- a/plugins-scripts/Classes/MEOS.pm
+++ b/plugins-scripts/Classes/MEOS.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Brocade);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_and_check_environmental_subsystem();
} elsif ($self->mode =~ /device::hardware::load/) {
@@ -16,7 +16,7 @@ sub init {
}
sub analyze_environmental_subsystem {
- my $self = shift;
+ my ($self) = @_;
$self->{components}->{environmental_subsystem1} =
Classes::FCMGMT::Component::EnvironmentalSubsystem->new();
$self->{components}->{environmental_subsystem2} =
@@ -24,7 +24,7 @@ sub analyze_environmental_subsystem {
}
sub check_environmental_subsystem {
- my $self = shift;
+ my ($self) = @_;
$self->{components}->{environmental_subsystem1}->check();
$self->{components}->{environmental_subsystem2}->check();
if ($self->check_messages()) {
diff --git a/plugins-scripts/Classes/Netgear.pm b/plugins-scripts/Classes/Netgear.pm
index e5140958..5393adbb 100644
--- a/plugins-scripts/Classes/Netgear.pm
+++ b/plugins-scripts/Classes/Netgear.pm
@@ -4,7 +4,7 @@ use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
# netgear does not publish mibs
$self->no_such_mode();
}
diff --git a/plugins-scripts/Classes/Nortel.pm b/plugins-scripts/Classes/Nortel.pm
index 07125d67..27b22661 100644
--- a/plugins-scripts/Classes/Nortel.pm
+++ b/plugins-scripts/Classes/Nortel.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Device);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->implements_mib('S5-CHASSIS-MIB')) {
bless $self, 'Classes::Nortel::S5';
$self->debug('using Classes::Nortel::S5');
diff --git a/plugins-scripts/Classes/Nortel/S5.pm b/plugins-scripts/Classes/Nortel/S5.pm
index 0bbb678b..6f7f0fc3 100644
--- a/plugins-scripts/Classes/Nortel/S5.pm
+++ b/plugins-scripts/Classes/Nortel/S5.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Device);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::Nortel::S5::Component::EnvironmentalSubsystem");
} elsif ($self->mode =~ /device::hardware::load/) {
diff --git a/plugins-scripts/Classes/Nortel/S5/Component/CpuSubsystem.pm b/plugins-scripts/Classes/Nortel/S5/Component/CpuSubsystem.pm
index 75de7f2e..fd142253 100644
--- a/plugins-scripts/Classes/Nortel/S5/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/Nortel/S5/Component/CpuSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('S5-CHASSIS-MIB', [
['utils', 's5ChasUtilTable', 'Classes::Nortel::S5::Component::CpuSubsystem::Cpu' ],
]);
@@ -15,7 +15,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
my $label = sprintf 'cpu_%s_usage', $self->{flat_indices};
$self->add_info(sprintf 'cpu %s usage was %.2f%%(1min) %.2f%%(10min)',
$self->{flat_indices},,
diff --git a/plugins-scripts/Classes/Nortel/S5/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Nortel/S5/Component/EnvironmentalSubsystem.pm
index e7f8747d..8e41ddce 100644
--- a/plugins-scripts/Classes/Nortel/S5/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/Nortel/S5/Component/EnvironmentalSubsystem.pm
@@ -3,14 +3,14 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('S5-CHASSIS-MIB', [
['comps', 's5ChasComTable', 'Classes::Nortel::S5::Component::EnvironmentalSubsystem::Comp' ],
]);
}
sub check {
- my $self = shift;
+ my ($self) = @_;
foreach (@{$self->{comps}}) {
$_->check();
}
@@ -23,12 +23,12 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{s5ChasComShortDescr} = $self->{s5ChasComDescr};
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'component %s/%s status is %s (admin %s)',
$self->{flat_indices}, $self->{s5ChasComShortDescr},
$self->{s5ChasComOperState}, $self->{s5ChasComAdminState});
diff --git a/plugins-scripts/Classes/Nortel/S5/Component/MemSubsystem.pm b/plugins-scripts/Classes/Nortel/S5/Component/MemSubsystem.pm
index 6db44132..871bd19c 100644
--- a/plugins-scripts/Classes/Nortel/S5/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/Nortel/S5/Component/MemSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('S5-CHASSIS-MIB', [
['utils', 's5ChasUtilTable', 'Classes::Nortel::S5::Component::MemSubsystem::Mem' ],
]);
@@ -15,14 +15,14 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{s5ChasUtilMemoryUsage} = 100 -
($self->{s5ChasUtilMemoryAvailableMB} /
$self->{s5ChasUtilMemoryTotalMB} * 100);
}
sub check {
- my $self = shift;
+ my ($self) = @_;
my $label = sprintf 'memory_%s_usage', $self->{flat_indices};
$self->add_info(sprintf 'memory %s usage is %.2f%%',
$self->{flat_indices},,
diff --git a/plugins-scripts/Classes/OSPF.pm b/plugins-scripts/Classes/OSPF.pm
index b4dac521..1c66d374 100644
--- a/plugins-scripts/Classes/OSPF.pm
+++ b/plugins-scripts/Classes/OSPF.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Device);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::ospf::neighbor/) {
$self->analyze_and_check_neighbor_subsystem("Classes::OSPF::Component::NeighborSubsystem");
} else {
diff --git a/plugins-scripts/Classes/OSPF/Component/NeighborSubsystem.pm b/plugins-scripts/Classes/OSPF/Component/NeighborSubsystem.pm
index 1cd5ad6a..d81ce2ad 100644
--- a/plugins-scripts/Classes/OSPF/Component/NeighborSubsystem.pm
+++ b/plugins-scripts/Classes/OSPF/Component/NeighborSubsystem.pm
@@ -3,30 +3,43 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('OSPF-MIB', [
- ['nbr', 'ospfNbrTable', 'Classes::OSPF::Component::NeighborSubsystem::Neighbor', , sub { my $o = shift; return $self->filter_name($o->{ospfNbrIpAddr}) && $self->filter_name2($o->{ospfNbrRtrId}) }],
+ ['nbr', 'ospfNbrTable', 'Classes::OSPF::Component::NeighborSubsystem::Neighbor', , sub { my ($o) = @_; return $self->filter_name($o->{ospfNbrIpAddr}) && $self->filter_name2($o->{ospfNbrRtrId}) }],
]);
+eval {
+ $self->get_snmp_tables('OSPFV3-MIB', [
+ ['nbr3', 'ospfv3NbrTable', 'Classes::OSPF::Component::NeighborSubsystem::V3Neighbor', , sub { my ($o) = @_; return 1; $self->filter_name($o->{ospfNbrIpAddr}) && $self->filter_name2($o->{ospfNbrRtrId}) }],
+ ]);
+};
if ($self->establish_snmp_secondary_session()) {
$self->clear_table_cache('OSPF-MIB', 'ospfNbrTable');
+ $self->clear_table_cache('OSPFV3-MIB', 'ospfv3NbrTable');
$self->get_snmp_tables('OSPF-MIB', [
- ['nbr', 'ospfNbrTable', 'Classes::OSPF::Component::NeighborSubsystem::Neighbor', , sub { my $o = shift; return $self->filter_name($o->{ospfNbrIpAddr}) && $self->filter_name2($o->{ospfNbrRtrId}) }],
+ ['nbr', 'ospfNbrTable', 'Classes::OSPF::Component::NeighborSubsystem::Neighbor', , sub { my ($o) = @_; return $self->filter_name($o->{ospfNbrIpAddr}) && $self->filter_name2($o->{ospfNbrRtrId}) }],
+ ]);
+ $self->get_snmp_tables('OSPFV3-MIB', [
+ ['nbr3', 'ospfv3NbrTable', 'Classes::OSPF::Component::NeighborSubsystem::V3Neighbor', , sub { my ($o) = @_; return 1; $self->filter_name($o->{ospfNbrIpAddr}) && $self->filter_name2($o->{ospfNbrRtrId}) }],
]);
}
- if (! @{$self->{nbr}}) {
+ if (! @{$self->{nbr}} && ! @{$self->{nbr3}}) {
$self->add_unknown("no neighbors found");
}
}
sub check {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::ospf::neighbor::list/) {
foreach (@{$self->{nbr}}) {
printf "%s %s %s\n", $_->{name}, $_->{ospfNbrRtrId}, $_->{ospfNbrState};
}
+ foreach (@{$self->{nbr3}}) {
+ printf "%s %s %s\n", $_->{name}, $_->{ospfv3NbrRtrId}, $_->{ospfv3NbrState};
+ }
$self->add_ok("have fun");
} else {
map { $_->check(); } @{$self->{nbr}};
+ map { $_->check(); } @{$self->{nbr3}};
}
}
@@ -36,12 +49,12 @@ use strict;
# Index: ospfNbrIpAddr, ospfNbrAddressLessIndex
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{name} = $self->{ospfNbrIpAddr} || $self->{ospfNbrAddressLessIndex}
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf "neighbor %s (Id %s) has status %s",
$self->{name}, $self->{ospfNbrRtrId}, $self->{ospfNbrState});
if ($self->{ospfNbrState} ne "full" && $self->{ospfNbrState} ne "twoWay") {
@@ -51,4 +64,26 @@ sub check {
}
}
+package Classes::OSPF::Component::NeighborSubsystem::V3Neighbor;
+our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
+use strict;
+# Index: ospfv3NbrIfIndex, ospfv3NbrIfInstId, ospfv3NbrRtrId
+
+sub finish {
+ my ($self) = @_;
+ $self->{name} = $self->{ospfv3NbrAddress};
+ $self->{ospfv3NbrRtrId} = join('.',unpack('C4', pack('N', $self->{indices}->[2])));
+}
+
+sub check {
+ my ($self) = @_;
+ $self->add_info(sprintf "neighbor %s (Id %s) has status %s",
+ $self->{name}, $self->{ospfv3NbrRtrId}, $self->{ospfv3NbrState});
+ if ($self->{ospfv3NbrState} ne "full" && $self->{ospfv3NbrState} ne "twoWay") {
+ $self->add_critical();
+ } else {
+ $self->add_ok();
+ }
+}
+
# eventuell: warning, wenn sich die RouterId ändert
diff --git a/plugins-scripts/Classes/OneOS.pm b/plugins-scripts/Classes/OneOS.pm
index e9ab60ba..26c9be77 100644
--- a/plugins-scripts/Classes/OneOS.pm
+++ b/plugins-scripts/Classes/OneOS.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Device);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::OneOS::Component::EnvironmentalSubsystem");
} elsif ($self->mode =~ /device::hardware::load/) {
diff --git a/plugins-scripts/Classes/OneOS/Component/CpuSubsystem.pm b/plugins-scripts/Classes/OneOS/Component/CpuSubsystem.pm
index dabc8223..3e8d7e86 100644
--- a/plugins-scripts/Classes/OneOS/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/OneOS/Component/CpuSubsystem.pm
@@ -3,13 +3,13 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('ONEACCESS-SYS-MIB', (qw(
oacSysCpuUsed)));
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking cpu');
$self->add_info(sprintf 'cpu usage is %.2f%%',
$self->{oacSysCpuUsed});
diff --git a/plugins-scripts/Classes/OneOS/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/OneOS/Component/EnvironmentalSubsystem.pm
index 3e49fb9c..6634d80e 100644
--- a/plugins-scripts/Classes/OneOS/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/OneOS/Component/EnvironmentalSubsystem.pm
@@ -3,14 +3,14 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('ONEACCESS-SYS-MIB', [
['comps', 'oacExpIMSysHwComponentsTable', 'Classes::OneOS::Component::EnvironmentalSubsystem::Comp' ],
]);
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_ok("environmental hardware working fine, at least i hope so. this device did not implement any kind of hardware health status. use -vv to see a list of components");
}
@@ -20,7 +20,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
my $label = sprintf 'usage', $self->{flat_indices};
$self->add_info(sprintf '%s %s %s',
$self->{flat_indices}, $self->{oacExpIMSysHwcTypeDefinition},
diff --git a/plugins-scripts/Classes/OneOS/Component/MemSubsystem.pm b/plugins-scripts/Classes/OneOS/Component/MemSubsystem.pm
index 08d999d8..e875946e 100644
--- a/plugins-scripts/Classes/OneOS/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/OneOS/Component/MemSubsystem.pm
@@ -3,13 +3,13 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('ONEACCESS-SYS-MIB', (qw(
oacSysMemoryUsed)));
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking memory');
$self->add_info(sprintf 'memory usage is %.2f%%',
$self->{oacSysMemoryUsed});
diff --git a/plugins-scripts/Classes/PaloAlto.pm b/plugins-scripts/Classes/PaloAlto.pm
index a4fa46ee..139f4265 100644
--- a/plugins-scripts/Classes/PaloAlto.pm
+++ b/plugins-scripts/Classes/PaloAlto.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Device);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::ENTITYSENSORMIB::Component::EnvironmentalSubsystem");
$self->analyze_and_check_environmental_subsystem("Classes::HOSTRESOURCESMIB::Component::EnvironmentalSubsystem");
@@ -24,3 +24,10 @@ sub init {
}
}
+sub pretty_sysdesc {
+ my ($self, $sysDescr) = @_;
+ my $sw_version = $self->get_snmp_object('PAN-COMMON-MIB', 'panSysSwVersion');
+ my $hw_version = $self->get_snmp_object('PAN-COMMON-MIB', 'panSysHwVersion');
+ return sprintf "%s, sw version %s, hw version: %s",
+ $sysDescr, $sw_version, $hw_version;
+}
diff --git a/plugins-scripts/Classes/PaloAlto/Component/CpuSubsystem.pm b/plugins-scripts/Classes/PaloAlto/Component/CpuSubsystem.pm
index 4278b89a..e20abe88 100644
--- a/plugins-scripts/Classes/PaloAlto/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/PaloAlto/Component/CpuSubsystem.pm
@@ -3,13 +3,13 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('NETSCREEN-RESOURCE-MIB', (qw(
nsResCpuAvg)));
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking cpus');
$self->add_info(sprintf 'cpu usage is %.2f%%', $self->{nsResCpuAvg});
$self->set_thresholds(warning => 50, critical => 90);
diff --git a/plugins-scripts/Classes/PaloAlto/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/PaloAlto/Component/EnvironmentalSubsystem.pm
index 7a2670f8..5f075ac2 100644
--- a/plugins-scripts/Classes/PaloAlto/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/PaloAlto/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
#######################
$self->no_such_mode();
die;
@@ -19,7 +19,7 @@ die;
}
sub check {
- my $self = shift;
+ my ($self) = @_;
foreach (@{$self->{fans}}, @{$self->{power}}, @{$self->{slots}}, @{$self->{temperatures}}) {
$_->check();
}
@@ -31,7 +31,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf "fan %s (%s) is %s",
$self->{nsFanId}, $self->{nsFanDesc}, $self->{nsFanStatus});
if ($self->{nsFanStatus} eq "notInstalled") {
@@ -48,7 +48,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf "power supply %s (%s) is %s",
$self->{nsPowerId}, $self->{nsPowerDesc}, $self->{nsPowerStatus});
if ($self->{nsPowerStatus} eq "good") {
@@ -64,7 +64,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf "%s slot %s (%s) is %s",
$self->{nsSlotType}, $self->{nsSlotId}, $self->{nsSlotSN}, $self->{nsSlotStatus});
if ($self->{nsSlotStatus} eq "good") {
@@ -80,7 +80,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf "temperature %s is %sC",
$self->{nsTemperatureId}, $self->{nsTemperatureDesc}, $self->{nsTemperatureCur});
$self->add_ok();
diff --git a/plugins-scripts/Classes/PaloAlto/Component/HaSubsystem.pm b/plugins-scripts/Classes/PaloAlto/Component/HaSubsystem.pm
index 4427c1fe..b8429f26 100644
--- a/plugins-scripts/Classes/PaloAlto/Component/HaSubsystem.pm
+++ b/plugins-scripts/Classes/PaloAlto/Component/HaSubsystem.pm
@@ -4,7 +4,7 @@ use strict;
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::ha::role/) {
$self->get_snmp_objects('PAN-COMMON-MIB', (qw(
panSysHAMode panSysHAState panSysHAPeerState)));
@@ -15,7 +15,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking ha');
$self->add_info(sprintf 'ha mode is %s, state is %s, peer state is %s',
$self->{panSysHAMode},
diff --git a/plugins-scripts/Classes/PaloAlto/Component/MemSubsystem.pm b/plugins-scripts/Classes/PaloAlto/Component/MemSubsystem.pm
index 995e473b..88922735 100644
--- a/plugins-scripts/Classes/PaloAlto/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/PaloAlto/Component/MemSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('NETSCREEN-RESOURCE-MIB', (qw(
nsResMemAllocate nsResMemLeft nsResMemFrag)));
my $mem_total = $self->{nsResMemAllocate} + $self->{nsResMemLeft};
@@ -11,7 +11,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking memory');
if (defined $self->{mem_usage}) {
$self->add_info(sprintf 'memory usage is %.2f%%', $self->{mem_usage});
diff --git a/plugins-scripts/Classes/RAPIDCITYMIB/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/RAPIDCITYMIB/Component/EnvironmentalSubsystem.pm
index 34c17d9b..03e6f9f1 100644
--- a/plugins-scripts/Classes/RAPIDCITYMIB/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/RAPIDCITYMIB/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{powersupply_subsystem} =
Classes::RAPIDCITYMIB::Component::PowersupplySubsystem->new();
$self->{fan_subsystem} =
@@ -13,7 +13,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{powersupply_subsystem}->check();
$self->{fan_subsystem}->check();
$self->{temperature_subsystem}->check();
@@ -23,7 +23,7 @@ sub check {
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
$self->{powersupply_subsystem}->dump();
$self->{fan_subsystem}->dump();
$self->{temperature_subsystem}->dump();
diff --git a/plugins-scripts/Classes/RAPIDCITYMIB/Component/FanSubsystem.pm b/plugins-scripts/Classes/RAPIDCITYMIB/Component/FanSubsystem.pm
index 96d32522..e7742913 100644
--- a/plugins-scripts/Classes/RAPIDCITYMIB/Component/FanSubsystem.pm
+++ b/plugins-scripts/Classes/RAPIDCITYMIB/Component/FanSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('FOUNDRY-SN-AGENT-MIB', [
['fans', 'snChasFanTable', 'Classes::RAPIDCITYMIB::Component::FanSubsystem::Fan'],
]);
@@ -15,7 +15,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'fan %d is %s',
$self->{snChasFanIndex},
$self->{snChasFanOperStatus});
diff --git a/plugins-scripts/Classes/RAPIDCITYMIB/Component/PowersupplySubsystem.pm b/plugins-scripts/Classes/RAPIDCITYMIB/Component/PowersupplySubsystem.pm
index 881de77f..73f58d5e 100644
--- a/plugins-scripts/Classes/RAPIDCITYMIB/Component/PowersupplySubsystem.pm
+++ b/plugins-scripts/Classes/RAPIDCITYMIB/Component/PowersupplySubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('FOUNDRY-SN-AGENT-MIB', [
['powersupplies', 'snChasPwrSupplyTable', 'Classes::RAPIDCITYMIB::Component::PowersupplySubsystem::Powersupply'],
]);
@@ -15,7 +15,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'powersupply %d is %s',
$self->{snChasPwrSupplyIndex},
$self->{snChasPwrSupplyOperStatus});
diff --git a/plugins-scripts/Classes/RAPIDCITYMIB/Component/TemperatureSubsystem.pm b/plugins-scripts/Classes/RAPIDCITYMIB/Component/TemperatureSubsystem.pm
index 8bf5d290..a5747358 100644
--- a/plugins-scripts/Classes/RAPIDCITYMIB/Component/TemperatureSubsystem.pm
+++ b/plugins-scripts/Classes/RAPIDCITYMIB/Component/TemperatureSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
my $temp = 0;
$self->get_snmp_tables('FOUNDRY-SN-AGENT-MIB', [
['temperatures', 'snAgentTempTable', 'Classes::RAPIDCITYMIB::Component::TemperatureSubsystem::Temperature'],
@@ -20,7 +20,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{snAgentTempValue} /= 2;
$self->add_info(sprintf 'temperature %s is %.2fC',
$self->{snAgentTempSlotNum}, $self->{snAgentTempValue});
diff --git a/plugins-scripts/Classes/Riverbed/Steelhead.pm b/plugins-scripts/Classes/Riverbed/Steelhead.pm
index e7ec49f6..b6727c30 100644
--- a/plugins-scripts/Classes/Riverbed/Steelhead.pm
+++ b/plugins-scripts/Classes/Riverbed/Steelhead.pm
@@ -4,7 +4,7 @@ use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::Riverbed::Steelhead::Component::EnvironmentalSubsystem");
} elsif ($self->mode =~ /device::hardware::load/) {
@@ -28,7 +28,7 @@ our @ISA = qw(Classes::Riverbed::Steelhead);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::Riverbed::SteelheadEX::Component::EnvironmentalSubsystem");
} else {
diff --git a/plugins-scripts/Classes/Riverbed/Steelhead/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Riverbed/Steelhead/Component/EnvironmentalSubsystem.pm
index 40f49be2..ec75a567 100644
--- a/plugins-scripts/Classes/Riverbed/Steelhead/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/Riverbed/Steelhead/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('STEELHEAD-MIB', qw(
serviceStatus serialNumber systemVersion model
serviceStatus systemHealth optServiceStatus systemTemperature
@@ -12,7 +12,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'health state is %s', $self->{systemHealth});
if ($self->{systemHealth} eq 'healthy') {
$self->add_ok();
diff --git a/plugins-scripts/Classes/Riverbed/SteelheadEX/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Riverbed/SteelheadEX/Component/EnvironmentalSubsystem.pm
index 39f461a6..51d97003 100644
--- a/plugins-scripts/Classes/Riverbed/SteelheadEX/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/Riverbed/SteelheadEX/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Riverbed::Steelhead::Component::EnvironmentalSubsystem);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('STEELHEAD-EX-MIB', qw(
serviceStatus serialNumber systemVersion model
serviceStatus systemHealth optServiceStatus systemTemperature
diff --git a/plugins-scripts/Classes/SGOS.pm b/plugins-scripts/Classes/SGOS.pm
index bb94c44d..024864c4 100644
--- a/plugins-scripts/Classes/SGOS.pm
+++ b/plugins-scripts/Classes/SGOS.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Bluecoat);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::SGOS::Component::EnvironmentalSubsystem");
} elsif ($self->mode =~ /device::hardware::load/) {
diff --git a/plugins-scripts/Classes/SGOS/Component/ConnectionSubsystem.pm b/plugins-scripts/Classes/SGOS/Component/ConnectionSubsystem.pm
index ccf3f06f..6b40f8a5 100644
--- a/plugins-scripts/Classes/SGOS/Component/ConnectionSubsystem.pm
+++ b/plugins-scripts/Classes/SGOS/Component/ConnectionSubsystem.pm
@@ -4,7 +4,7 @@ use strict;
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('BLUECOAT-SG-PROXY-MIB', (qw(sgProxyHttpResponseTimeAll
sgProxyHttpResponseFirstByte
sgProxyHttpResponseByteRate sgProxyHttpResponseSize
@@ -16,7 +16,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking connections');
if ($self->mode =~ /device::connections::check/) {
$self->add_info(sprintf 'average service time for http requests is %.5fs',
diff --git a/plugins-scripts/Classes/SGOS/Component/CpuSubsystem.pm b/plugins-scripts/Classes/SGOS/Component/CpuSubsystem.pm
index ce940115..0240395d 100644
--- a/plugins-scripts/Classes/SGOS/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/SGOS/Component/CpuSubsystem.pm
@@ -3,8 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
- my %params = @_;
+ my ($self) = @_;
# With AVOS version 5.5.4.1, 5.4.6.1 and 6.1.2.1, the SNMP MIB has been extended to support multiple CPU cores.
# The new OID is defined as a table 1.3.6.1.4.1.3417.2.11.2.4.1 in the BLUECOAT-SG-PROXY-MIB file with the following sub-OIDs.
# https://kb.bluecoat.com/index?page=content&id=FAQ1244&actp=search&viewlocale=en_US&searchid=1360452047002
@@ -23,7 +22,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'cpu %s usage is %.2f%%',
$self->{flat_indices}, $self->{sgProxyCpuCoreBusyPerCent});
$self->set_thresholds(warning => 80, critical => 90);
@@ -41,7 +40,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'cpu %s usage is %.2f%%',
$self->{flat_indices}, $self->{deviceUsagePercent});
$self->set_thresholds(warning => 80, critical => 90);
diff --git a/plugins-scripts/Classes/SGOS/Component/DiskSubsystem.pm b/plugins-scripts/Classes/SGOS/Component/DiskSubsystem.pm
index db786710..9099314d 100644
--- a/plugins-scripts/Classes/SGOS/Component/DiskSubsystem.pm
+++ b/plugins-scripts/Classes/SGOS/Component/DiskSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('DISK-MIB', [
['disks', 'deviceDiskValueTable', 'Classes::SGOS::Component::DiskSubsystem::Disk'],
]);
@@ -22,7 +22,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'disk %s (%s %s) is %s',
$self->{flat_indices},
$self->{deviceDiskVendor},
@@ -39,7 +39,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf 'disk %s usage is %.2f%% (internal status is %s)',
$self->{deviceUsageIndex},
$self->{deviceUsagePercent},
diff --git a/plugins-scripts/Classes/SGOS/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/SGOS/Component/EnvironmentalSubsystem.pm
index 680b638c..0c2543fa 100644
--- a/plugins-scripts/Classes/SGOS/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/SGOS/Component/EnvironmentalSubsystem.pm
@@ -1,17 +1,9 @@
package Classes::SGOS::Component::EnvironmentalSubsystem;
-our @ISA = qw(Classes::SGOS);
+our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
-sub new {
- my $class = shift;
- my $self = {};
- bless $self, $class;
- $self->init();
- return $self;
-}
-
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{sensor_subsystem} =
Classes::SGOS::Component::SensorSubsystem->new();
$self->{disk_subsystem} =
@@ -19,7 +11,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{sensor_subsystem}->check();
$self->{disk_subsystem}->check();
if (! $self->check_messages()) {
@@ -28,7 +20,7 @@ sub check {
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
$self->{sensor_subsystem}->dump();
$self->{disk_subsystem}->dump();
}
diff --git a/plugins-scripts/Classes/SGOS/Component/MemSubsystem.pm b/plugins-scripts/Classes/SGOS/Component/MemSubsystem.pm
index de3746b2..92c7466e 100644
--- a/plugins-scripts/Classes/SGOS/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/SGOS/Component/MemSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
# https://kb.bluecoat.com/index?page=content&id=KB3069
# Memory pressure simply is the percentage of physical memory less free and reclaimable memory, of total memory. So, for example, if there is no free or reclaimable memory in the system, then memory pressure is at 100%.
# The event logs start reporting memory pressure when it is over 75%.
@@ -15,7 +15,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking memory');
$self->add_info(sprintf 'memory usage is %.2f%%',
$self->{sgProxyMemPressure});
diff --git a/plugins-scripts/Classes/SGOS/Component/SecuritySubsystem.pm b/plugins-scripts/Classes/SGOS/Component/SecuritySubsystem.pm
index 4f1837bc..f3651e5a 100644
--- a/plugins-scripts/Classes/SGOS/Component/SecuritySubsystem.pm
+++ b/plugins-scripts/Classes/SGOS/Component/SecuritySubsystem.pm
@@ -3,14 +3,14 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('ATTACK-MIB', [
['attacks', 'deviceAttackTable', 'Classes::SGOS::Component::SecuritySubsystem::Attack' ],
]);
}
sub check {
- my $self = shift;
+ my ($self) = @_;
my $errorfound = 0;
$self->add_info('checking attacks');
if (scalar (@{$self->{attacks}}) == 0) {
@@ -32,7 +32,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{deviceAttackTime} = $self->timeticks(
$self->{deviceAttackTime});
$self->{count_me} = 0;
diff --git a/plugins-scripts/Classes/SGOS/Component/SensorSubsystem.pm b/plugins-scripts/Classes/SGOS/Component/SensorSubsystem.pm
index 6b947a19..c7530c04 100644
--- a/plugins-scripts/Classes/SGOS/Component/SensorSubsystem.pm
+++ b/plugins-scripts/Classes/SGOS/Component/SensorSubsystem.pm
@@ -3,14 +3,14 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('SENSOR-MIB', [
['sensors', 'deviceSensorValueTable', 'Classes::SGOS::Component::SensorSubsystem::Sensor'],
]);
}
sub check {
- my $self = shift;
+ my ($self) = @_;
my $psus = {};
foreach my $sensor (@{$self->{sensors}}) {
if ($sensor->{deviceSensorName} =~ /^PSU\s+(\d+)\s+(.*)/) {
@@ -57,7 +57,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
if ($self->{deviceSensorScale}) {
$self->{deviceSensorValue} *= 10 ** $self->{deviceSensorScale};
}
diff --git a/plugins-scripts/Classes/SecureOS.pm b/plugins-scripts/Classes/SecureOS.pm
index 625893b5..1b482a77 100644
--- a/plugins-scripts/Classes/SecureOS.pm
+++ b/plugins-scripts/Classes/SecureOS.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Device);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
# not sure if this works fa25239716cb74c672f8dd390430dc4056caffa7
if ($self->implements_mib('FCMGMT-MIB')) {
diff --git a/plugins-scripts/Classes/Server/Linux.pm b/plugins-scripts/Classes/Server/Linux.pm
index 0704dd59..28cf525d 100644
--- a/plugins-scripts/Classes/Server/Linux.pm
+++ b/plugins-scripts/Classes/Server/Linux.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Device);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::hardware::health/) {
$self->analyze_and_check_environmental_subsystem("Classes::Server::Linux::Component::EnvironmentalSubsystem")
} elsif ($self->mode =~ /device::hardware::load/) {
diff --git a/plugins-scripts/Classes/Server/Linux/Component/CpuSubsystem.pm b/plugins-scripts/Classes/Server/Linux/Component/CpuSubsystem.pm
index 6281fa4c..9dd3d653 100644
--- a/plugins-scripts/Classes/Server/Linux/Component/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/Server/Linux/Component/CpuSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Server::Linux);
use strict;
sub new {
- my $class = shift;
+ my ($class) = @_;
my $self = {};
bless $self, $class;
$self->init();
@@ -11,7 +11,7 @@ sub new {
}
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{cpu_subsystem} =
Classes::UCDMIB::Component::CpuSubsystem->new();
$self->{load_subsystem} =
@@ -19,13 +19,13 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{cpu_subsystem}->check();
$self->{load_subsystem}->check();
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
$self->{cpu_subsystem}->dump();
$self->{load_subsystem}->dump();
}
diff --git a/plugins-scripts/Classes/Server/Linux/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Server/Linux/Component/EnvironmentalSubsystem.pm
index 0a04fc7f..d541bfef 100644
--- a/plugins-scripts/Classes/Server/Linux/Component/EnvironmentalSubsystem.pm
+++ b/plugins-scripts/Classes/Server/Linux/Component/EnvironmentalSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Server::Linux);
use strict;
sub new {
- my $class = shift;
+ my ($class) = @_;
my $self = {};
bless $self, $class;
$self->init();
@@ -11,7 +11,7 @@ sub new {
}
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{fan_subsystem} =
Classes::LMSENSORSMIB::Component::FanSubsystem->new();
$self->{temperature_subsystem} =
@@ -19,7 +19,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{fan_subsystem}->check();
$self->{temperature_subsystem}->check();
if (! $self->check_messages()) {
@@ -28,7 +28,7 @@ sub check {
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
$self->{fan_subsystem}->dump();
$self->{temperature_subsystem}->dump();
}
diff --git a/plugins-scripts/Classes/Server/Linux/Component/MemSubsystem.pm b/plugins-scripts/Classes/Server/Linux/Component/MemSubsystem.pm
index 5b1d8e1b..8cdf0d3a 100644
--- a/plugins-scripts/Classes/Server/Linux/Component/MemSubsystem.pm
+++ b/plugins-scripts/Classes/Server/Linux/Component/MemSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Classes::Server::Linux);
use strict;
sub new {
- my $class = shift;
+ my ($class) = @_;
my $self = {};
bless $self, $class;
$self->init();
@@ -11,7 +11,7 @@ sub new {
}
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{mem_subsystem} =
Classes::UCDMIB::Component::MemSubsystem->new();
$self->{swap_subsystem} =
@@ -19,13 +19,13 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->{mem_subsystem}->check();
$self->{swap_subsystem}->check();
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
$self->{mem_subsystem}->dump();
$self->{swap_subsystem}->dump();
}
diff --git a/plugins-scripts/Classes/Server/LinuxLocal.pm b/plugins-scripts/Classes/Server/LinuxLocal.pm
index f067481e..c740671f 100644
--- a/plugins-scripts/Classes/Server/LinuxLocal.pm
+++ b/plugins-scripts/Classes/Server/LinuxLocal.pm
@@ -4,7 +4,7 @@ use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::interfaces/) {
$self->analyze_and_check_interface_subsystem('Server::LinuxLocal::Component::InterfaceSubsystem');
}
@@ -16,7 +16,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{interfaces} = [];
if ($self->mode =~ /device::interfaces::list/) {
foreach (glob "/sys/class/net/*") {
@@ -77,7 +77,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking interfaces');
if (scalar(@{$self->{interfaces}}) == 0) {
$self->add_unknown('no interfaces');
@@ -100,7 +100,7 @@ our @ISA = qw(Classes::IFMIB::Component::InterfaceSubsystem::Interface);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
if (! defined $self->{ifSpeed} && $self->mode =~ /device::interfaces::(complete|usage)/) {
bless $self, 'Server::LinuxLocal::Component::InterfaceSubsystem::Interface::Virt';
}
@@ -112,7 +112,7 @@ our @ISA = qw(Server::LinuxLocal::Component::InterfaceSubsystem::Interface);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
if (! defined $self->{ifSpeed}) {
if (defined $self->opts->mitigation && $self->opts->mitigation eq 'ok') {
$self->{ifSpeed} = $self->{sysMaxSpeed};
diff --git a/plugins-scripts/Classes/Server/SolarisLocal.pm b/plugins-scripts/Classes/Server/SolarisLocal.pm
index bbeba365..2b25047b 100644
--- a/plugins-scripts/Classes/Server/SolarisLocal.pm
+++ b/plugins-scripts/Classes/Server/SolarisLocal.pm
@@ -4,7 +4,7 @@ use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::interfaces/) {
$self->analyze_and_check_interface_subsystem('Server::SolarisLocal::Component::InterfaceSubsystem');
}
@@ -16,7 +16,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub packet_size {
- my $stats = shift;
+ my ($stats) = @_;
if (defined $stats->{opackets64} && $stats->{opackets64} != 0 && defined $stats->{obytes64}) {
return int($stats->{obytes64} / $stats->{opackets64});
} elsif (defined $stats->{ipackets64} && $stats->{ipackets64} != 0 && defined $stats->{rbytes64}) {
@@ -31,7 +31,7 @@ sub packet_size {
}
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{kstat} = Sun::Solaris::Kstat->new();
$self->{interfaces} = [];
$self->{kstat_interfaces} = {};
@@ -111,7 +111,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking interfaces');
if (scalar(@{$self->{interfaces}}) == 0) {
$self->add_unknown('no interfaces');
@@ -133,7 +133,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
foreach (qw(ifSpeed ifInOctets ifInDiscards ifInErrors ifOutOctets ifOutDiscards ifOutErrors ifSnapTime)) {
$self->{$_} = 0 if ! defined $self->{$_};
}
@@ -216,7 +216,7 @@ sub finish {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::interfaces::complete/) {
# uglatto, but $self->mode is an lvalue
$Monitoring::GLPlugin::mode = "device::interfaces::operstatus";
@@ -337,7 +337,7 @@ sub check {
}
sub list {
- my $self = shift;
+ my ($self) = @_;
printf "%s\n", $self->{ifDescr};
}
diff --git a/plugins-scripts/Classes/Server/WindowsLocal.pm b/plugins-scripts/Classes/Server/WindowsLocal.pm
index 6ab05b4a..f1645335 100644
--- a/plugins-scripts/Classes/Server/WindowsLocal.pm
+++ b/plugins-scripts/Classes/Server/WindowsLocal.pm
@@ -4,7 +4,7 @@ use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::interfaces/) {
$self->analyze_and_check_interface_subsystem('Server::WindowsLocal::Component::InterfaceSubsystem');
}
@@ -43,7 +43,7 @@ printf "dong\n";
}
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{interfaces} = [];
# bits per second
if ($self->mode =~ /device::interfaces::list/) {
@@ -166,7 +166,7 @@ $self->debug("finish");
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking interfaces');
if (scalar(@{$self->{interfaces}}) == 0) {
$self->add_unknown('no interfaces');
@@ -189,7 +189,7 @@ our @ISA = qw(Classes::IFMIB::Component::InterfaceSubsystem::Interface);
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
# NetEnabled 1=admin up
# NetConnectionStatus Disconnected (0)Connecting (1)Connected (2)Disconnecting (3)Hardware Not Present (4)Hardware Disabled (5)Hardware Malfunction (6)Media Disconnected (7)Authenticating (8)Authentication Succeeded (9)Authentication Failed (10)Invalid Address (11)Credentials Required (12)Other (13–65535)
$self->SUPER::finish();
diff --git a/plugins-scripts/Classes/UCDMIB.pm b/plugins-scripts/Classes/UCDMIB.pm
index e2483ee2..1ab61e52 100644
--- a/plugins-scripts/Classes/UCDMIB.pm
+++ b/plugins-scripts/Classes/UCDMIB.pm
@@ -2,3 +2,19 @@ package Classes::UCDMIB;
our @ISA = qw(Classes::Device);
use strict;
+sub init {
+ my ($self) = @_;
+ if ($self->mode =~ /device::hardware::health/) {
+ $self->analyze_and_check_environmental_subsystem("Classes::UCDMIB::Component::DiskSubsystem");
+ $self->analyze_and_check_environmental_subsystem("Classes::LMSENSORSMIB::Component::EnvironmentalSubsystem");
+ } elsif ($self->mode =~ /device::hardware::load/) {
+ $self->analyze_and_check_cpu_subsystem("Classes::UCDMIB::Component::CpuSubsystem");
+ $self->analyze_and_check_load_subsystem("Classes::UCDMIB::Component::LoadSubsystem");
+ } elsif ($self->mode =~ /device::hardware::memory/) {
+ $self->analyze_and_check_mem_subsystem("Classes::UCDMIB::Component::MemSubsystem");
+ $self->analyze_and_check_swap_subsystem("Classes::UCDMIB::Component::SwapSubsystem");
+ } else {
+ $self->no_such_mode();
+ }
+}
+
diff --git a/plugins-scripts/Classes/UCDMIB/Components/CpuSubsystem.pm b/plugins-scripts/Classes/UCDMIB/Components/CpuSubsystem.pm
index 3c5b65ae..8d242f66 100644
--- a/plugins-scripts/Classes/UCDMIB/Components/CpuSubsystem.pm
+++ b/plugins-scripts/Classes/UCDMIB/Components/CpuSubsystem.pm
@@ -3,19 +3,22 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
+ my @all_cpu_metrics = qw(
+ ssCpuRawUser ssCpuRawSystem ssCpuRawIdle ssCpuRawNice
+ ssCpuRawWait ssCpuRawKernel ssCpuRawInterrupt
+ );
$self->get_snmp_objects('UCD-SNMP-MIB', (qw(
ssCpuUser ssCpuSystem ssCpuIdle ssCpuRawUser ssCpuRawSystem ssCpuRawIdle
ssCpuRawNice ssCpuRawWait ssCpuRawKernel ssCpuRawInterrupt)));
- $self->valdiff({name => 'cpu'}, qw(
- ssCpuRawUser ssCpuRawSystem ssCpuRawIdle ssCpuRawNice ssCpuRawWait
- ssCpuRawKernel ssCpuRawInterrupt));
+ @all_cpu_metrics = grep {
+ # not every kernel/snmpd supports every counter
+ defined $self->{$_};
+ } @all_cpu_metrics;
+ $self->valdiff({name => 'cpu'}, @all_cpu_metrics);
my $cpu_total = 0;
- # not every kernel/snmpd supports every counters
- foreach (qw(delta_ssCpuRawUser delta_ssCpuRawSystem delta_ssCpuRawIdle
- delta_ssCpuRawNice delta_ssCpuRawWait delta_ssCpuRawKernel
- delta_ssCpuRawInterrupt)) {
- $cpu_total += $self->{$_} if defined($self->{$_});
+ foreach (@all_cpu_metrics) {
+ $cpu_total += $self->{'delta_'.$_};
}
# main cpu usage (total - idle)
@@ -50,11 +53,11 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking cpus');
foreach (qw(cpu user system nice wait kernel interrupt)) {
my $key = $_ . '_usage';
- if (defined($self->{$key})) {
+ if (exists $self->{$key}) {
$self->add_info(sprintf '%s: %.2f%%',
$_ . ($_ eq 'cpu' ? ' (total)' : ''),
$self->{$key});
diff --git a/plugins-scripts/Classes/UCDMIB/Components/DiskSubsystem.pm b/plugins-scripts/Classes/UCDMIB/Components/DiskSubsystem.pm
index 8baea7b7..48fc91eb 100644
--- a/plugins-scripts/Classes/UCDMIB/Components/DiskSubsystem.pm
+++ b/plugins-scripts/Classes/UCDMIB/Components/DiskSubsystem.pm
@@ -3,11 +3,11 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('UCD-SNMP-MIB', [
['disks', 'dskTable', 'Classes::UCDMIB::Component::DiskSubsystem::Disk',
sub {
- my $self = shift;
+ my ($self) = @_;
# limit disk checks to specific disks. could be improvied by
# checking the path first and then request the table by indizes
if ($self->opts->name) {
@@ -28,7 +28,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking disks');
if (scalar(@{$self->{disks}}) == 0) {
$self->add_unknown('no disks');
@@ -44,7 +44,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
# use 32bit counter first
my $avail = $self->{dskAvail};
diff --git a/plugins-scripts/Classes/UCDMIB/Components/LoadSubsystem.pm b/plugins-scripts/Classes/UCDMIB/Components/LoadSubsystem.pm
index 22f34cfa..324c6b29 100644
--- a/plugins-scripts/Classes/UCDMIB/Components/LoadSubsystem.pm
+++ b/plugins-scripts/Classes/UCDMIB/Components/LoadSubsystem.pm
@@ -3,16 +3,14 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
- my %params = @_;
- my $type = 0;
+ my ($self) = @_;
$self->get_snmp_tables('UCD-SNMP-MIB', [
['loads', 'laTable', 'Classes::UCDMIB::Component::LoadSubsystem::Load'],
]);
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking loads');
foreach (@{$self->{loads}}) {
$_->check();
@@ -20,7 +18,7 @@ sub check {
}
sub dump {
- my $self = shift;
+ my ($self) = @_;
foreach (@{$self->{loads}}) {
$_->dump();
}
@@ -33,7 +31,7 @@ use strict;
use Data::Dumper;
sub check {
- my $self = shift;
+ my ($self) = @_;
my $errorfound = 0;
$self->set_thresholds(
metric => lc $self->{laNames},
diff --git a/plugins-scripts/Classes/UCDMIB/Components/MemSubsystem.pm b/plugins-scripts/Classes/UCDMIB/Components/MemSubsystem.pm
index 14952d64..45424e0b 100644
--- a/plugins-scripts/Classes/UCDMIB/Components/MemSubsystem.pm
+++ b/plugins-scripts/Classes/UCDMIB/Components/MemSubsystem.pm
@@ -3,15 +3,15 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('UCD-SNMP-MIB', (qw(
- memTotalSwap memAvailSwap memTotalReal memAvailReal memBuffer memCached
- memMinimumSwap memSwapError memSwapErrorMsg)));
+ memTotalSwap memTotalReal memTotalFree memAvailReal
+ memBuffer memCached memShared)));
# basically buffered memory can always be freed up (filesystem cache)
# https://kc.mcafee.com/corporate/index?page=content&id=KB73175
my $mem_available = $self->{memAvailReal};
- foreach (qw(memBuffer memCached)) {
+ foreach (qw(memBuffer memCached memShared)) {
$mem_available += $self->{$_} if defined($self->{$_});
}
@@ -20,7 +20,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking memory');
if (defined $self->{mem_usage}) {
$self->add_info(sprintf 'memory usage is %.2f%%',
diff --git a/plugins-scripts/Classes/UCDMIB/Components/ProcessSubsystem.pm b/plugins-scripts/Classes/UCDMIB/Components/ProcessSubsystem.pm
index 8c59b3f4..d9c82195 100644
--- a/plugins-scripts/Classes/UCDMIB/Components/ProcessSubsystem.pm
+++ b/plugins-scripts/Classes/UCDMIB/Components/ProcessSubsystem.pm
@@ -3,11 +3,11 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_tables('UCD-SNMP-MIB', [
['processes', 'prTable', 'Classes::UCDMIB::Component::ProcessSubsystem::Process',
sub {
- my $self = shift;
+ my ($self) = @_;
# limit process checks to specific names. could be improvied by
# checking the names first and then request the table by indizes
if ($self->opts->name) {
@@ -27,7 +27,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking processes');
if (scalar(@{$self->{processes}}) == 0) {
$self->add_unknown('no processes');
@@ -43,7 +43,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem);
use strict;
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info(sprintf '%s: %d%s',
$self->{prNames},
$self->{prCount},
diff --git a/plugins-scripts/Classes/UCDMIB/Components/SwapSubsystem.pm b/plugins-scripts/Classes/UCDMIB/Components/SwapSubsystem.pm
index 82dfee44..966d2aef 100644
--- a/plugins-scripts/Classes/UCDMIB/Components/SwapSubsystem.pm
+++ b/plugins-scripts/Classes/UCDMIB/Components/SwapSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item);
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->get_snmp_objects('UCD-SNMP-MIB', (qw(
memTotalSwap memAvailSwap memMinimumSwap
memSwapError memSwapErrorMsg)));
@@ -12,10 +12,12 @@ sub init {
eval {
$self->{swap_usage} = 100 - ($self->{memAvailSwap} * 100 / $self->{memTotalSwap});
};
+ # exception if memTotalSwap = 0, which means that no swap partition/device
+ # was configured at all
}
sub check {
- my $self = shift;
+ my ($self) = @_;
if (defined $self->{'swap_usage'}) {
$self->add_info(sprintf 'swap usage is %.2f%%',
$self->{swap_usage});
diff --git a/plugins-scripts/Classes/UPNP/AVM.pm b/plugins-scripts/Classes/UPNP/AVM.pm
index 084971f2..e82ab70e 100644
--- a/plugins-scripts/Classes/UPNP/AVM.pm
+++ b/plugins-scripts/Classes/UPNP/AVM.pm
@@ -3,8 +3,8 @@ our @ISA = qw(Classes::UPNP);
use strict;
sub init {
- my $self = shift;
- if ($self->{productname} =~ /7390/) {
+ my ($self) = @_;
+ if ($self->{productname} =~ /(7390|7490)/) {
bless $self, 'Classes::UPNP::AVM::FritzBox7390';
$self->debug('using Classes::UPNP::AVM::FritzBox7390');
} elsif ($self->{productname} =~ /7490/) {
@@ -13,6 +13,9 @@ sub init {
} elsif ($self->{productname} =~ /6490/) {
bless $self, 'Classes::UPNP::AVM::FritzBox7390';
$self->debug('using Classes::UPNP::AVM::FritzBox7390');
+ } elsif ($self->{productname} =~ /7412/) {
+ bless $self, 'Classes::UPNP::AVM::FritzBox7390';
+ $self->debug('using Classes::UPNP::AVM::FritzBox7390');
} else {
$self->no_such_model();
}
diff --git a/plugins-scripts/Classes/UPNP/AVM/FritzBox7390.pm b/plugins-scripts/Classes/UPNP/AVM/FritzBox7390.pm
index 257374b9..ffc1e1dc 100644
--- a/plugins-scripts/Classes/UPNP/AVM/FritzBox7390.pm
+++ b/plugins-scripts/Classes/UPNP/AVM/FritzBox7390.pm
@@ -7,12 +7,12 @@ use strict;
}
sub sid : lvalue {
- my $self = shift;
+ my ($self) = @_;
$Classes::UPNP::AVM::FritzBox7390::sid;
}
sub init {
- my $self = shift;
+ my ($self) = @_;
foreach my $module (qw(HTML::TreeBuilder LWP::UserAgent Encode Digest::MD5 JSON)) {
if (! eval "require $module") {
$self->add_unknown("could not find $module module");
@@ -44,7 +44,7 @@ sub init {
}
sub login {
- my $self = shift;
+ my ($self) = @_;
my $ua = LWP::UserAgent->new;
my $loginurl = sprintf "http://%s/login_sid.lua", $self->opts->hostname;
my $resp = $ua->get($loginurl);
@@ -71,7 +71,7 @@ sub login {
}
sub logout {
- my $self = shift;
+ my ($self) = @_;
return if ! $self->sid();
my $ua = LWP::UserAgent->new;
my $loginurl = sprintf "http://%s/login_sid.lua", $self->opts->hostname;
@@ -85,13 +85,12 @@ sub logout {
}
sub DESTROY {
- my $self = shift;
+ my ($self) = @_;
$self->logout();
}
sub http_get {
- my $self = shift;
- my $page = shift;
+ my ($self, $page) = @_;
my $ua = LWP::UserAgent->new;
if ($page =~ /\?/) {
$page .= "&sid=".$self->sid();
@@ -109,7 +108,7 @@ sub http_get {
}
sub analyze_cpu_subsystem {
- my $self = shift;
+ my ($self) = @_;
my $html = $self->http_get('system/ecostat.lua');
if ($html =~ /uiSubmitLogin/) {
$self->add_critical("wrong login");
@@ -125,7 +124,7 @@ sub analyze_cpu_subsystem {
}
sub analyze_mem_subsystem {
- my $self = shift;
+ my ($self) = @_;
my $html = $self->http_get('system/ecostat.lua');
if ($html =~ /uiSubmitLogin/) {
$self->add_critical("wrong login");
@@ -153,7 +152,7 @@ sub analyze_mem_subsystem {
}
sub check_cpu_subsystem {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking cpus');
$self->add_info(sprintf 'cpu usage is %.2f%%', $self->{cpu_usage});
$self->set_thresholds(warning => 40, critical => 60);
@@ -168,7 +167,7 @@ sub check_cpu_subsystem {
}
sub check_mem_subsystem {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking memory');
$self->add_info(sprintf 'memory usage is %.2f%%', $self->{ram_used});
$self->set_thresholds(warning => 80, critical => 90);
diff --git a/plugins-scripts/Classes/UPNP/AVM/FritzBox7390/Components/InterfaceSubsystem.pm b/plugins-scripts/Classes/UPNP/AVM/FritzBox7390/Components/InterfaceSubsystem.pm
index cdde674c..88f04e92 100644
--- a/plugins-scripts/Classes/UPNP/AVM/FritzBox7390/Components/InterfaceSubsystem.pm
+++ b/plugins-scripts/Classes/UPNP/AVM/FritzBox7390/Components/InterfaceSubsystem.pm
@@ -4,7 +4,7 @@ use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::interfaces/) {
$self->{ifDescr} = "WAN";
my $service = (grep { $_->{serviceId} =~ /WANIPConn1/ } @{$self->get_variable('services')})[0];
@@ -78,7 +78,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking interfaces');
if ($self->mode =~ /device::interfaces::usage/) {
$self->add_info(sprintf 'interface %s usage is in:%.2f%% (%s) out:%.2f%% (%s)',
diff --git a/plugins-scripts/Classes/UPNP/AVM/FritzBox7390/Components/SmartHomeSubsystem.pm b/plugins-scripts/Classes/UPNP/AVM/FritzBox7390/Components/SmartHomeSubsystem.pm
index 6c50d954..670d69a2 100644
--- a/plugins-scripts/Classes/UPNP/AVM/FritzBox7390/Components/SmartHomeSubsystem.pm
+++ b/plugins-scripts/Classes/UPNP/AVM/FritzBox7390/Components/SmartHomeSubsystem.pm
@@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item Classes::UPNP::AVM::FritzBox7390)
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /smarthome::device::list/) {
$self->update_device_cache(1);
foreach my $ain (keys %{$self->{device_cache}}) {
@@ -26,14 +26,14 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
foreach (@{$self->{smart_home_devices}}) {
$_->check();
}
}
sub create_device_cache_file {
- my $self = shift;
+ my ($self) = @_;
my $extension = "";
if ($self->opts->community) {
$extension .= Digest::MD5::md5_hex($self->opts->community);
@@ -48,8 +48,7 @@ sub create_device_cache_file {
}
sub update_device_cache {
- my $self = shift;
- my $force = shift;
+ my ($self, $force) = @_;
my $statefile = $self->create_device_cache_file();
my $update = time - 3600;
if ($force || ! -f $statefile || ((stat $statefile)[9]) < ($update)) {
@@ -69,7 +68,7 @@ sub update_device_cache {
}
sub save_device_cache {
- my $self = shift;
+ my ($self) = @_;
$self->create_statefilesdir();
my $statefile = $self->create_device_cache_file();
my $tmpfile = $self->statefilesdir().'/check_nwc_health_tmp_'.$$;
@@ -84,7 +83,7 @@ sub save_device_cache {
}
sub load_device_cache {
- my $self = shift;
+ my ($self) = @_;
my $statefile = $self->create_device_cache_file();
if ( -f $statefile) {
our $VAR1;
@@ -92,7 +91,7 @@ sub load_device_cache {
require $statefile;
};
if($@) {
- printf "rumms\n";
+ printf "FATAL: Could not load cache!\n";
}
$self->debug(sprintf "load %s", Data::Dumper::Dumper($VAR1));
$self->{device_cache} = $VAR1;
@@ -111,7 +110,7 @@ sub load_device_cache {
}
sub get_device_indices {
- my $self = shift;
+ my ($self) = @_;
my @indices = ();
foreach my $id (keys %{$self->{device_cache}}) {
my $name = $self->{device_cache}->{$id}->{name};
@@ -145,7 +144,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem Classes::UPNP::AVM::FritzBox
use strict;
sub finish {
- my $self = shift;
+ my ($self) = @_;
$self->{cometdect} = ($self->{functionbitmask} & 0b000001000000) ? 1 : 0;
$self->{energy} = ($self->{functionbitmask} & 0b000010000000) ? 1 : 0;
$self->{temperature} = ($self->{functionbitmask} & 0b000100000000) ? 1 : 0;
@@ -175,7 +174,7 @@ sub finish {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
my $label = $self->{name};
if ($self->mode =~ /smarthome::device::status/) {
$self->add_info(sprintf "device %s is %sconnected and switched %s",
diff --git a/plugins-scripts/Classes/VRRPMIB/Component/VRRPSubsystem.pm b/plugins-scripts/Classes/VRRPMIB/Component/VRRPSubsystem.pm
index 29434ee4..db677a4e 100644
--- a/plugins-scripts/Classes/VRRPMIB/Component/VRRPSubsystem.pm
+++ b/plugins-scripts/Classes/VRRPMIB/Component/VRRPSubsystem.pm
@@ -4,7 +4,7 @@ use Data::Dumper;
use strict;
sub init {
- my $self = shift;
+ my ($self) = @_;
$self->{groups} = [];
$self->{assoc} = ();
if ($self->mode =~ /device::vrrp/) {
@@ -32,7 +32,7 @@ sub init {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
$self->add_info('checking vrrp groups');
if ($self->mode =~ /device::vrrp::list/) {
foreach (@{$self->{groups}}) {
@@ -56,10 +56,9 @@ use strict;
use Data::Dumper;
sub finish {
- my $self = shift;
- my %params = @_;
- $self->{ifIndex} = $params{indices}->[0];
- $self->{vrrpGrpNumber} = $params{indices}->[1];
+ my ($self) = @_;
+ $self->{ifIndex} = $self->{indices}->[0];
+ $self->{vrrpGrpNumber} = $self->{indices}->[1];
$self->{name} = $self->{vrrpGrpNumber}.':'.$self->{ifIndex};
if ($self->mode =~ /device::vrrp::state/) {
if (! $self->opts->role()) {
@@ -70,7 +69,7 @@ sub finish {
}
sub check {
- my $self = shift;
+ my ($self) = @_;
if ($self->mode =~ /device::vrrp::state/) {
$self->add_info(sprintf 'vrrp group %s (interface %s) state is %s (active router is %s)',
$self->{vrrpGrpNumber}, $self->{ifIndex},
@@ -110,7 +109,7 @@ sub check {
}
}
sub list {
- my $self = shift;
+ my ($self) = @_;
printf "name(grp:if)=%s state=%s/%s master=%s ips=%s\n",
$self->{name}, $self->{vrrpOperState}, $self->{vrrpOperAdminState},
$self->{vrrpOperMasterIpAddr},
diff --git a/plugins-scripts/Makefile.am b/plugins-scripts/Makefile.am
index a0b0bfa3..9caa8582 100644
--- a/plugins-scripts/Makefile.am
+++ b/plugins-scripts/Makefile.am
@@ -10,6 +10,7 @@ GL_MODULES=\
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/MIB2MIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/SNMPFRAMEWORKMIB.pm \
+ ../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/ADSLLINEMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/AIRESPACESWITCHINGMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/AIRESPACEWIRELESSMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/ALARMMIB.pm \
@@ -42,6 +43,7 @@ GL_MODULES=\
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/CISCOLWAPPHAMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/CISCOMEMORYPOOLMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/CISCOPORTCHANNELMIB.pm \
+ ../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/CISCOPORTSECURITYMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/CISCOPROCESSMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/CISCOSBHWENVIROMENTMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/CISCOSBRNDMNGMIB.pm \
@@ -64,19 +66,26 @@ GL_MODULES=\
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/FCEOSMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/FCMGMTMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/FIBRECHANNELFEMIB.pm \
+ ../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/FORTINETCOREMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/FORTINETFORTIGATEMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/FOUNDRYSNAGENTMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/FOUNDRYSNSWL4SWITCHGROUPMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/GENUAMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/HH3CENTITYEXTMIB.pm \
+ ../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/HUAWEIENTITYEXTENTMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/HOSTRESOURCESMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/HPICFCHASSISMIB.pm \
+ ../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/IANAIFTYPEMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/IEEE8023LAGMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/IFMIB.pm \
+ ../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/INETADDRESSMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/IPFORWARDMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/IPMIB.pm \
+ ../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/JUNIPERALARMMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/JUNIPERMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/JUNIPERIVEMIB.pm \
+ ../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/JUNIPERRPSMIB.pm \
+ ../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/JUNIPERSRX5000SPUMONITORINGMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/JUNOSBGP4V2MIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/LARAMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/LCOSMIB.pm \
@@ -99,6 +108,7 @@ GL_MODULES=\
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/OPENBSDPFMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/OPENBSDSENSORSMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/OSPFMIB.pm \
+ ../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/OSPFV3MIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/PANCOMMONMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/PANPRODUCTSMIB.pm \
../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/PROXYMIB.pm \
@@ -142,6 +152,7 @@ EXTRA_MODULES=\
Classes/Bintec/Bibo/Components/CpuSubsystem.pm \
Classes/Bintec/Bibo.pm \
Classes/Bintec.pm \
+ Classes/Cisco/CISCOPORTSECURITYMIB/Component/InterfaceSubsystem.pm \
Classes/Cisco/OLDCISCOINTERFACESMIB/Component/InterfaceSubsystem.pm \
Classes/Cisco/CISCOIPSECFLOWMONITOR/Component/VpnSubsystem.pm \
Classes/Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm \
@@ -173,6 +184,7 @@ EXTRA_MODULES=\
Classes/Cisco/NXOS/Component/EnvironmentalSubsystem.pm \
Classes/Cisco/NXOS/Component/FexSubsystem.pm \
Classes/Cisco/NXOS.pm \
+ Classes/Cisco/WLC/Component/HaSubsystem.pm \
Classes/Cisco/WLC/Component/MemSubsystem.pm \
Classes/Cisco/WLC/Component/CpuSubsystem.pm \
Classes/Cisco/WLC/Component/EnvironmentalSubsystem.pm \
@@ -225,6 +237,7 @@ EXTRA_MODULES=\
Classes/Juniper/SRX.pm \
Classes/Juniper.pm \
Classes/AlliedTelesyn.pm \
+ Classes/Fortigate/Component/HaSubsystem.pm \
Classes/Fortigate/Component/DiskSubsystem.pm \
Classes/Fortigate/Component/MemSubsystem.pm \
Classes/Fortigate/Component/CpuSubsystem.pm \
@@ -268,6 +281,7 @@ EXTRA_MODULES=\
Classes/IPMIB.pm \
Classes/VRRPMIB/Component/VRRPSubsystem.pm \
Classes/VRRPMIB.pm \
+ Classes/HOSTRESOURCESMIB/Component/ClockSubsystem.pm \
Classes/HOSTRESOURCESMIB/Component/DeviceSubsystem.pm \
Classes/HOSTRESOURCESMIB/Component/DiskSubsystem.pm \
Classes/HOSTRESOURCESMIB/Component/EnvironmentalSubsystem.pm \
@@ -298,15 +312,18 @@ EXTRA_MODULES=\
Classes/UCDMIB/Components/DiskSubsystem.pm \
Classes/UCDMIB/Components/ProcessSubsystem.pm \
Classes/UCDMIB.pm \
+ Classes/F5/F5BIGIP/Component/ConfigSubsystem.pm \
+ Classes/F5/F5BIGIP/Component/ConnectionSubsystem.pm \
+ Classes/F5/F5BIGIP/Component/CpuSubsystem.pm \
+ Classes/F5/F5BIGIP/Component/DiskSubsystem.pm \
+ Classes/F5/F5BIGIP/Component/EnvironmentalSubsystem.pm \
+ Classes/F5/F5BIGIP/Component/FanSubsystem.pm \
Classes/F5/F5BIGIP/Component/GTM.pm \
+ Classes/F5/F5BIGIP/Component/HaSubsystem.pm \
Classes/F5/F5BIGIP/Component/LTM.pm \
- Classes/F5/F5BIGIP/Component/DiskSubsystem.pm \
Classes/F5/F5BIGIP/Component/MemSubsystem.pm \
Classes/F5/F5BIGIP/Component/PowersupplySubsystem.pm \
Classes/F5/F5BIGIP/Component/TemperatureSubsystem.pm \
- Classes/F5/F5BIGIP/Component/CpuSubsystem.pm \
- Classes/F5/F5BIGIP/Component/FanSubsystem.pm \
- Classes/F5/F5BIGIP/Component/EnvironmentalSubsystem.pm \
Classes/F5/F5BIGIP.pm \
Classes/F5.pm \
Classes/CheckPoint/Firewall1/Component/EnvironmentalSubsystem.pm \
@@ -398,6 +415,11 @@ EXTRA_MODULES=\
Classes/Lancom/Component/EnvironmentalSubsystem.pm \
Classes/Lancom/Component/MemSubsystem.pm \
Classes/Lancom.pm \
+ Classes/DrayTek/Vigor/Component/CpuSubsystem.pm \
+ Classes/DrayTek/Vigor/Component/EnvironmentalSubsystem.pm \
+ Classes/DrayTek/Vigor/Component/MemSubsystem.pm \
+ Classes/DrayTek/Vigor.pm \
+ Classes/DrayTek.pm \
Classes/Device.pm
SED=/bin/sed
diff --git a/plugins-scripts/check_nwc_health.pl b/plugins-scripts/check_nwc_health.pl
index 8fda805b..ccf7076c 100644
--- a/plugins-scripts/check_nwc_health.pl
+++ b/plugins-scripts/check_nwc_health.pl
@@ -76,6 +76,12 @@
alias => undef,
help => 'Check the status of interfaces (oper/admin)',
);
+$plugin->add_mode(
+ internal => 'device::interfaces::duplex',
+ spec => 'interface-duplex',
+ alias => undef,
+ help => 'Check if interfaces operate in duplex mode',
+);
$plugin->add_mode(
internal => 'device::interfaces::complete',
spec => 'interface-health',
@@ -136,6 +142,18 @@
alias => undef,
help => 'Check the ethernet statistics of interfaces',
);
+$plugin->add_mode(
+ internal => 'device::interfaces::uptime',
+ spec => 'interface-uptime',
+ alias => undef,
+ help => 'Check state changes of interfaces',
+);
+$plugin->add_mode(
+ internal => 'device::interfaces::portsecurity',
+ spec => 'interface-security',
+ alias => undef,
+ help => 'Check interfaces for security violations',
+);
$plugin->add_mode(
internal => 'device::routes::list',
spec => 'list-routes',
@@ -479,6 +497,7 @@
alias => undef,
help => 'Show the temperature measured by a Fritz! compatible device',
);
+$plugin->add_default_modes();
$plugin->add_snmp_modes();
$plugin->add_snmp_args();
$plugin->add_default_args();