From 2bc5c98a1f151be70df6196f4ea81d65dcf598fc Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Wed, 13 Dec 2017 17:00:32 +0100 Subject: [PATCH 01/82] fix cisco wlc firmware bug --- .../Classes/Cisco/WLC/Component/WlanSubsystem.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins-scripts/Classes/Cisco/WLC/Component/WlanSubsystem.pm b/plugins-scripts/Classes/Cisco/WLC/Component/WlanSubsystem.pm index e09203bd..1a1ae80f 100644 --- a/plugins-scripts/Classes/Cisco/WLC/Component/WlanSubsystem.pm +++ b/plugins-scripts/Classes/Cisco/WLC/Component/WlanSubsystem.pm @@ -21,6 +21,7 @@ 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(); } } @@ -127,6 +128,12 @@ sub assign_loads_to_ifs { 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; + } } } From 1fa17c5a08876aaf5a3ee93f1386441a8f8d0bcf Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Wed, 13 Dec 2017 17:00:52 +0100 Subject: [PATCH 02/82] fix again a ucd pull-request --- .../Classes/UCDMIB/Components/CpuSubsystem.pm | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/plugins-scripts/Classes/UCDMIB/Components/CpuSubsystem.pm b/plugins-scripts/Classes/UCDMIB/Components/CpuSubsystem.pm index 3c5b65ae..da3e42a1 100644 --- a/plugins-scripts/Classes/UCDMIB/Components/CpuSubsystem.pm +++ b/plugins-scripts/Classes/UCDMIB/Components/CpuSubsystem.pm @@ -4,18 +4,21 @@ use strict; sub init { my $self = shift; + 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) @@ -54,7 +57,7 @@ sub check { $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}); From 2f2b97612cdeef085e5a84eb08ae40c565d8a0c7 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Thu, 14 Dec 2017 11:47:11 +0100 Subject: [PATCH 03/82] update glplugin --- ChangeLog | 2 ++ GLPlugin | 2 +- configure.ac | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 54078d28..9d394598 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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..482c8765 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit 5abb5d9e321465d79d132c92aebcc9201b595d34 +Subproject commit 482c87656eae03fe7b18a8d09109ee5dded408eb diff --git a/configure.ac b/configure.ac index 03dbc914..7ec57718 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,6.4.3.1) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST From 5f51acf89695cffd2f46c2652d858439d7da9680 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Thu, 14 Dec 2017 11:57:08 +0100 Subject: [PATCH 04/82] update glplugin --- GLPlugin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GLPlugin b/GLPlugin index 482c8765..35c806e9 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit 482c87656eae03fe7b18a8d09109ee5dded408eb +Subproject commit 35c806e90fff02369252960248d28125987bd9f0 From 989d2492ccf26296f5bbe1c573e9a679938b9307 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Thu, 14 Dec 2017 15:46:33 +0100 Subject: [PATCH 05/82] update glplugin --- ChangeLog | 2 ++ GLPlugin | 2 +- configure.ac | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9d394598..6c6e2236 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 2017-12-14 6.4.3.2 + update glplugin * 2017-12-14 6.4.3.1 update glplugin * 2017-12-12 6.4.3 diff --git a/GLPlugin b/GLPlugin index 35c806e9..a09ab0a3 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit 35c806e90fff02369252960248d28125987bd9f0 +Subproject commit a09ab0a3abebbc65f8b48b4a2d6bf3606aaf66ca diff --git a/configure.ac b/configure.ac index 7ec57718..150fae1a 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.1) +AC_INIT(check_nwc_health,6.4.3.2) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST From 848f0afa1062bd7db084c03fba58d9ab193313dc Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Wed, 20 Dec 2017 21:14:39 +0100 Subject: [PATCH 06/82] checkpoint zeugs --- plugins-scripts/Classes/CheckPoint.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins-scripts/Classes/CheckPoint.pm b/plugins-scripts/Classes/CheckPoint.pm index 8765617e..35f53be7 100644 --- a/plugins-scripts/Classes/CheckPoint.pm +++ b/plugins-scripts/Classes/CheckPoint.pm @@ -8,7 +8,8 @@ use constant trees => ( sub init { my $self = shift; - if (defined $self->get_snmp_object('CHECKPOINT-MIB', 'vsxVsInstalled')) { + 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) { From 15c1494edc31d964ed1c695d75247ea38c96a840 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Wed, 20 Dec 2017 21:14:56 +0100 Subject: [PATCH 07/82] duplex zeugs --- ChangeLog | 2 + GLPlugin | 2 +- configure.ac | 2 +- .../IFMIB/Component/InterfaceSubsystem.pm | 130 ++++++++++++++---- plugins-scripts/check_nwc_health.pl | 6 + 5 files changed, 115 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6c6e2236..517b40c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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 diff --git a/GLPlugin b/GLPlugin index a09ab0a3..848daf0b 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit a09ab0a3abebbc65f8b48b4a2d6bf3606aaf66ca +Subproject commit 848daf0b1a0a9f7c330027e6a731c533bcf2feb8 diff --git a/configure.ac b/configure.ac index 150fae1a..4f5b8d67 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.2) +AC_INIT(check_nwc_health,6.4.3.3) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST diff --git a/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm b/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm index cf77eafc..81e18fed 100644 --- a/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm +++ b/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm @@ -113,6 +113,13 @@ sub init { etherStatsDataSource )); } + } elsif ($self->mode =~ /device::interfaces::duplex/) { + push(@iftable_columns, qw( + ifType ifSpeed ifOperStatus ifAdminStatus ifHighSpeed + )); + push(@ethertable_columns, qw( + dot3StatsDuplexStatus + )); } else { @iftable_columns = (); } @@ -212,7 +219,7 @@ 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}) { @@ -226,7 +233,7 @@ 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}) { @@ -286,7 +293,36 @@ 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'); + } + } elsif ($self->mode =~ /device::interfaces::duplex/) { + @indices = @save_indices; + my @etherindices = (); + my @etherhcindices = (); + foreach my $interface (@{$self->{interfaces}}) { + push(@selected_indices, [$interface->{ifIndex}]); + if (@ethertablehc_columns && $interface->{ifSpeed} == 4294967295) { + push(@etherhcindices, [$interface->{ifIndex}]); + } + push(@etherindices, [$interface->{ifIndex}]); + } + $self->debug( + sprintf 'all_interfaces %d, selected %d, ether %d, etherhc %d', + scalar(@all_indices), scalar(@selected_indices), + scalar(@etherindices), scalar(@etherhcindices)); + if (@ethertable_columns) { + foreach my $etherstat ($self->get_snmp_table_objects( + '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}}, @ethertable_columns); + last; + } + } + } } } } @@ -592,28 +628,31 @@ 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/) { + } 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(); } @@ -768,6 +807,26 @@ sub init_etherstats { 100 * $self->{'delta_'.$stat} / ($self->{delta_InPkts} + $self->{delta_OutPkts}) : 0; } + } elsif ($self->mode =~ /device::interfaces::duplex/) { +printf "%s\n", Data::Dumper::Dumper($self); + if (! defined $self->{dot3StatsDuplexStatus} && $self->{ifType} !~ /ether/i) { +printf "123\n"; + $self->{dot3StatsDuplexStatus} = "notApplicable"; + } elsif (! defined $self->{dot3StatsDuplexStatus} && $self->implements_mib('EtherLike-MIB')) { +printf "11123\n"; + if (defined $self->opts->mitigation() && + $self->opts->mitigation() eq 'ok') { +printf "a11123\n"; + $self->{dot3StatsDuplexStatus} = "fullDuplex"; + } else { +printf "b11123\n"; + $self->{dot3StatsDuplexStatus} = "unknown"; + } + } else { +printf "811123\n"; + $self->{dot3StatsDuplexStatus} = "unknown"; + } +printf "after%s\n", Data::Dumper::Dumper($self); } return $self; } @@ -1023,6 +1082,25 @@ 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(); + } + } } } @@ -1174,6 +1252,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/check_nwc_health.pl b/plugins-scripts/check_nwc_health.pl index 8fda805b..f562a0f5 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', From e2e49257208159f0068a22d63d5f338ffdbd1310 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Thu, 21 Dec 2017 16:39:06 +0100 Subject: [PATCH 08/82] add interface-duplex --- ChangeLog | 2 + GLPlugin | 2 +- configure.ac | 2 +- .../IFMIB/Component/InterfaceSubsystem.pm | 52 ++++--------------- plugins-scripts/Makefile.am | 1 + 5 files changed, 16 insertions(+), 43 deletions(-) diff --git a/ChangeLog b/ChangeLog index 517b40c5..277dd26e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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 diff --git a/GLPlugin b/GLPlugin index 848daf0b..fa94fed1 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit 848daf0b1a0a9f7c330027e6a731c533bcf2feb8 +Subproject commit fa94fed1d7f08e301239beefabe0e65676e012bb diff --git a/configure.ac b/configure.ac index 4f5b8d67..6e0b3c23 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.3) +AC_INIT(check_nwc_health,6.4.4) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST diff --git a/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm b/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm index 81e18fed..f4b278ea 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 @@ -174,7 +177,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 = (); @@ -224,8 +228,8 @@ sub init { 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; } } @@ -238,8 +242,8 @@ sub init { 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'; @@ -264,8 +268,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; } } @@ -295,35 +299,6 @@ sub init { if (scalar(@{$self->{interfaces}}) == 0) { $self->add_unknown('device probably has no RMON-MIB or EtherLike-MIB'); } - } elsif ($self->mode =~ /device::interfaces::duplex/) { - @indices = @save_indices; - my @etherindices = (); - my @etherhcindices = (); - foreach my $interface (@{$self->{interfaces}}) { - push(@selected_indices, [$interface->{ifIndex}]); - if (@ethertablehc_columns && $interface->{ifSpeed} == 4294967295) { - push(@etherhcindices, [$interface->{ifIndex}]); - } - push(@etherindices, [$interface->{ifIndex}]); - } - $self->debug( - sprintf 'all_interfaces %d, selected %d, ether %d, etherhc %d', - scalar(@all_indices), scalar(@selected_indices), - scalar(@etherindices), scalar(@etherhcindices)); - if (@ethertable_columns) { - foreach my $etherstat ($self->get_snmp_table_objects( - '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}}, @ethertable_columns); - last; - } - } - } - } } } } @@ -808,25 +783,19 @@ sub init_etherstats { ($self->{delta_InPkts} + $self->{delta_OutPkts}) : 0; } } elsif ($self->mode =~ /device::interfaces::duplex/) { -printf "%s\n", Data::Dumper::Dumper($self); - if (! defined $self->{dot3StatsDuplexStatus} && $self->{ifType} !~ /ether/i) { -printf "123\n"; + if (defined $self->{dot3StatsDuplexStatus}) { + } elsif (! defined $self->{dot3StatsDuplexStatus} && $self->{ifType} !~ /ether/i) { $self->{dot3StatsDuplexStatus} = "notApplicable"; } elsif (! defined $self->{dot3StatsDuplexStatus} && $self->implements_mib('EtherLike-MIB')) { -printf "11123\n"; if (defined $self->opts->mitigation() && $self->opts->mitigation() eq 'ok') { -printf "a11123\n"; $self->{dot3StatsDuplexStatus} = "fullDuplex"; } else { -printf "b11123\n"; $self->{dot3StatsDuplexStatus} = "unknown"; } } else { -printf "811123\n"; $self->{dot3StatsDuplexStatus} = "unknown"; } -printf "after%s\n", Data::Dumper::Dumper($self); } return $self; } @@ -842,6 +811,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)) { diff --git a/plugins-scripts/Makefile.am b/plugins-scripts/Makefile.am index a0b0bfa3..d9658845 100644 --- a/plugins-scripts/Makefile.am +++ b/plugins-scripts/Makefile.am @@ -71,6 +71,7 @@ GL_MODULES=\ ../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/HH3CENTITYEXTMIB.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/IPFORWARDMIB.pm \ From 2fbef1c7a4b1dda7858260584a4cc091ce53d7a8 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Wed, 27 Dec 2017 18:45:16 +0100 Subject: [PATCH 09/82] fix f5 versions --- ChangeLog | 2 ++ plugins-scripts/Classes/F5/F5BIGIP.pm | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 277dd26e..1cb0d52a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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 diff --git a/plugins-scripts/Classes/F5/F5BIGIP.pm b/plugins-scripts/Classes/F5/F5BIGIP.pm index 92d35b5f..4581789e 100644 --- a/plugins-scripts/Classes/F5/F5BIGIP.pm +++ b/plugins-scripts/Classes/F5/F5BIGIP.pm @@ -8,7 +8,7 @@ sub init { $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/) { From 6b141681c44401c1e607c676d583feaed292b4e2 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Wed, 27 Dec 2017 19:37:27 +0100 Subject: [PATCH 10/82] update CISCOENVMONMIB temperature --- .../Component/TemperatureSubsystem.pm | 18 +++----- .../WLC/Component/TemperatureSubsystem.pm | 41 +++++-------------- 2 files changed, 16 insertions(+), 43 deletions(-) diff --git a/plugins-scripts/Classes/Cisco/CISCOENVMONMIB/Component/TemperatureSubsystem.pm b/plugins-scripts/Classes/Cisco/CISCOENVMONMIB/Component/TemperatureSubsystem.pm index ec30934a..4c22a5fd 100644 --- a/plugins-scripts/Classes/Cisco/CISCOENVMONMIB/Component/TemperatureSubsystem.pm +++ b/plugins-scripts/Classes/Cisco/CISCOENVMONMIB/Component/TemperatureSubsystem.pm @@ -13,21 +13,13 @@ 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 = shift; + if (! exists $self->{ciscoEnvMonTemperatureStatusValue}) { + bless $self, ref($self).'::Simple'; } $self->ensure_index('ciscoEnvMonTemperatureStatusIndex'); $self->{ciscoEnvMonTemperatureLastShutdown} ||= 0; - return $self; } sub check { @@ -51,6 +43,7 @@ sub check { $self->{ciscoEnvMonTemperatureStatusDescr}, $self->{ciscoEnvMonTemperatureStatusValue}, $self->{ciscoEnvMonTemperatureThreshold}); + $self->add_ok(); } $self->add_perfdata( label => sprintf('temp_%s', $self->{ciscoEnvMonTemperatureStatusIndex}), @@ -80,6 +73,7 @@ sub check { $self->add_critical(); } } else { + $self->add_ok(); } } diff --git a/plugins-scripts/Classes/Cisco/WLC/Component/TemperatureSubsystem.pm b/plugins-scripts/Classes/Cisco/WLC/Component/TemperatureSubsystem.pm index 5fd97fab..16ab324c 100644 --- a/plugins-scripts/Classes/Cisco/WLC/Component/TemperatureSubsystem.pm +++ b/plugins-scripts/Classes/Cisco/WLC/Component/TemperatureSubsystem.pm @@ -5,33 +5,24 @@ use strict; sub init { my $self = shift; 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 = shift; $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 { @@ -70,18 +61,6 @@ 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; $self->add_info(sprintf 'temperature %d %s is %s', From 35aa441112a68db77fbf416e736f57c848755b23 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Fri, 5 Jan 2018 21:13:10 +0100 Subject: [PATCH 11/82] code improvements, hh3c fix --- ChangeLog | 2 + GLPlugin | 2 +- .../ALARMMIB/Component/AlarmSubsystem.pm | 6 +-- plugins-scripts/Classes/AVOS.pm | 2 +- .../AVOS/Component/ConnectionSubsystem.pm | 4 +- .../Classes/AVOS/Component/CpuSubsystem.pm | 7 ++-- .../Classes/AVOS/Component/KeySubsystem.pm | 4 +- .../Classes/AVOS/Component/MemSubsystem.pm | 4 +- .../AVOS/Component/SecuritySubsystem.pm | 4 +- plugins-scripts/Classes/Alcatel.pm | 2 +- plugins-scripts/Classes/Alcatel/OmniAccess.pm | 2 +- .../OmniAccess/Component/CpuSubsystem.pm | 4 +- .../Component/EnvironmentalSubsystem.pm | 6 +-- .../OmniAccess/Component/FanSubsystem.pm | 4 +- .../OmniAccess/Component/HaSubsystem.pm | 4 +- .../OmniAccess/Component/MemSubsystem.pm | 6 +-- .../Component/PowersupplySubsystem.pm | 4 +- .../OmniAccess/Component/StorageSubsystem.pm | 6 +-- .../OmniAccess/Component/WlanSubsystem.pm | 8 ++-- plugins-scripts/Classes/AlliedTelesyn.pm | 2 +- plugins-scripts/Classes/Arista.pm | 2 +- .../Component/EnvironmentalSubsystem.pm | 14 +++---- .../Classes/BGP/Component/PeerSubsystem.pm | 20 +++------- plugins-scripts/Classes/Bintec/Bibo.pm | 2 +- .../Bintec/Bibo/Components/CpuSubsystem.pm | 6 +-- .../Bintec/Bibo/Components/DiskSubsystem.pm | 6 +-- .../Bibo/Components/EnvironmentalSubsystem.pm | 2 +- .../Bintec/Bibo/Components/MemSubsystem.pm | 10 ++--- plugins-scripts/Classes/Bluecoat.pm | 2 +- plugins-scripts/Classes/Brocade.pm | 2 +- plugins-scripts/Classes/CheckPoint.pm | 2 +- .../Classes/CheckPoint/Firewall1.pm | 2 +- .../Firewall1/Component/CpuSubsystem.pm | 6 +-- .../Firewall1/Component/DiskSubsystem.pm | 10 ++--- .../Component/EnvironmentalSubsystem.pm | 6 +-- .../Firewall1/Component/FanSubsystem.pm | 6 +-- .../Firewall1/Component/FwSubsystem.pm | 4 +- .../Firewall1/Component/HaSubsystem.pm | 6 +-- .../Firewall1/Component/MemSubsystem.pm | 4 +- .../Firewall1/Component/MngmtSubsystem.pm | 4 +- .../Component/PowersupplySubsystem.pm | 4 +- .../Firewall1/Component/SvnSubsystem.pm | 4 +- .../Component/TemperatureSubsystem.pm | 6 +-- .../Firewall1/Component/VoltageSubsystem.pm | 6 +-- .../Firewall1/Component/VpnSubsystem.pm | 16 ++++---- plugins-scripts/Classes/CheckPoint/Gaia.pm | 2 +- plugins-scripts/Classes/CheckPoint/VSX.pm | 2 +- .../CheckPoint/VSX/Component/FwSubsystem.pm | 6 +-- plugins-scripts/Classes/Cisco.pm | 2 +- plugins-scripts/Classes/Cisco/ASA.pm | 2 +- plugins-scripts/Classes/Cisco/AsyncOS.pm | 2 +- .../Cisco/AsyncOS/Component/CpuSubsystem.pm | 4 +- .../Component/EnvironmentalSubsystem.pm | 6 +-- .../Cisco/AsyncOS/Component/FanSubsystem.pm | 4 +- .../Cisco/AsyncOS/Component/KeySubsystem.pm | 4 +- .../Cisco/AsyncOS/Component/MemSubsystem.pm | 4 +- .../AsyncOS/Component/PowersupplySubsystem.pm | 4 +- .../Cisco/AsyncOS/Component/RaidSubsystem.pm | 4 +- .../AsyncOS/Component/TemperatureSubsystem.pm | 4 +- plugins-scripts/Classes/Cisco/CCM.pm | 2 +- .../Cisco/CCM/Component/CmSubsystem.pm | 6 +-- .../Cisco/CCM/Component/PhoneSubsystem.pm | 4 +- .../Component/MemSubsystem.pm | 6 +-- .../Component/AlarmSubsystem.pm | 22 +++++------ .../Component/SensorSubsystem.pm | 12 +++--- .../Component/EnvironmentalSubsystem.pm | 6 +-- .../Component/FanSubsystem.pm | 4 +- .../Component/ModuleSubsystem.pm | 4 +- .../Component/PowersupplySubsystem.pm | 4 +- .../Component/SensorSubsystem.pm | 12 +++--- .../CISCOENVMONMIB/Component/FanSubsystem.pm | 4 +- .../Component/PowersupplySubsystem.pm | 4 +- .../Component/TemperatureSubsystem.pm | 8 ++-- .../Component/VoltageSubsystem.pm | 6 +-- .../Component/VpnSubsystem.pm | 8 ++-- .../Component/MemSubsystem.pm | 6 +-- plugins-scripts/Classes/Cisco/IOS.pm | 2 +- .../Cisco/IOS/Component/BgpSubsystem.pm | 8 ++-- .../Cisco/IOS/Component/ConfigSubsystem.pm | 6 +-- .../IOS/Component/ConnectionSubsystem.pm | 4 +- .../Cisco/IOS/Component/CpuSubsystem.pm | 6 +-- .../IOS/Component/EnvironmentalSubsystem.pm | 6 +-- .../Cisco/IOS/Component/MemSubsystem.pm | 2 +- .../Cisco/IOS/Component/NatSubsystem.pm | 8 ++-- plugins-scripts/Classes/Cisco/NXOS.pm | 2 +- .../Cisco/NXOS/Component/CpuSubsystem.pm | 6 +-- .../NXOS/Component/EnvironmentalSubsystem.pm | 8 ++-- .../Cisco/NXOS/Component/FexSubsystem.pm | 8 ++-- .../Cisco/NXOS/Component/MemSubsystem.pm | 4 +- plugins-scripts/Classes/Cisco/PrimeNCS.pm | 2 +- plugins-scripts/Classes/Cisco/SB.pm | 2 +- .../Cisco/SB/Component/CpuSubsystem.pm | 4 +- .../SB/Component/EnvironmentalSubsystem.pm | 6 +-- .../Cisco/SB/Component/MemSubsystem.pm | 4 +- plugins-scripts/Classes/Cisco/UCOS.pm | 2 +- plugins-scripts/Classes/Cisco/WLC.pm | 2 +- .../Cisco/WLC/Component/CpuSubsystem.pm | 4 +- .../WLC/Component/EnvironmentalSubsystem.pm | 6 +-- .../Cisco/WLC/Component/FanSubsystem.pm | 4 +- .../Cisco/WLC/Component/MemSubsystem.pm | 4 +- .../WLC/Component/PowersupplySubsystem.pm | 4 +- .../WLC/Component/TemperatureSubsystem.pm | 8 ++-- .../Cisco/WLC/Component/VoltageSubsystem.pm | 4 +- .../Cisco/WLC/Component/WlanSubsystem.pm | 14 +++---- plugins-scripts/Classes/Clavister.pm | 2 +- .../Classes/Clavister/Firewall1.pm | 2 +- .../Firewall1/Component/CpuSubsystem.pm | 4 +- .../Component/EnvironmentalSubsystem.pm | 6 +-- .../Firewall1/Component/MemSubsystem.pm | 4 +- plugins-scripts/Classes/Cumulus.pm | 2 +- plugins-scripts/Classes/Device.pm | 6 +-- .../Component/EnvironmentalSubsystem.pm | 20 +++++----- plugins-scripts/Classes/Eltex.pm | 2 +- plugins-scripts/Classes/Eltex/Access.pm | 2 +- .../Component/EnvironmentalSubsystem.pm | 8 ++-- plugins-scripts/Classes/Eltex/Aggregation.pm | 2 +- .../Component/EnvironmentalSubsystem.pm | 10 ++--- .../Eltex/MES/Component/CpuSubsystem.pm | 4 +- .../Eltex/MES/Component/HaSubsystem.pm | 4 +- plugins-scripts/Classes/F5.pm | 2 +- plugins-scripts/Classes/F5/F5BIGIP.pm | 4 +- .../F5/F5BIGIP/Component/CpuSubsystem.pm | 10 ++--- .../F5/F5BIGIP/Component/DiskSubsystem.pm | 4 +- .../Component/EnvironmentalSubsystem.pm | 14 ++----- .../F5/F5BIGIP/Component/FanSubsystem.pm | 4 +- .../Classes/F5/F5BIGIP/Component/GTM.pm | 18 ++++----- .../Classes/F5/F5BIGIP/Component/LTM.pm | 35 ++++++++--------- .../F5/F5BIGIP/Component/MemSubsystem.pm | 4 +- .../F5BIGIP/Component/PowersupplySubsystem.pm | 4 +- .../F5BIGIP/Component/TemperatureSubsystem.pm | 4 +- .../Components/EnvironmentalSubsystem.pm | 6 +-- .../Classes/FCEOS/Components/FruSubsystem.pm | 4 +- .../Component/EnvironmentalSubsystem.pm | 6 +-- .../FCMGMT/Component/SensorSubsystem.pm | 4 +- plugins-scripts/Classes/FabOS.pm | 2 +- .../Classes/FabOS/Component/CpuSubsystem.pm | 4 +- .../FabOS/Component/EnvironmentalSubsystem.pm | 6 +-- .../Classes/FabOS/Component/MemSubsystem.pm | 4 +- .../FabOS/Component/SensorSubsystem.pm | 28 +------------ plugins-scripts/Classes/Fortigate.pm | 2 +- .../Fortigate/Component/CpuSubsystem.pm | 5 +-- .../Fortigate/Component/DiskSubsystem.pm | 4 +- .../Component/EnvironmentalSubsystem.pm | 6 +-- .../Fortigate/Component/MemSubsystem.pm | 4 +- .../Fortigate/Component/SensorSubsystem.pm | 4 +- plugins-scripts/Classes/Foundry.pm | 2 +- .../Classes/Foundry/Component/CpuSubsystem.pm | 12 +++--- .../Component/EnvironmentalSubsystem.pm | 6 +-- .../Classes/Foundry/Component/FanSubsystem.pm | 6 +-- .../Classes/Foundry/Component/MemSubsystem.pm | 4 +- .../Foundry/Component/ModuleSubsystem.pm | 4 +- .../Foundry/Component/PowersupplySubsystem.pm | 4 +- .../Classes/Foundry/Component/SLBSubsystem.pm | 25 ++++++------ .../Foundry/Component/TemperatureSubsystem.pm | 8 ++-- plugins-scripts/Classes/HH3C.pm | 2 +- .../Classes/HH3C/Component/CpuSubsystem.pm | 31 +++++++-------- .../HH3C/Component/EnvironmentalSubsystem.pm | 39 ++++++++++--------- .../Classes/HH3C/Component/MemSubsystem.pm | 31 +++++++-------- .../Component/CpuSubsystem.pm | 4 +- .../Component/DeviceSubsystem.pm | 6 +-- .../Component/DiskSubsystem.pm | 6 +-- .../Component/EnvironmentalSubsystem.pm | 6 +-- .../Component/MemSubsystem.pm | 4 +- .../Component/UptimeSubsystem.pm | 4 +- plugins-scripts/Classes/HP.pm | 2 +- plugins-scripts/Classes/HP/Procurve.pm | 2 +- .../HP/Procurve/Component/CpuSubsystem.pm | 4 +- .../Component/EnvironmentalSubsystem.pm | 2 +- .../HP/Procurve/Component/MemSubsystem.pm | 6 +-- .../HP/Procurve/Component/SensorSubsystem.pm | 6 +-- .../Classes/HSRP/Component/HSRPSubsystem.pm | 25 +++++------- plugins-scripts/Classes/Huawei.pm | 2 +- plugins-scripts/Classes/Huawei/CloudEngine.pm | 2 +- .../Classes/Huawei/Component/CpuSubsystem.pm | 9 ++--- .../Component/EnvironmentalSubsystem.pm | 20 +++++----- .../Classes/Huawei/Component/MemSubsystem.pm | 9 ++--- .../IFMIB/Component/LinkAggregation.pm | 12 +----- .../Component/RoutingSubsystem.pm | 12 +++--- .../IPMIB/Component/RoutingSubsystem.pm | 4 +- plugins-scripts/Classes/Juniper.pm | 2 +- plugins-scripts/Classes/Juniper/IVE.pm | 2 +- .../Juniper/IVE/Component/CpuSubsystem.pm | 4 +- .../Juniper/IVE/Component/DiskSubsystem.pm | 4 +- .../IVE/Component/EnvironmentalSubsystem.pm | 6 +-- .../Juniper/IVE/Component/MemSubsystem.pm | 4 +- .../Juniper/IVE/Component/UserSubsystem.pm | 4 +- plugins-scripts/Classes/Juniper/JunOS.pm | 2 +- .../Juniper/JunOS/Component/BgpSubsystem.pm | 9 ++--- plugins-scripts/Classes/Juniper/NetScreen.pm | 2 +- .../NetScreen/Component/CpuSubsystem.pm | 4 +- .../Component/EnvironmentalSubsystem.pm | 14 +++---- .../NetScreen/Component/MemSubsystem.pm | 4 +- .../NetScreen/Component/VsdSubsystem.pm | 4 +- plugins-scripts/Classes/Juniper/SRX.pm | 2 +- .../Juniper/SRX/Component/CpuSubsystem.pm | 6 +-- .../SRX/Component/EnvironmentalSubsystem.pm | 8 ++-- .../Juniper/SRX/Component/MemSubsystem.pm | 8 ++-- .../Component/EnvironmentalSubsystem.pm | 6 +-- .../LMSENSORSMIB/Component/FanSubsystem.pm | 4 +- .../Component/TemperatureSubsystem.pm | 6 +-- plugins-scripts/Classes/Lancom.pm | 2 +- .../Classes/Lancom/Component/CpuSubsystem.pm | 4 +- .../Component/EnvironmentalSubsystem.pm | 4 +- .../Classes/Lancom/Component/MemSubsystem.pm | 4 +- .../Lancom/Component/SensorSubsystem.pm | 28 +------------ plugins-scripts/Classes/Lantronix/SLS.pm | 6 +-- plugins-scripts/Classes/MEOS.pm | 6 +-- plugins-scripts/Classes/Netgear.pm | 2 +- plugins-scripts/Classes/Nortel.pm | 2 +- plugins-scripts/Classes/Nortel/S5.pm | 2 +- .../Nortel/S5/Component/CpuSubsystem.pm | 4 +- .../S5/Component/EnvironmentalSubsystem.pm | 8 ++-- .../Nortel/S5/Component/MemSubsystem.pm | 6 +-- plugins-scripts/Classes/OSPF.pm | 2 +- .../OSPF/Component/NeighborSubsystem.pm | 12 +++--- plugins-scripts/Classes/OneOS.pm | 2 +- .../Classes/OneOS/Component/CpuSubsystem.pm | 4 +- .../OneOS/Component/EnvironmentalSubsystem.pm | 6 +-- .../Classes/OneOS/Component/MemSubsystem.pm | 4 +- plugins-scripts/Classes/PaloAlto.pm | 2 +- .../PaloAlto/Component/CpuSubsystem.pm | 4 +- .../Component/EnvironmentalSubsystem.pm | 12 +++--- .../Classes/PaloAlto/Component/HaSubsystem.pm | 4 +- .../PaloAlto/Component/MemSubsystem.pm | 4 +- .../Component/EnvironmentalSubsystem.pm | 6 +-- .../RAPIDCITYMIB/Component/FanSubsystem.pm | 4 +- .../Component/PowersupplySubsystem.pm | 4 +- .../Component/TemperatureSubsystem.pm | 4 +- plugins-scripts/Classes/Riverbed/Steelhead.pm | 4 +- .../Component/EnvironmentalSubsystem.pm | 4 +- .../Component/EnvironmentalSubsystem.pm | 2 +- plugins-scripts/Classes/SGOS.pm | 2 +- .../SGOS/Component/ConnectionSubsystem.pm | 4 +- .../Classes/SGOS/Component/CpuSubsystem.pm | 7 ++-- .../Classes/SGOS/Component/DiskSubsystem.pm | 6 +-- .../SGOS/Component/EnvironmentalSubsystem.pm | 16 ++------ .../Classes/SGOS/Component/MemSubsystem.pm | 4 +- .../SGOS/Component/SecuritySubsystem.pm | 6 +-- .../Classes/SGOS/Component/SensorSubsystem.pm | 6 +-- plugins-scripts/Classes/SecureOS.pm | 2 +- plugins-scripts/Classes/Server/Linux.pm | 2 +- .../Server/Linux/Component/CpuSubsystem.pm | 8 ++-- .../Linux/Component/EnvironmentalSubsystem.pm | 8 ++-- .../Server/Linux/Component/MemSubsystem.pm | 8 ++-- plugins-scripts/Classes/Server/LinuxLocal.pm | 10 ++--- .../Classes/Server/SolarisLocal.pm | 14 +++---- .../Classes/Server/WindowsLocal.pm | 8 ++-- .../Classes/UCDMIB/Components/CpuSubsystem.pm | 4 +- .../UCDMIB/Components/DiskSubsystem.pm | 8 ++-- .../UCDMIB/Components/LoadSubsystem.pm | 10 ++--- .../Classes/UCDMIB/Components/MemSubsystem.pm | 4 +- .../UCDMIB/Components/ProcessSubsystem.pm | 8 ++-- .../UCDMIB/Components/SwapSubsystem.pm | 4 +- plugins-scripts/Classes/UPNP/AVM.pm | 2 +- .../Classes/UPNP/AVM/FritzBox7390.pm | 21 +++++----- .../Components/InterfaceSubsystem.pm | 4 +- .../Components/SmartHomeSubsystem.pm | 19 +++++---- .../VRRPMIB/Component/VRRPSubsystem.pm | 15 ++++--- 258 files changed, 756 insertions(+), 855 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1cb0d52a..9bc4a0f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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 diff --git a/GLPlugin b/GLPlugin index fa94fed1..6c04c3a6 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit fa94fed1d7f08e301239beefabe0e65676e012bb +Subproject commit 6c04c3a687bf41528a9203ceff8e8dc562597814 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..26fe3019 100644 --- a/plugins-scripts/Classes/Bluecoat.pm +++ b/plugins-scripts/Classes/Bluecoat.pm @@ -4,7 +4,7 @@ use strict; sub init { - my $self = shift; + my ($self) = @_; if ($self->{productname} =~ /Blue.*Coat.*(SG\d+|SGOS)/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" 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 35f53be7..d6c5801e 100644 --- a/plugins-scripts/Classes/CheckPoint.pm +++ b/plugins-scripts/Classes/CheckPoint.pm @@ -7,7 +7,7 @@ use constant trees => ( ); sub init { - my $self = shift; + my ($self) = @_; if (defined $self->get_snmp_object('CHECKPOINT-MIB', 'vsxVsInstalled') && $self->get_snmp_object('CHECKPOINT-MIB', 'vsxVsInstalled') != 0) { bless $self, 'Classes::CheckPoint::VSX'; 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..a7caff92 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} = @@ -17,7 +17,7 @@ sub init { } sub check { - my $self = shift; + my ($self) = @_; $self->{disk_subsystem}->check(); $self->{temperature_subsystem}->check(); $self->{fan_subsystem}->check(); @@ -30,7 +30,7 @@ sub check { } sub dump { - my $self = shift; + my ($self) = @_; $self->{disk_subsystem}->dump(); $self->{temperature_subsystem}->dump(); $self->{fan_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..01dfc10e 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}); 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..f47d819f 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..bf9eeb73 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 || 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..4d9dda8b 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; diff --git a/plugins-scripts/Classes/Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm b/plugins-scripts/Classes/Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm index 73c527ac..0b0c6b06 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,7 +14,7 @@ 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}); @@ -27,7 +27,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/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 4c22a5fd..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'], ]); @@ -14,7 +14,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem); use strict; sub finish { - my $self = shift; + my ($self) = @_; if (! exists $self->{ciscoEnvMonTemperatureStatusValue}) { bless $self, ref($self).'::Simple'; } @@ -23,7 +23,7 @@ sub finish { } 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)', @@ -59,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', 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..503242bc 100644 --- a/plugins-scripts/Classes/Cisco/CISCOIPSECFLOWMONITOR/Component/VpnSubsystem.pm +++ b/plugins-scripts/Classes/Cisco/CISCOIPSECFLOWMONITOR/Component/VpnSubsystem.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-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->{parent} = $self; $self->filter_name($o->{cikeTunRemoteValue})}], ]); } sub check { - my $self = shift; + my ($self) = @_; if (! @{$self->{ciketunnels}}) { $self->add_critical(sprintf 'tunnel to %s does not exist', $self->opts->name); @@ -27,7 +27,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem); use strict; sub check { - my $self = shift; + my ($self) = @_; # cikeTunRemoteValue per --name angegeben, muss active sein # ansonsten watch-vpns, delta tunnels ueberwachen $self->add_info(sprintf 'tunnel to %s is %s', 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/IOS.pm b/plugins-scripts/Classes/Cisco/IOS.pm index 2864ef80..1a8ef015 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"); diff --git a/plugins-scripts/Classes/Cisco/IOS/Component/BgpSubsystem.pm b/plugins-scripts/Classes/Cisco/IOS/Component/BgpSubsystem.pm index cf2716e6..39550a21 100644 --- a/plugins-scripts/Classes/Cisco/IOS/Component/BgpSubsystem.pm +++ b/plugins-scripts/Classes/Cisco/IOS/Component/BgpSubsystem.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-BGP4-MIB', [ ['peers', 'cbgpPeerAddrFamilyPrefixTable', 'Classes::Cisco::IOS::Component::BgpSubsystem::Peer', sub { return $self->filter_name(shift->{cbgpPeerRemoteAddr}) } ], ]); } sub check { - my $self = shift; + my ($self) = @_; if ($self->mode =~ /prefix::count/) { if (scalar(@{$self->{peers}}) == 0) { $self->add_critical('no peers found'); @@ -25,14 +25,14 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem); use strict; sub finish { - my $self = shift; + my ($self) = @_; $self->{cbgpPeerAddrFamilyAfi} = pop @{$self->{indices}}; $self->{cbgpPeerAddrFamilySafi} = pop @{$self->{indices}}; $self->{cbgpPeerRemoteAddr} = join(".", @{$self->{indices}}); } sub check { - my $self = shift; + my ($self) = @_; if ($self->mode =~ /prefix::count/) { $self->add_info(sprintf "peer %s accepted %d prefixes", $self->{cbgpPeerRemoteAddr}, $self->{cbgpPeerAddrAcceptedPrefixes}); 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/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..9bd98c2b 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')) { 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/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 16ab324c..5eff6b12 100644 --- a/plugins-scripts/Classes/Cisco/WLC/Component/TemperatureSubsystem.pm +++ b/plugins-scripts/Classes/Cisco/WLC/Component/TemperatureSubsystem.pm @@ -3,7 +3,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::Item); use strict; sub init { - my $self = shift; + my ($self) = @_; my $tempcnt = 0; $self->get_snmp_tables('CISCO-ENVMON-MIB', [ ['temperatures', 'ciscoEnvMonTemperatureStatusTable', 'Classes::Cisco::IOS::Component::TemperatureSubsystem::Temperature'], @@ -15,7 +15,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem); use strict; sub finish { - my $self = shift; + my ($self) = @_; $self->{ciscoEnvMonTemperatureLastShutdown} ||= 0; if (! exists $self->{ciscoEnvMonTemperatureStatusIndex}) { $self->{ciscoEnvMonTemperatureStatusIndex} = $self->{flat_indices}; @@ -26,7 +26,7 @@ sub finish { } 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)', @@ -62,7 +62,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem); use strict; 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 1a1ae80f..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}) } ], @@ -27,7 +27,7 @@ sub init { } sub check { - my $self = shift; + my ($self) = @_; $self->add_info('checking access points'); if ($self->mode =~ /device::wlan::aps::clients/) { my $ssids = {}; @@ -106,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}}) { @@ -121,7 +121,7 @@ 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}) { @@ -153,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})/) { @@ -162,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}, @@ -188,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..ce0daea3 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 { @@ -124,7 +124,7 @@ 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'); @@ -195,7 +195,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/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..6fa0dd85 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,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); @@ -55,7 +55,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 4581789e..63dcaef9 100644 --- a/plugins-scripts/Classes/F5/F5BIGIP.pm +++ b/plugins-scripts/Classes/F5/F5BIGIP.pm @@ -3,7 +3,7 @@ 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'); @@ -37,7 +37,7 @@ sub init { } 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/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..40bf992a 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'); @@ -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/LTM.pm b/plugins-scripts/Classes/F5/F5BIGIP/Component/LTM.pm index c85ea238..8e57aa92 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'); @@ -230,7 +229,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 +254,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 +315,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 +373,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 +407,7 @@ sub finish { } sub rename { - my $self = shift; + my ($self) = @_; if ($self->{ltmPoolMemberNodeName} eq $self->{ltmPoolMemberAddr} && $self->{ltmNodeAddrStatusName}) { $self->{ltmPoolMemberNodeName} = $self->{ltmNodeAddrStatusName}; @@ -416,7 +415,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 +458,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 +477,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 +501,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..d1518b64 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,7 +13,7 @@ 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 ? 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..640fb0cd 100644 --- a/plugins-scripts/Classes/Fortigate.pm +++ b/plugins-scripts/Classes/Fortigate.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_environmental_subsystem("Classes::Fortigate::Component::EnvironmentalSubsystem"); } elsif ($self->mode =~ /device::hardware::load/) { 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/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..9691f8e1 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'], ]); @@ -14,7 +14,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem); use strict; sub check { - my $self = shift; + my ($self) = @_; $self->add_info(sprintf 'sensor %s alarm status is %s', $self->{fgHwSensorEntName}, $self->{fgHwSensorEntValueStatus}); 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/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..ce4bb440 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,7 +14,7 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem); use strict; sub finish { - my $self = shift; + my ($self) = @_; 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. @@ -23,7 +23,7 @@ sub finish { } sub check { - my $self = shift; + my ($self) = @_; $self->add_info(sprintf '%s (%s) has status %s', $self->{hrDeviceType}, $self->{hrDeviceDescr}, $self->{hrDeviceStatus} diff --git a/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/DiskSubsystem.pm b/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/DiskSubsystem.pm index a67f33dc..030a3dac 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/) { @@ -38,7 +38,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..2d8e4f65 100644 --- a/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/EnvironmentalSubsystem.pm +++ b/plugins-scripts/Classes/HOSTRESOURCESMIB/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::HOSTRESOURCESMIB::Component::DiskSubsystem->new(); $self->{device_subsystem} = @@ -11,14 +11,14 @@ sub init { } sub check { - my $self = shift; + my ($self) = @_; $self->{disk_subsystem}->check(); $self->{device_subsystem}->check(); $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..cc7ab3ab 100644 --- a/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/MemSubsystem.pm +++ b/plugins-scripts/Classes/HOSTRESOURCESMIB/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('HOST-RESOURCES-MIB', [ ['storagesram', 'hrStorageTable', 'Classes::HOSTRESOURCESMIB::Component::MemSubsystem::Ram', sub { return shift->{hrStorageType} eq 'hrStorageRam' } ], ]); @@ -14,7 +14,7 @@ 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..9863e9a1 100644 --- a/plugins-scripts/Classes/Huawei.pm +++ b/plugins-scripts/Classes/Huawei.pm @@ -3,7 +3,7 @@ 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'; diff --git a/plugins-scripts/Classes/Huawei/CloudEngine.pm b/plugins-scripts/Classes/Huawei/CloudEngine.pm index 6288ff1d..8be77f1f 100644 --- a/plugins-scripts/Classes/Huawei/CloudEngine.pm +++ b/plugins-scripts/Classes/Huawei/CloudEngine.pm @@ -3,7 +3,7 @@ our @ISA = qw(Classes::Huawei); use strict; sub init { - my $self = shift; + my ($self) = @_; 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', 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..9364076e 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', [ @@ -29,8 +29,7 @@ sub init { $self->merge_tables($_, "entitystates"); } $self->merge_tables_with_code("fans", "fanstates", sub { - my $fan = shift; - my $fanstate = shift; + my ($fan, $fanstate) = @_; return ($fan->{entPhysicalName} eq sprintf("FAN %d/%d", $fanstate->{hwEntityFanSlot}, $fanstate->{hwEntityFanSn})) ? 1 : 0; }); @@ -42,7 +41,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, state is %s, admin status is %s, oper status is %s', $self->{entPhysicalName}, $self->{hwEntityFanPresent}, $self->{hwEntityFanState}, @@ -64,7 +63,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 +78,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..03e719f3 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,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) = @_; $self->add_info(sprintf 'Memory %s usage is %s%% (of %dMB)', $self->{name}, $self->{hwEntityMemUsage}, $self->{hwEntityMemSizeMega}); $self->set_thresholds( 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/IPFORWARDMIB/Component/RoutingSubsystem.pm b/plugins-scripts/Classes/IPFORWARDMIB/Component/RoutingSubsystem.pm index 0666817f..1e3ddb03 100644 --- a/plugins-scripts/Classes/IPFORWARDMIB/Component/RoutingSubsystem.pm +++ b/plugins-scripts/Classes/IPFORWARDMIB/Component/RoutingSubsystem.pm @@ -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,7 +117,7 @@ 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->{inetCidrRouteDestType} = $self->mibs_and_oids_definition( 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..9ff2cd2a 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} = diff --git a/plugins-scripts/Classes/Juniper/SRX/Component/CpuSubsystem.pm b/plugins-scripts/Classes/Juniper/SRX/Component/CpuSubsystem.pm index 76e45876..4560db63 100644 --- a/plugins-scripts/Classes/Juniper/SRX/Component/CpuSubsystem.pm +++ b/plugins-scripts/Classes/Juniper/SRX/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('JUNIPER-MIB', [ ['operatins', 'jnxOperatingTable', 'Classes::Juniper::SRX::Component::CpuSubsystem::OperatingItem', sub { shift->{jnxOperatingDescr} =~ /engine/i; }], # siehe memory @@ -15,7 +15,7 @@ package Classes::Juniper::SRX::Component::CpuSubsystem::OperatingItem; our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem); 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'; @@ -33,7 +33,7 @@ package Classes::Juniper::SRX::Component::CpuSubsystem::OperatingItem2; our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem); sub check { - my $self = shift; + my ($self) = @_; $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})); diff --git a/plugins-scripts/Classes/Juniper/SRX/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Juniper/SRX/Component/EnvironmentalSubsystem.pm index 8e75fc33..ee36bc4b 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'], @@ -20,7 +20,7 @@ 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') { @@ -55,7 +55,7 @@ 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"; } @@ -65,7 +65,7 @@ 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}; diff --git a/plugins-scripts/Classes/Juniper/SRX/Component/MemSubsystem.pm b/plugins-scripts/Classes/Juniper/SRX/Component/MemSubsystem.pm index 23889952..addeeefd 100644 --- a/plugins-scripts/Classes/Juniper/SRX/Component/MemSubsystem.pm +++ b/plugins-scripts/Classes/Juniper/SRX/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('JUNIPER-MIB', qw(jnxBoxKernelMemoryUsedPercent)); $self->get_snmp_tables('JUNIPER-MIB', [ ['operatins', 'jnxOperatingTable', 'Classes::Juniper::SRX::Component::MemSubsystem::OperatingItem', sub { shift->{jnxOperatingDescr} =~ /engine/i; }], @@ -13,7 +13,7 @@ sub init { } sub check { - my $self = shift; + my ($self) = @_; $self->SUPER::check(); if (exists $self->{jnxBoxKernelMemoryUsedPercent}) { $self->add_info(sprintf 'kernel memory usage is %.2f%%', @@ -35,7 +35,7 @@ package Classes::Juniper::SRX::Component::MemSubsystem::OperatingItem; our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem); sub check { - my $self = shift; + my ($self) = @_; $self->add_info(sprintf '%s buffer usage is %.2f%%', $self->{jnxOperatingDescr}, $self->{jnxOperatingBuffer}); my $label = 'buffer_'.$self->{jnxOperatingDescr}.'_usage'; @@ -53,7 +53,7 @@ package Classes::Juniper::SRX::Component::MemSubsystem::OperatingItem2; our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem); sub check { - my $self = shift; + my ($self) = @_; $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})); diff --git a/plugins-scripts/Classes/LMSENSORSMIB/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/LMSENSORSMIB/Component/EnvironmentalSubsystem.pm index f7758fc6..b7ad8816 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,13 @@ sub init { } sub check { - my $self = shift; + my ($self) = @_; $self->{fan_subsystem}->check(); $self->{temperature_subsystem}->check(); } 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..9613a8b9 100644 --- a/plugins-scripts/Classes/OSPF/Component/NeighborSubsystem.pm +++ b/plugins-scripts/Classes/OSPF/Component/NeighborSubsystem.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('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}) }], ]); if ($self->establish_snmp_secondary_session()) { $self->clear_table_cache('OSPF-MIB', 'ospfNbrTable'); $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}) }], ]); } if (! @{$self->{nbr}}) { @@ -19,7 +19,7 @@ sub init { } 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}; @@ -36,12 +36,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") { 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..126e7b6f 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"); 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/Components/CpuSubsystem.pm b/plugins-scripts/Classes/UCDMIB/Components/CpuSubsystem.pm index da3e42a1..8d242f66 100644 --- a/plugins-scripts/Classes/UCDMIB/Components/CpuSubsystem.pm +++ b/plugins-scripts/Classes/UCDMIB/Components/CpuSubsystem.pm @@ -3,7 +3,7 @@ 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 @@ -53,7 +53,7 @@ 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'; 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..a529b198 100644 --- a/plugins-scripts/Classes/UCDMIB/Components/MemSubsystem.pm +++ b/plugins-scripts/Classes/UCDMIB/Components/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('UCD-SNMP-MIB', (qw( memTotalSwap memAvailSwap memTotalReal memAvailReal memBuffer memCached memMinimumSwap memSwapError memSwapErrorMsg))); @@ -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..eaeee881 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))); @@ -15,7 +15,7 @@ sub init { } 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 4ecb3143..b0ad412b 100644 --- a/plugins-scripts/Classes/UPNP/AVM.pm +++ b/plugins-scripts/Classes/UPNP/AVM.pm @@ -3,7 +3,7 @@ our @ISA = qw(Classes::UPNP); use strict; sub init { - my $self = shift; + my ($self) = @_; if ($self->{productname} =~ /7390/) { bless $self, 'Classes::UPNP::AVM::FritzBox7390'; $self->debug('using Classes::UPNP::AVM::FritzBox7390'); 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 16ac472b..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; @@ -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}, From e2492b484b2aadf6bff0548fddbc77cf3debef3a Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Fri, 5 Jan 2018 21:13:41 +0100 Subject: [PATCH 12/82] update version --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 6e0b3c23..9e8df35f 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.4) +AC_INIT(check_nwc_health,7.0) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST From 49ee11f89658e23bd1d2309f6d3f3d7c543bf929 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Mon, 8 Jan 2018 11:57:20 +0100 Subject: [PATCH 13/82] update glplugin --- ChangeLog | 2 ++ GLPlugin | 2 +- configure.ac | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9bc4a0f0..8b7488a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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 diff --git a/GLPlugin b/GLPlugin index 6c04c3a6..86273a46 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit 6c04c3a687bf41528a9203ceff8e8dc562597814 +Subproject commit 86273a46bc42dc06fc0240feb4272ba531b426e9 diff --git a/configure.ac b/configure.ac index 9e8df35f..897047b8 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,7.0) +AC_INIT(check_nwc_health,7.0.0.1) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST From b7d2d6d2c06259dea032e30b72890a8eb77b62e0 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Mon, 15 Jan 2018 11:48:21 +0100 Subject: [PATCH 14/82] check the clock of checkpoint fw --- ChangeLog | 4 ++++ GLPlugin | 2 +- configure.ac | 2 +- .../Firewall1/Component/EnvironmentalSubsystem.pm | 4 ++++ .../CheckPoint/Firewall1/Component/VpnSubsystem.pm | 2 +- plugins-scripts/Classes/Device.pm | 4 +--- .../HOSTRESOURCESMIB/Component/EnvironmentalSubsystem.pm | 9 +++++++++ plugins-scripts/Makefile.am | 1 + 8 files changed, 22 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8b7488a9..53e287c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +* 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 diff --git a/GLPlugin b/GLPlugin index 86273a46..3b3e8b61 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit 86273a46bc42dc06fc0240feb4272ba531b426e9 +Subproject commit 3b3e8b61b8b992844c11b21cd33929268f550dfc diff --git a/configure.ac b/configure.ac index 897047b8..6ed19f21 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,7.0.0.1) +AC_INIT(check_nwc_health,7.0.0.3) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST diff --git a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/EnvironmentalSubsystem.pm index a7caff92..0612abe3 100644 --- a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/EnvironmentalSubsystem.pm +++ b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/EnvironmentalSubsystem.pm @@ -14,6 +14,8 @@ 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 { @@ -23,6 +25,7 @@ sub 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"); @@ -36,5 +39,6 @@ sub 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/VpnSubsystem.pm b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/VpnSubsystem.pm index f47d819f..1c6f4c65 100644 --- a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/VpnSubsystem.pm +++ b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/VpnSubsystem.pm @@ -6,7 +6,7 @@ sub init { my ($self) = @_; $self->get_snmp_tables('CHECKPOINT-MIB', [ ['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}) }'], + ['permanenttunnels', 'permanentTunnelTable', 'Classes::CheckPoint::Firewall1::Component::VpnSubsystem::PermanentTunnel', sub { my ($o) = @_; $o->filter_name($o->{permanentTunnelPeerIpAddr}) || $o->filter_name($o->{permanentTunnelPeerObjName}) } ], ]); } diff --git a/plugins-scripts/Classes/Device.pm b/plugins-scripts/Classes/Device.pm index ce0daea3..dd1df348 100644 --- a/plugins-scripts/Classes/Device.pm +++ b/plugins-scripts/Classes/Device.pm @@ -44,9 +44,7 @@ sub classify { 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) { diff --git a/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/EnvironmentalSubsystem.pm index 2d8e4f65..a1d2bf9f 100644 --- a/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/EnvironmentalSubsystem.pm +++ b/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/EnvironmentalSubsystem.pm @@ -4,6 +4,7 @@ use strict; sub init { my ($self) = @_; + $self->get_snmp_object('HOST-RESOURCES-MIB', 'hrSystemDate'); $self->{disk_subsystem} = Classes::HOSTRESOURCESMIB::Component::DiskSubsystem->new(); $self->{device_subsystem} = @@ -14,6 +15,14 @@ sub check { 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'); } diff --git a/plugins-scripts/Makefile.am b/plugins-scripts/Makefile.am index d9658845..8cf98915 100644 --- a/plugins-scripts/Makefile.am +++ b/plugins-scripts/Makefile.am @@ -269,6 +269,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 \ From e9d6c8de0a9ef1d2fef9056001f92f55586e627f Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Tue, 16 Jan 2018 10:09:51 +0100 Subject: [PATCH 15/82] add ClockSubsystem --- .../Component/ClockSubsystem.pm | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 plugins-scripts/Classes/HOSTRESOURCESMIB/Component/ClockSubsystem.pm 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}); + } +} + From a89d490f2b42f76be60c785ea49b0eeca19e116a Mon Sep 17 00:00:00 2001 From: Simon Meggle Date: Tue, 23 Jan 2018 10:41:33 +0100 Subject: [PATCH 16/82] Removed static thresholds from Checkpoint temperature subsystem --- .../CheckPoint/Firewall1/Component/TemperatureSubsystem.pm | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/TemperatureSubsystem.pm b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/TemperatureSubsystem.pm index 01dfc10e..74daf9db 100644 --- a/plugins-scripts/Classes/CheckPoint/Firewall1/Component/TemperatureSubsystem.pm +++ b/plugins-scripts/Classes/CheckPoint/Firewall1/Component/TemperatureSubsystem.pm @@ -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}, From b1bd2f0dfef9f3ecb0f4849a0c83b3fb0679c4bf Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Tue, 23 Jan 2018 10:50:19 +0100 Subject: [PATCH 17/82] fix bluecoat asg detection --- plugins-scripts/Classes/Bluecoat.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins-scripts/Classes/Bluecoat.pm b/plugins-scripts/Classes/Bluecoat.pm index 26fe3019..3a0f8495 100644 --- a/plugins-scripts/Classes/Bluecoat.pm +++ b/plugins-scripts/Classes/Bluecoat.pm @@ -5,7 +5,7 @@ use strict; sub init { my ($self) = @_; - if ($self->{productname} =~ /Blue.*Coat.*(SG\d+|SGOS)/i) { + 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'; From ca9b019b6e71ad703e61e0785a46936b3153822c Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Tue, 23 Jan 2018 10:50:26 +0100 Subject: [PATCH 18/82] changelog --- ChangeLog | 3 +++ configure.ac | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 53e287c6..b57e6ad1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +* 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 diff --git a/configure.ac b/configure.ac index 6ed19f21..34a87a68 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,7.0.0.3) +AC_INIT(check_nwc_health,7.0.0.4) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST From dd77053c32a6095204e06c4936160454c0e042fd Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Thu, 8 Feb 2018 00:20:06 +0100 Subject: [PATCH 19/82] update glplugn, add modes encode/decode, rfc3986 --- ChangeLog | 2 ++ GLPlugin | 2 +- configure.ac | 2 +- plugins-scripts/check_nwc_health.pl | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b57e6ad1..7b04f587 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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 diff --git a/GLPlugin b/GLPlugin index 3b3e8b61..f413ae5b 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit 3b3e8b61b8b992844c11b21cd33929268f550dfc +Subproject commit f413ae5b3c823eb0974c933a7c4b9cb7cfc63d15 diff --git a/configure.ac b/configure.ac index 34a87a68..8382b9bc 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,7.0.0.4) +AC_INIT(check_nwc_health,7.0.0.5) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST diff --git a/plugins-scripts/check_nwc_health.pl b/plugins-scripts/check_nwc_health.pl index f562a0f5..8f301284 100644 --- a/plugins-scripts/check_nwc_health.pl +++ b/plugins-scripts/check_nwc_health.pl @@ -485,6 +485,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(); From 5cb70a4e0b308d4163be9e63dfd64a24ae8058ca Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Mon, 26 Feb 2018 13:42:17 +0100 Subject: [PATCH 20/82] ignore free space of iso mounts in hostresource mib fix a bug in hostresourcesmib memory calc. (arista eos) --- ChangeLog | 4 +++ configure.ac | 2 +- .../Component/DiskSubsystem.pm | 3 +- .../Component/MemSubsystem.pm | 31 +++++++++++++++++++ 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b57e6ad1..58198dcc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +* 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-01-23 7.0.0.4 merge pull request #164 (simonmeggle) add bluecoat asg fix from Stefan Kublik diff --git a/configure.ac b/configure.ac index 34a87a68..ea65aef3 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,7.0.0.4) +AC_INIT(check_nwc_health,7.0.0.6) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST diff --git a/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/DiskSubsystem.pm b/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/DiskSubsystem.pm index 030a3dac..644ae406 100644 --- a/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/DiskSubsystem.pm +++ b/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/DiskSubsystem.pm @@ -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; diff --git a/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/MemSubsystem.pm b/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/MemSubsystem.pm index cc7ab3ab..89eef945 100644 --- a/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/MemSubsystem.pm +++ b/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/MemSubsystem.pm @@ -9,6 +9,37 @@ sub init { ]); } +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; From 290d8dd214c358182ca788ea9fb69231a5275621 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Mon, 26 Feb 2018 13:43:30 +0100 Subject: [PATCH 21/82] update glplugin --- GLPlugin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GLPlugin b/GLPlugin index 3b3e8b61..c94788f6 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit 3b3e8b61b8b992844c11b21cd33929268f550dfc +Subproject commit c94788f63956ab5e6d4d1ab22fe0ffd8ef5273be From 4ba0029c5a2800f56c2d54e6de4ce142a32a872f Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Fri, 2 Mar 2018 15:51:41 +0100 Subject: [PATCH 22/82] glplugin update --- ChangeLog | 2 ++ GLPlugin | 2 +- configure.ac | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8ebab94d..5508b2be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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 diff --git a/GLPlugin b/GLPlugin index c94788f6..9ef43a54 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit c94788f63956ab5e6d4d1ab22fe0ffd8ef5273be +Subproject commit 9ef43a5441b0a4b1c55dc57d9686c9fb00bf64a8 diff --git a/configure.ac b/configure.ac index ea65aef3..23569045 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,7.0.0.6) +AC_INIT(check_nwc_health,7.0.0.7) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST From ded803ec6b372fd750d514c7dc21be69467e3a2b Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Wed, 7 Mar 2018 20:00:57 +0100 Subject: [PATCH 23/82] improve f5, G&D --- ChangeLog | 2 + GLPlugin | 2 +- configure.ac | 2 +- plugins-scripts/Classes/F5/F5BIGIP.pm | 6 ++ .../F5/F5BIGIP/Component/ConfigSubsystem.pm | 77 +++++++++++++ .../F5BIGIP/Component/ConnectionSubsystem.pm | 26 +++++ .../Classes/F5/F5BIGIP/Component/GTM.pm | 2 +- .../F5/F5BIGIP/Component/HaSubsystem.pm | 101 ++++++++++++++++++ .../Classes/F5/F5BIGIP/Component/LTM.pm | 13 ++- plugins-scripts/Makefile.am | 11 +- 10 files changed, 233 insertions(+), 9 deletions(-) create mode 100644 plugins-scripts/Classes/F5/F5BIGIP/Component/ConfigSubsystem.pm create mode 100644 plugins-scripts/Classes/F5/F5BIGIP/Component/ConnectionSubsystem.pm create mode 100644 plugins-scripts/Classes/F5/F5BIGIP/Component/HaSubsystem.pm diff --git a/ChangeLog b/ChangeLog index 5508b2be..c3fe5081 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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 diff --git a/GLPlugin b/GLPlugin index 9ef43a54..baedf430 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit 9ef43a5441b0a4b1c55dc57d9686c9fb00bf64a8 +Subproject commit baedf4305a6f24f84b02d867043d33553cbbd18c diff --git a/configure.ac b/configure.ac index 23569045..ea9ddf8e 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,7.0.0.7) +AC_INIT(check_nwc_health,7.0.1) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST diff --git a/plugins-scripts/Classes/F5/F5BIGIP.pm b/plugins-scripts/Classes/F5/F5BIGIP.pm index 63dcaef9..4ae02250 100644 --- a/plugins-scripts/Classes/F5/F5BIGIP.pm +++ b/plugins-scripts/Classes/F5/F5BIGIP.pm @@ -31,6 +31,12 @@ 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(); } 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/GTM.pm b/plugins-scripts/Classes/F5/F5BIGIP/Component/GTM.pm index 40bf992a..4e11958f 100644 --- a/plugins-scripts/Classes/F5/F5BIGIP/Component/GTM.pm +++ b/plugins-scripts/Classes/F5/F5BIGIP/Component/GTM.pm @@ -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; } 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 8e57aa92..0b8f1fff 100644 --- a/plugins-scripts/Classes/F5/F5BIGIP/Component/LTM.pm +++ b/plugins-scripts/Classes/F5/F5BIGIP/Component/LTM.pm @@ -161,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')) { @@ -178,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}; diff --git a/plugins-scripts/Makefile.am b/plugins-scripts/Makefile.am index 8cf98915..8734fcfd 100644 --- a/plugins-scripts/Makefile.am +++ b/plugins-scripts/Makefile.am @@ -300,15 +300,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 \ From ef8168c1570dd45b9ebf46dfb50a3f5c13da9511 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Tue, 13 Mar 2018 00:30:05 +0100 Subject: [PATCH 24/82] fix a bug in cisco enhanced mempool mib and posixmem --- ChangeLog | 2 ++ GLPlugin | 2 +- configure.ac | 2 +- .../Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm | 6 +++++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index c3fe5081..8ff3e905 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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 diff --git a/GLPlugin b/GLPlugin index baedf430..57f9297a 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit baedf4305a6f24f84b02d867043d33553cbbd18c +Subproject commit 57f9297a9e8cefa8a9a5edca7f0cb5a6c710e78b diff --git a/configure.ac b/configure.ac index ea9ddf8e..492226f6 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,7.0.1) +AC_INIT(check_nwc_health,7.0.1.1) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST diff --git a/plugins-scripts/Classes/Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm b/plugins-scripts/Classes/Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm index 0b0c6b06..cbb647be 100644 --- a/plugins-scripts/Classes/Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm +++ b/plugins-scripts/Classes/Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm @@ -19,7 +19,11 @@ sub finish { $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; From 37b1b600120e7ece2ea2471772bdd1a746f67301 Mon Sep 17 00:00:00 2001 From: Konstantin Shalygin Date: Thu, 15 Mar 2018 19:20:05 +0700 Subject: [PATCH 25/82] Eltex: workaround fan rpm in sensors table. --- .../Component/EnvironmentalSubsystem.pm | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/plugins-scripts/Classes/Eltex/Aggregation/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Eltex/Aggregation/Component/EnvironmentalSubsystem.pm index 6fa0dd85..05358119 100644 --- a/plugins-scripts/Classes/Eltex/Aggregation/Component/EnvironmentalSubsystem.pm +++ b/plugins-scripts/Classes/Eltex/Aggregation/Component/EnvironmentalSubsystem.pm @@ -39,15 +39,22 @@ use strict; sub check { my ($self) = @_; - $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', - ); + # 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; From 9921c04ed2d6e4fcc70680c60ec497e09c0d3fc5 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Sat, 31 Mar 2018 19:04:17 +0200 Subject: [PATCH 26/82] bugfix in link-aggregation-availability --- ChangeLog | 2 ++ GLPlugin | 2 +- configure.ac | 2 +- plugins-scripts/Classes/IFMIB.pm | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8ff3e905..15a6c752 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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 diff --git a/GLPlugin b/GLPlugin index 57f9297a..e8e1a290 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit 57f9297a9e8cefa8a9a5edca7f0cb5a6c710e78b +Subproject commit e8e1a2907a54435c932b3e6c584ba1d679754849 diff --git a/configure.ac b/configure.ac index 492226f6..2fe72756 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,7.0.1.1) +AC_INIT(check_nwc_health,7.0.1.2) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST 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; From 507a654f6fc282f3eef788081d5250233f7565cb Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Mon, 30 Apr 2018 20:46:51 +0200 Subject: [PATCH 27/82] bugfix in cisco global shared memory > 9.3.2 --- ChangeLog | 2 ++ configure.ac | 2 +- .../Component/MemSubsystem.pm | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 15a6c752..723b9637 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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 diff --git a/configure.ac b/configure.ac index 2fe72756..1e58f4ba 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,7.0.1.2) +AC_INIT(check_nwc_health,7.0.1.3) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST diff --git a/plugins-scripts/Classes/Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm b/plugins-scripts/Classes/Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm index cbb647be..9a73a48f 100644 --- a/plugins-scripts/Classes/Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm +++ b/plugins-scripts/Classes/Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm @@ -42,6 +42,21 @@ sub check { warning => 100, critical => 100, ); + } elsif ($self->{name} =~ /global.*shared/i) { + if ($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 + $self->force_thresholds( + metric => $self->{name}.'_usage', + warning => 100, + critical => 100, + ); + } + } + } } elsif ($self->{name} =~ /^reserved/ && $self->get_snmp_object('MIB-2-MIB', 'sysDescr', 0) =~ /IOS.*XR/i) { # ASR9K "reserved" and "image" are always at 100% From cb426524fe95206e4151078a24bfb25fd59e8569 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Sat, 5 May 2018 16:39:12 +0200 Subject: [PATCH 28/82] simplify the cisco memory exceptions --- ChangeLog | 2 + configure.ac | 2 +- .../Component/MemSubsystem.pm | 37 +++++++------------ 3 files changed, 17 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 723b9637..59d58282 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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 diff --git a/configure.ac b/configure.ac index 1e58f4ba..a53c85a0 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,7.0.1.3) +AC_INIT(check_nwc_health,7.0.1.4) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST diff --git a/plugins-scripts/Classes/Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm b/plugins-scripts/Classes/Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm index 9a73a48f..0ff0a015 100644 --- a/plugins-scripts/Classes/Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm +++ b/plugins-scripts/Classes/Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm @@ -34,39 +34,30 @@ sub check { 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, - ); - } elsif ($self->{name} =~ /global.*shared/i) { - if ($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 - $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; + } + if ($used100) { $self->force_thresholds( metric => $self->{name}.'_usage', warning => 100, From 2039845642bc8f77e76015838169fb4b246790b7 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Mon, 18 Jun 2018 20:13:21 +0200 Subject: [PATCH 29/82] update glplugin (get_snmp_table_objects waja fix) --- ChangeLog | 2 ++ GLPlugin | 2 +- configure.ac | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 59d58282..2badce74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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 diff --git a/GLPlugin b/GLPlugin index e8e1a290..e0f0edc8 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit e8e1a2907a54435c932b3e6c584ba1d679754849 +Subproject commit e0f0edc837d655145f3ccaac6209683bf2aaedd7 diff --git a/configure.ac b/configure.ac index a53c85a0..24e75516 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,7.0.1.4) +AC_INIT(check_nwc_health,7.0.1.5) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST From a3e66b34a51402616fb36f52cdfd1966264e68d2 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Wed, 4 Jul 2018 20:52:38 +0200 Subject: [PATCH 30/82] add braunschweig banner. meet me at the monitoring-workshop in september --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 51f05a96..06cab728 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ 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 ========== From 4a02c3b0daf7d77f6c401ad12de497c2689f3fc9 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Thu, 5 Jul 2018 16:46:51 +0200 Subject: [PATCH 31/82] fix a bug in non-map FabOS memory. set thresholds to 100% for cisco asa heapcache memory-usage --- ChangeLog | 3 +++ configure.ac | 2 +- .../Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm | 4 ++++ plugins-scripts/Classes/FabOS/Component/MemSubsystem.pm | 3 ++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2badce74..9fe5217d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +* 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 diff --git a/configure.ac b/configure.ac index 24e75516..d1a7c5fa 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,7.0.1.5) +AC_INIT(check_nwc_health,7.0.1.6) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST diff --git a/plugins-scripts/Classes/Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm b/plugins-scripts/Classes/Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm index 0ff0a015..4b938fcf 100644 --- a/plugins-scripts/Classes/Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm +++ b/plugins-scripts/Classes/Cisco/CISCOENHANCEDMEMPOOLMIB/Component/MemSubsystem.pm @@ -56,6 +56,10 @@ sub check { } 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( diff --git a/plugins-scripts/Classes/FabOS/Component/MemSubsystem.pm b/plugins-scripts/Classes/FabOS/Component/MemSubsystem.pm index d1518b64..63ff11a2 100644 --- a/plugins-scripts/Classes/FabOS/Component/MemSubsystem.pm +++ b/plugins-scripts/Classes/FabOS/Component/MemSubsystem.pm @@ -16,7 +16,8 @@ sub check { 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%%', From 0be32636e2495eec46cf94515cfff042b612566b Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Fri, 13 Jul 2018 20:12:12 +0200 Subject: [PATCH 32/82] add mode interface-uptime --- ChangeLog | 4 ++- GLPlugin | 2 +- configure.ac | 2 +- .../IFMIB/Component/InterfaceSubsystem.pm | 31 +++++++++++++++++++ plugins-scripts/check_nwc_health.pl | 6 ++++ 5 files changed, 42 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9fe5217d..4cb9dad3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ -* 2018-07-05 7.0.1.6 +* 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 diff --git a/GLPlugin b/GLPlugin index e0f0edc8..55e4ae3c 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit e0f0edc837d655145f3ccaac6209683bf2aaedd7 +Subproject commit 55e4ae3c32e1296e2327dccbcae4981ff2a42c3e diff --git a/configure.ac b/configure.ac index d1a7c5fa..18a82da7 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,7.0.1.6) +AC_INIT(check_nwc_health,7.0.2) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST diff --git a/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm b/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm index f4b278ea..772e9881 100644 --- a/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm +++ b/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm @@ -123,6 +123,10 @@ sub init { push(@ethertable_columns, qw( dot3StatsDuplexStatus )); + } elsif ($self->mode =~ /device::interfaces::uptime/) { + push(@iftable_columns, qw( + ifLastChange + )); } else { @iftable_columns = (); } @@ -604,6 +608,9 @@ sub finish { } } 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. @@ -752,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; } @@ -1071,6 +1090,18 @@ sub check { $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}, + ); } } diff --git a/plugins-scripts/check_nwc_health.pl b/plugins-scripts/check_nwc_health.pl index 8f301284..f634bae4 100644 --- a/plugins-scripts/check_nwc_health.pl +++ b/plugins-scripts/check_nwc_health.pl @@ -142,6 +142,12 @@ 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::routes::list', spec => 'list-routes', From 62330736cc976ec615dbc0a93320448c89153a6a Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Tue, 24 Jul 2018 18:04:23 +0000 Subject: [PATCH 33/82] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 06cab728..2c629089 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ Description ============ The plugin check_nwc_health was developed with the aim of having a single tool for all aspects of monitoring of network components. +**Komm nach Braunschweig und triff die Leute, die sich mit genau dem selben Kram beschäftigen wie du!** Motivation From 7374aec8a48f503f47f8129d09ae1e299d5a8247 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Tue, 24 Jul 2018 20:19:58 +0200 Subject: [PATCH 34/82] update readme --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 06cab728..3daf7c8e 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,11 @@ +**Komm nach Braunschweig und triff die Leute, die sich mit genau demselben Kram beschäftigen wie du!** + + Description ============ The plugin check_nwc_health was developed with the aim of having a single tool for all aspects of monitoring of network components. - +
Buy Me A Coffee
Motivation ========== From fd72568f8a5078f070a62fe4f49c70b73237a858 Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Wed, 25 Jul 2018 17:46:57 +0200 Subject: [PATCH 35/82] Update AVM.pm add support for fritzbox 7490. Only mode i tested so far is `--mode smart-home-device-energy`. Looking at the changelog, the 7390 and 7490 should be almost identical and have the same software running. --- plugins-scripts/Classes/UPNP/AVM.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins-scripts/Classes/UPNP/AVM.pm b/plugins-scripts/Classes/UPNP/AVM.pm index b0ad412b..e82ab70e 100644 --- a/plugins-scripts/Classes/UPNP/AVM.pm +++ b/plugins-scripts/Classes/UPNP/AVM.pm @@ -4,7 +4,7 @@ use strict; sub init { my ($self) = @_; - if ($self->{productname} =~ /7390/) { + if ($self->{productname} =~ /(7390|7490)/) { bless $self, 'Classes::UPNP::AVM::FritzBox7390'; $self->debug('using Classes::UPNP::AVM::FritzBox7390'); } elsif ($self->{productname} =~ /7490/) { From 72162166b662d3e6c56cabb794a48bea55b4d6f7 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Thu, 26 Jul 2018 14:38:58 +0200 Subject: [PATCH 36/82] add custom thresholds for cisco ccm --- ChangeLog | 2 ++ GLPlugin | 2 +- configure.ac | 2 +- .../Cisco/CCM/Component/PhoneSubsystem.pm | 21 +++++++++++++++++-- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4cb9dad3..f6da0349 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 2018-07-26 7.1 + add custom thresholds for cisco ccm * 2018-07-13 7.0.2 add interface-uptime 2018-07-05 7.0.1.6 diff --git a/GLPlugin b/GLPlugin index 55e4ae3c..9690fba8 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit 55e4ae3c32e1296e2327dccbcae4981ff2a42c3e +Subproject commit 9690fba84ee862b94dbfd74daf4f51dc41c5d542 diff --git a/configure.ac b/configure.ac index 18a82da7..8682a1a3 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,7.0.2) +AC_INIT(check_nwc_health,7.1) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST diff --git a/plugins-scripts/Classes/Cisco/CCM/Component/PhoneSubsystem.pm b/plugins-scripts/Classes/Cisco/CCM/Component/PhoneSubsystem.pm index 4d9dda8b..319d9b93 100644 --- a/plugins-scripts/Classes/Cisco/CCM/Component/PhoneSubsystem.pm +++ b/plugins-scripts/Classes/Cisco/CCM/Component/PhoneSubsystem.pm @@ -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}, From 0c3d7ba0e93ef0e3dc079dab0929f381d41f4604 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Thu, 26 Jul 2018 14:39:53 +0200 Subject: [PATCH 37/82] changelog, fritzbox 7490 --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index f6da0349..5082fd3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ * 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 From 86fb1d5d03f046ab07a6582b6340eae393de7900 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Wed, 1 Aug 2018 20:20:20 +0200 Subject: [PATCH 38/82] add pf engine for juniper standby nodes --- ChangeLog | 2 + GLPlugin | 2 +- configure.ac | 2 +- plugins-scripts/Classes/Device.pm | 2 +- plugins-scripts/Classes/Juniper/SRX.pm | 1 + .../Juniper/SRX/Component/CpuSubsystem.pm | 25 +++++++---- .../SRX/Component/EnvironmentalSubsystem.pm | 41 ++++++++++++++++++- .../Juniper/SRX/Component/MemSubsystem.pm | 28 +++++++++---- plugins-scripts/Makefile.am | 3 ++ 9 files changed, 86 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5082fd3f..7f06cc11 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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 diff --git a/GLPlugin b/GLPlugin index 9690fba8..35028981 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit 9690fba84ee862b94dbfd74daf4f51dc41c5d542 +Subproject commit 3502898174b24d5cbff9878daf853df14032c089 diff --git a/configure.ac b/configure.ac index 8682a1a3..bba66db5 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,7.1) +AC_INIT(check_nwc_health,7.2) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST diff --git a/plugins-scripts/Classes/Device.pm b/plugins-scripts/Classes/Device.pm index dd1df348..55287f4a 100644 --- a/plugins-scripts/Classes/Device.pm +++ b/plugins-scripts/Classes/Device.pm @@ -99,7 +99,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'); diff --git a/plugins-scripts/Classes/Juniper/SRX.pm b/plugins-scripts/Classes/Juniper/SRX.pm index 9ff2cd2a..50a645b9 100644 --- a/plugins-scripts/Classes/Juniper/SRX.pm +++ b/plugins-scripts/Classes/Juniper/SRX.pm @@ -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 4560db63..5de517fa 100644 --- a/plugins-scripts/Classes/Juniper/SRX/Component/CpuSubsystem.pm +++ b/plugins-scripts/Classes/Juniper/SRX/Component/CpuSubsystem.pm @@ -6,20 +6,27 @@ sub init { 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) = @_; $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( @@ -34,12 +41,16 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem); sub check { my ($self) = @_; - $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})); + $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 ee36bc4b..64836242 100644 --- a/plugins-scripts/Classes/Juniper/SRX/Component/EnvironmentalSubsystem.pm +++ b/plugins-scripts/Classes/Juniper/SRX/Component/EnvironmentalSubsystem.pm @@ -13,7 +13,17 @@ 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; @@ -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(); } } @@ -59,6 +71,8 @@ sub finish { 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; @@ -69,7 +83,7 @@ sub check { $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 addeeefd..e4d7a90a 100644 --- a/plugins-scripts/Classes/Juniper/SRX/Component/MemSubsystem.pm +++ b/plugins-scripts/Classes/Juniper/SRX/Component/MemSubsystem.pm @@ -7,8 +7,9 @@ sub init { $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'], ]); } @@ -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) = @_; - $self->add_info(sprintf '%s buffer usage is %.2f%%', + $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( @@ -54,12 +61,15 @@ our @ISA = qw(Monitoring::GLPlugin::SNMP::TableItem); sub check { my ($self) = @_; - $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})); + $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/Makefile.am b/plugins-scripts/Makefile.am index 8734fcfd..3a314269 100644 --- a/plugins-scripts/Makefile.am +++ b/plugins-scripts/Makefile.am @@ -76,8 +76,11 @@ GL_MODULES=\ ../GLPlugin/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/IFMIB.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 \ From 0e44bff23b866a6f39668a92fa4e188a95935237 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Fri, 10 Aug 2018 18:52:59 +0200 Subject: [PATCH 39/82] bugfix in ios ha-status --- ChangeLog | 2 ++ configure.ac | 2 +- plugins-scripts/Classes/Cisco/IOS/Component/HaSubsystem.pm | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7f06cc11..e5ffb604 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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 diff --git a/configure.ac b/configure.ac index bba66db5..2a73627f 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,7.2) +AC_INIT(check_nwc_health,7.2.0.1) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST 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") { From 238821508975f143362e5a92b4f671b0625cb944 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Mon, 13 Aug 2018 21:16:39 +0200 Subject: [PATCH 40/82] bugfix in interface-modes where --name3 found no match --- ChangeLog | 2 ++ configure.ac | 2 +- plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e5ffb604..068bc7a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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 diff --git a/configure.ac b/configure.ac index 2a73627f..f179b8af 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,7.2.0.1) +AC_INIT(check_nwc_health,7.2.0.2) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST diff --git a/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm b/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm index 772e9881..2642a2df 100644 --- a/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm +++ b/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm @@ -168,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)) { From 390aa5d52ed64ef78ce2efa57eb3e9804be42b34 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Tue, 21 Aug 2018 00:37:41 +0200 Subject: [PATCH 41/82] flatten indices in if-stack --- .../Classes/IFMIB/Component/StackSubsystem.pm | 75 +++++++++++++++---- 1 file changed, 60 insertions(+), 15 deletions(-) diff --git a/plugins-scripts/Classes/IFMIB/Component/StackSubsystem.pm b/plugins-scripts/Classes/IFMIB/Component/StackSubsystem.pm index aee86477..6c618705 100644 --- a/plugins-scripts/Classes/IFMIB/Component/StackSubsystem.pm +++ b/plugins-scripts/Classes/IFMIB/Component/StackSubsystem.pm @@ -11,6 +11,10 @@ sub init { if (! $self->opts->name) { # get_table erzwingen @higher_indices = (); + } elsif (scalar(@higher_indices)) { + @higher_indices = map { $_->[0] } @higher_indices; + } else { + @higher_indices = (); } $self->get_snmp_tables("IFMIB", [ ['stacks', 'ifStackTable', 'Classes::IFMIB::Component::StackSubsystem::Relationship'], @@ -18,19 +22,19 @@ sub init { 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 (grep { $rel->{ifStackHigherLayer} == $_ } @higher_indices) { + push(@lower_indices, $rel->{ifStackLowerLayer}); } } else { if ($rel->{ifStackLowerLayer} && $rel->{ifStackHigherLayer}) { - push(@higher_indices, [$rel->{ifStackHigherLayer}]); - push(@lower_indices, [$rel->{ifStackLowerLayer}]); + push(@higher_indices, $rel->{ifStackHigherLayer}); + 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)}}; + @higher_indices = keys %{{map {($_ => 1)} @higher_indices}}; + @lower_indices = grep { $_ != 0 } keys %{{map {($_ => 1)} @lower_indices}}; + my @indices = map { [$_] } keys %{{map {($_ => 1)} (@higher_indices, @lower_indices)}}; my $higher_interfaces = {}; my $lower_interfaces = {}; $self->{interfaces} = []; @@ -39,14 +43,43 @@ sub init { foreach ($self->get_snmp_table_objects( 'IFMIB', 'ifTable+ifXTable', \@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; + $higher_interfaces->{$interface->{ifIndex}} = $interface if grep { $interface->{ifIndex} == $_ } @higher_indices; + $lower_interfaces->{$interface->{ifIndex}} = $interface if grep { $interface->{ifIndex} == $_ } @lower_indices; push(@{$self->{interfaces}}, $interface); } } $self->{higher_interfaces} = $higher_interfaces; $self->{lower_interfaces} = $lower_interfaces; + @{$self->{stacks}} = grep { + my $rel = $_; + grep { $rel->{ifStackHigherLayer} eq $_; } @higher_indices; + } @{$self->{stacks}}; $self->arista_schlamperei(); + $self->link_stack_to_interfaces(); +} + +sub link_stack_to_interfaces { + my ($self) = @_; + foreach my $rel (@{$self->{stacks}}) { + if ($rel->{ifStackHigherLayer} == 0) { + $rel->{ifStackHigherLayerInterface} = "-"; + } elsif (exists $self->{higher_interfaces}->{$rel->{ifStackHigherLayer}}) { + $rel->{ifStackHigherLayerInterface} = $self->{higher_interfaces}->{$rel->{ifStackHigherLayer}}->{ifDescr}; + } elsif (exists $self->{lower_interfaces}->{$rel->{ifStackHigherLayer}}) { + $rel->{ifStackHigherLayerInterface} = $self->{lower_interfaces}->{$rel->{ifStackHigherLayer}}->{ifDescr}; + } else { + $rel->{ifStackHigherLayerInterface} = "?"; + } + if ($rel->{ifStackLowerLayer} == 0) { + $rel->{ifStackLowerLayerInterface} = "-"; + } elsif (exists $self->{higher_interfaces}->{$rel->{ifStackLowerLayer}}) { + $rel->{ifStackLowerLayerInterface} = $self->{higher_interfaces}->{$rel->{ifStackLowerLayer}}->{ifDescr}; + } elsif (exists $self->{lower_interfaces}->{$rel->{ifStackLowerLayer}}) { + $rel->{ifStackLowerLayerInterface} = $self->{lower_interfaces}->{$rel->{ifStackLowerLayer}}->{ifDescr}; + } else { + $rel->{ifStackLowerLayerInterface} = "?"; + } + } } sub arista_schlamperei { @@ -55,17 +88,21 @@ sub arista_schlamperei { # 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}}; + # 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. } sub check { @@ -104,9 +141,17 @@ sub check { } } 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}); + if ($rel->{ifStackLowerLayer} == 0 && $rel->{ifStackStatus} ne 'notInService') { + $self->add_warning(sprintf '%s (%s) has stack status %s but no sub-layer interfaces. Oper status is %s', + $higher_interfaces->{$rel->{ifStackHigherLayer}}->{ifDescr}, + $higher_interfaces->{$rel->{ifStackHigherLayer}}->{ifAlias}, + $rel->{ifStackStatus}, + $higher_interfaces->{$rel->{ifStackHigherLayer}}->{ifOperStatus}); + } else { + $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' && From 0af34957d6a284c84b244c2cd5a307bdf3ea282b Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Mon, 10 Sep 2018 10:48:13 +0200 Subject: [PATCH 42/82] update cisco vpn-status --- .../Component/VpnSubsystem.pm | 104 ++++++++++++++++-- plugins-scripts/Classes/Cisco/IOS.pm | 2 + 2 files changed, 98 insertions(+), 8 deletions(-) diff --git a/plugins-scripts/Classes/Cisco/CISCOIPSECFLOWMONITOR/Component/VpnSubsystem.pm b/plugins-scripts/Classes/Cisco/CISCOIPSECFLOWMONITOR/Component/VpnSubsystem.pm index 503242bc..02f45ffd 100644 --- a/plugins-scripts/Classes/Cisco/CISCOIPSECFLOWMONITOR/Component/VpnSubsystem.pm +++ b/plugins-scripts/Classes/Cisco/CISCOIPSECFLOWMONITOR/Component/VpnSubsystem.pm @@ -4,38 +4,126 @@ use strict; sub init { 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) = @_; $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) = @_; - if (! @{$self->{ciketunnels}}) { + 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) = @_; -# 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') { + $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->{snmp_sysUptime} = $self->get_snmp_object('MIB-2-MIB', 'sysUpTime', 0); + $self->{snmp_sysUptime} /= 100; + $self->{cikeFailTime} /= 100; + $self->{cikeFailTimeAgo} = $self->{snmp_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->{snmp_sysUptime} = $self->get_snmp_object('MIB-2-MIB', 'sysUpTime', 0); + $self->{snmp_sysUptime} /= 100; + $self->{cipSecFailTime} /= 100; + $self->{cipSecFailTimeAgo} = $self->{snmp_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/IOS.pm b/plugins-scripts/Classes/Cisco/IOS.pm index 1a8ef015..d25c5ecf 100644 --- a/plugins-scripts/Classes/Cisco/IOS.pm +++ b/plugins-scripts/Classes/Cisco/IOS.pm @@ -38,6 +38,8 @@ sub init { $self->analyze_and_check_config_subsystem("Classes::Cisco::IOS::Component::BgpSubsystem"); } 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(); } From cb996e354bf1377c5a65a0bda42f492dbdb83001 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Mon, 10 Sep 2018 10:50:15 +0200 Subject: [PATCH 43/82] add servertype hostresource --- plugins-scripts/Classes/Device.pm | 3 +++ plugins-scripts/Classes/HOSTRESOURCESMIB.pm | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/plugins-scripts/Classes/Device.pm b/plugins-scripts/Classes/Device.pm index 55287f4a..d9228755 100644 --- a/plugins-scripts/Classes/Device.pm +++ b/plugins-scripts/Classes/Device.pm @@ -40,6 +40,7 @@ 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'; } if ($self->opts->mode eq "uptime" && $self->opts->mode eq "short") { return $self; @@ -142,6 +143,8 @@ 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} =~ /Linux Stingray/i) { $self->rebless('Classes::HOSTRESOURCESMIB'); } elsif ($self->{productname} =~ /Fortinet|Fortigate/i) { diff --git a/plugins-scripts/Classes/HOSTRESOURCESMIB.pm b/plugins-scripts/Classes/HOSTRESOURCESMIB.pm index 7a5febc1..dcc1b4d3 100644 --- a/plugins-scripts/Classes/HOSTRESOURCESMIB.pm +++ b/plugins-scripts/Classes/HOSTRESOURCESMIB.pm @@ -2,3 +2,16 @@ 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"); + } 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(); + } +} + From 27f7df8d772e29cdd25cd57faa308cad07e06eb4 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Mon, 10 Sep 2018 10:50:49 +0200 Subject: [PATCH 44/82] update stack-status# --- .../Classes/IFMIB/Component/StackSubsystem.pm | 307 +++++++++--------- 1 file changed, 148 insertions(+), 159 deletions(-) diff --git a/plugins-scripts/Classes/IFMIB/Component/StackSubsystem.pm b/plugins-scripts/Classes/IFMIB/Component/StackSubsystem.pm index 6c618705..b617f9e5 100644 --- a/plugins-scripts/Classes/IFMIB/Component/StackSubsystem.pm +++ b/plugins-scripts/Classes/IFMIB/Component/StackSubsystem.pm @@ -7,87 +7,91 @@ 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 = (); - } elsif (scalar(@higher_indices)) { - @higher_indices = map { $_->[0] } @higher_indices; + @selected_indices = (); + } elsif (scalar(@selected_indices)) { + @selected_indices = map { $_->[0] } @selected_indices; } else { - @higher_indices = (); + @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} == $_ } @higher_indices) { + 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}); + if (defined $rel->{ifStackLowerLayer} && $rel->{ifStackHigherLayer}) { + push(@higher_indices, $rel->{ifStackHigherLayer}) if $rel->{ifStackLowerLayer}; push(@lower_indices, $rel->{ifStackLowerLayer}); } } } - @higher_indices = keys %{{map {($_ => 1)} @higher_indices}}; + @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)}}; - my $higher_interfaces = {}; - my $lower_interfaces = {}; - $self->{interfaces} = []; + 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} == $_ } @higher_indices; - $lower_interfaces->{$interface->{ifIndex}} = $interface if grep { $interface->{ifIndex} == $_ } @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->{higher_interfaces} = $higher_interfaces; - $self->{lower_interfaces} = $lower_interfaces; - @{$self->{stacks}} = grep { - my $rel = $_; - grep { $rel->{ifStackHigherLayer} eq $_; } @higher_indices; - } @{$self->{stacks}}; - $self->arista_schlamperei(); - $self->link_stack_to_interfaces(); + #$self->arista_schlamperei(); + $self->link_stack_to_interfaces(@higher_indices); } sub link_stack_to_interfaces { - my ($self) = @_; + my ($self, @higher_indices) = @_; + $self->{interfaces} = []; foreach my $rel (@{$self->{stacks}}) { - if ($rel->{ifStackHigherLayer} == 0) { - $rel->{ifStackHigherLayerInterface} = "-"; - } elsif (exists $self->{higher_interfaces}->{$rel->{ifStackHigherLayer}}) { - $rel->{ifStackHigherLayerInterface} = $self->{higher_interfaces}->{$rel->{ifStackHigherLayer}}->{ifDescr}; - } elsif (exists $self->{lower_interfaces}->{$rel->{ifStackHigherLayer}}) { - $rel->{ifStackHigherLayerInterface} = $self->{lower_interfaces}->{$rel->{ifStackHigherLayer}}->{ifDescr}; - } else { - $rel->{ifStackHigherLayerInterface} = "?"; - } - if ($rel->{ifStackLowerLayer} == 0) { - $rel->{ifStackLowerLayerInterface} = "-"; - } elsif (exists $self->{higher_interfaces}->{$rel->{ifStackLowerLayer}}) { - $rel->{ifStackLowerLayerInterface} = $self->{higher_interfaces}->{$rel->{ifStackLowerLayer}}->{ifDescr}; - } elsif (exists $self->{lower_interfaces}->{$rel->{ifStackLowerLayer}}) { - $rel->{ifStackLowerLayerInterface} = $self->{lower_interfaces}->{$rel->{ifStackLowerLayer}}->{ifDescr}; - } else { - $rel->{ifStackLowerLayerInterface} = "?"; + 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->{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 @have_lower = map { $_->{ifStackHigherLayer} } grep { @@ -99,145 +103,130 @@ sub arista_schlamperei { my $ref = $_; ! ($ref->{ifStackLowerLayer} == 0 && grep /^$ref->{ifStackHigherLayer}$/, @have_lower) } @{$self->{stacks}}; - # 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. } 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}); + 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); } - } elsif ($rel->{ifStackLowerLayer} == 0 && $rel->{ifStackStatus} ne 'notInService') { - if ($self->mode =~ /device::interfaces::ifstack::status/) { - if ($rel->{ifStackLowerLayer} == 0 && $rel->{ifStackStatus} ne 'notInService') { - $self->add_warning(sprintf '%s (%s) has stack status %s but no sub-layer interfaces. Oper status is %s', - $higher_interfaces->{$rel->{ifStackHigherLayer}}->{ifDescr}, - $higher_interfaces->{$rel->{ifStackHigherLayer}}->{ifAlias}, - $rel->{ifStackStatus}, - $higher_interfaces->{$rel->{ifStackHigherLayer}}->{ifOperStatus}); + $index++; + } + if ($self->mode =~ /device::interfaces::ifstack::status/) { + 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_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}); + $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 ($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}); - } - $lower_counter->{$rel->{ifStackHigherLayer}}++; - $lower_needed->{$rel->{ifStackHigherLayer}}++; - } else { - $lower_counter->{$rel->{ifStackHigherLayer}}++; - $lower_needed->{$rel->{ifStackHigherLayer}}++; - } - } - 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}); } 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' : '', ); } } From eb13c834149fd3121edbf6007d155674b9c7ada5 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Mon, 10 Sep 2018 10:53:19 +0200 Subject: [PATCH 45/82] changelog --- ChangeLog | 4 ++++ configure.ac | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 068bc7a6..b9d9cbd4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +* 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 diff --git a/configure.ac b/configure.ac index f179b8af..dd2092d1 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,7.2.0.2) +AC_INIT(check_nwc_health,7.3) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST From 5cc7112cf8d30e49a40ce952619f43972a4e1e0d Mon Sep 17 00:00:00 2001 From: Rika Lena Denia Date: Wed, 26 Sep 2018 15:31:00 +0200 Subject: [PATCH 46/82] Update GLPlugin --- GLPlugin | 2 +- plugins-scripts/Makefile.am | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/GLPlugin b/GLPlugin index 35028981..16d7c662 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit 3502898174b24d5cbff9878daf853df14032c089 +Subproject commit 16d7c662ae9b22ad67df5375f62d23e9a0745362 diff --git a/plugins-scripts/Makefile.am b/plugins-scripts/Makefile.am index 3a314269..7cf6d93a 100644 --- a/plugins-scripts/Makefile.am +++ b/plugins-scripts/Makefile.am @@ -69,6 +69,7 @@ GL_MODULES=\ ../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 \ From 37832e7eed2b305df1317be6b4cd5193bfaf4a66 Mon Sep 17 00:00:00 2001 From: Rika Lena Denia Date: Wed, 26 Sep 2018 15:20:30 +0200 Subject: [PATCH 47/82] Huawei: Remove WIP HUAWEI-ENTITY-EXTENT-MIB definition This one is used for Huawei CloudEngine switches. Let's define them cleanly in GLPlugin instead. --- plugins-scripts/Classes/Huawei/CloudEngine.pm | 646 ------------------ 1 file changed, 646 deletions(-) diff --git a/plugins-scripts/Classes/Huawei/CloudEngine.pm b/plugins-scripts/Classes/Huawei/CloudEngine.pm index 8be77f1f..1e646108 100644 --- a/plugins-scripts/Classes/Huawei/CloudEngine.pm +++ b/plugins-scripts/Classes/Huawei/CloudEngine.pm @@ -4,653 +4,7 @@ use strict; sub init { my ($self) = @_; -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 $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/) { From d8485f3254c79a494ee8a059dc097699a9c529ec Mon Sep 17 00:00:00 2001 From: Rika Lena Denia Date: Wed, 26 Sep 2018 15:24:33 +0200 Subject: [PATCH 48/82] Huawei: Fully re-enable CloudEngine --- plugins-scripts/Classes/Huawei/CloudEngine.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins-scripts/Classes/Huawei/CloudEngine.pm b/plugins-scripts/Classes/Huawei/CloudEngine.pm index 1e646108..f46ce28a 100644 --- a/plugins-scripts/Classes/Huawei/CloudEngine.pm +++ b/plugins-scripts/Classes/Huawei/CloudEngine.pm @@ -39,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'], ]); } From eaa6cb97b6a03be58165930aa5a146d82ee1d34e Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Wed, 26 Sep 2018 16:05:43 +0200 Subject: [PATCH 49/82] list-routes, start enhance --- GLPlugin | 2 +- .../Component/RoutingSubsystem.pm | 20 +++++++++++++++---- plugins-scripts/Makefile.am | 1 + 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/GLPlugin b/GLPlugin index 35028981..7fb116a1 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit 3502898174b24d5cbff9878daf853df14032c089 +Subproject commit 7fb116a15a716a9dadd6640ec01f36b4dd2b6870 diff --git a/plugins-scripts/Classes/IPFORWARDMIB/Component/RoutingSubsystem.pm b/plugins-scripts/Classes/IPFORWARDMIB/Component/RoutingSubsystem.pm index 1e3ddb03..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 @@ -120,12 +120,17 @@ sub finish { 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/Makefile.am b/plugins-scripts/Makefile.am index 3a314269..a0faeb60 100644 --- a/plugins-scripts/Makefile.am +++ b/plugins-scripts/Makefile.am @@ -74,6 +74,7 @@ GL_MODULES=\ ../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 \ From 957972f263f61ccdd92be168a5c91b89d148e8e6 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Wed, 26 Sep 2018 16:37:04 +0200 Subject: [PATCH 50/82] re-enable Huawei CloudEngine support --- ChangeLog | 2 ++ GLPlugin | 2 +- configure.ac | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b9d9cbd4..bd05f29b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 2018-09-25 7.3.0.1 + re-enable Huawei CloudEngine support * 2018-09-10 7.3 update stack-status add servertype hostresource diff --git a/GLPlugin b/GLPlugin index 16d7c662..af547214 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit 16d7c662ae9b22ad67df5375f62d23e9a0745362 +Subproject commit af5472149efc013ca6fc8ae85a8272e510650ade diff --git a/configure.ac b/configure.ac index dd2092d1..da0626a4 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,7.3) +AC_INIT(check_nwc_health,7.3.0.1) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST From b96ceca212e85b264020c4cf1e3a728c9d302ddd Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Fri, 28 Sep 2018 15:27:36 +0200 Subject: [PATCH 51/82] update glplugin --- ChangeLog | 2 ++ GLPlugin | 2 +- configure.ac | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index bd05f29b..5b5b061a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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 diff --git a/GLPlugin b/GLPlugin index af547214..5a1c452c 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit af5472149efc013ca6fc8ae85a8272e510650ade +Subproject commit 5a1c452c907df961578aad57a069432c2c1f94b3 diff --git a/configure.ac b/configure.ac index da0626a4..e855bf8b 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,7.3.0.1) +AC_INIT(check_nwc_health,7.3.0.2) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST From 11ff0c9eca0b559d33927e73e84b361072414f75 Mon Sep 17 00:00:00 2001 From: Jorgen Date: Tue, 9 Oct 2018 22:41:54 +0200 Subject: [PATCH 52/82] Correct unbalanced parentheses --- README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 3daf7c8e..72401cc0 100644 --- a/README.md +++ b/README.md @@ -27,23 +27,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 | @@ -63,7 +63,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) | From c9d2ed9bcdc7ca74f32014968320e40d7b8609ba Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Wed, 17 Oct 2018 00:51:53 +0200 Subject: [PATCH 53/82] better fortigate detection, update glplugin --- ChangeLog | 3 +++ GLPlugin | 2 +- configure.ac | 2 +- plugins-scripts/Classes/Device.pm | 2 ++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5b5b061a..972e264e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +* 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 diff --git a/GLPlugin b/GLPlugin index 5a1c452c..fc0c578a 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit 5a1c452c907df961578aad57a069432c2c1f94b3 +Subproject commit fc0c578abb7d2f2882414c73d46fdd6a75f1f607 diff --git a/configure.ac b/configure.ac index e855bf8b..008de9c3 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,7.3.0.2) +AC_INIT(check_nwc_health,7.3.0.3) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST diff --git a/plugins-scripts/Classes/Device.pm b/plugins-scripts/Classes/Device.pm index d9228755..e512583d 100644 --- a/plugins-scripts/Classes/Device.pm +++ b/plugins-scripts/Classes/Device.pm @@ -149,6 +149,8 @@ sub classify { $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')) { From f052dd48bec596bc0547382b6291cb86db793774 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Wed, 17 Oct 2018 00:52:46 +0200 Subject: [PATCH 54/82] rm braunschweig banner --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 72401cc0..86a66fd1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,3 @@ -**Komm nach Braunschweig und triff die Leute, die sich mit genau demselben Kram beschäftigen wie du!** - - Description ============ The plugin check_nwc_health was developed with the aim of having a single tool for all aspects of monitoring of network components. From 68d9d5e5924b9af9d3a9d75137c3999a4eace591 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Sun, 21 Oct 2018 23:05:11 +0200 Subject: [PATCH 55/82] update glplugin (for go-worker) --- ChangeLog | 2 ++ GLPlugin | 2 +- configure.ac | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 972e264e..c1475c21 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 2018-10-21 7.3.0.4 + update glplugin (for go-worker) * 2018-10-17 7.3.0.3 update glplugin better fortigate detection diff --git a/GLPlugin b/GLPlugin index fc0c578a..da8f5c3b 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit fc0c578abb7d2f2882414c73d46fdd6a75f1f607 +Subproject commit da8f5c3b67abf1f03928521d695c8922df2705a2 diff --git a/configure.ac b/configure.ac index 008de9c3..8299cc5b 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,7.3.0.3) +AC_INIT(check_nwc_health,7.3.0.4) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST From bb7025e6a1a2999e1c739ea4d540d88515fd4403 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Mon, 22 Oct 2018 10:08:56 +0200 Subject: [PATCH 56/82] update glplugin (CISCO-STACKWISE-MIB) --- ChangeLog | 2 ++ GLPlugin | 2 +- configure.ac | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c1475c21..65d7afbc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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 diff --git a/GLPlugin b/GLPlugin index da8f5c3b..16dca33c 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit da8f5c3b67abf1f03928521d695c8922df2705a2 +Subproject commit 16dca33c20689b9a553ad433828b0bf658e8b7b0 diff --git a/configure.ac b/configure.ac index 8299cc5b..3438fce8 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,7.3.0.4) +AC_INIT(check_nwc_health,7.3.0.5) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST From 7df15ff6025451fc83b34969636692a524da206c Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Mon, 22 Oct 2018 21:29:48 +0200 Subject: [PATCH 57/82] add modes ha-status/role for fortigate --- ChangeLog | 2 + GLPlugin | 2 +- configure.ac | 2 +- plugins-scripts/Classes/Fortigate.pm | 4 +- .../Fortigate/Component/HaSubsystem.pm | 79 +++++++++++++++++++ plugins-scripts/Makefile.am | 2 + 6 files changed, 88 insertions(+), 3 deletions(-) create mode 100644 plugins-scripts/Classes/Fortigate/Component/HaSubsystem.pm diff --git a/ChangeLog b/ChangeLog index 65d7afbc..4b8696f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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 diff --git a/GLPlugin b/GLPlugin index 16dca33c..d70306a9 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit 16dca33c20689b9a553ad433828b0bf658e8b7b0 +Subproject commit d70306a9cac4ed10eb624a1e386c238880625974 diff --git a/configure.ac b/configure.ac index 3438fce8..0d323257 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,7.3.0.5) +AC_INIT(check_nwc_health,7.3.1) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST diff --git a/plugins-scripts/Classes/Fortigate.pm b/plugins-scripts/Classes/Fortigate.pm index 640fb0cd..e61883eb 100644 --- a/plugins-scripts/Classes/Fortigate.pm +++ b/plugins-scripts/Classes/Fortigate.pm @@ -1,5 +1,5 @@ package Classes::Fortigate; -our @ISA = qw(Classes::Brocade); +our @ISA = qw(Classes::Device); use strict; sub init { @@ -10,6 +10,8 @@ sub init { $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/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/Makefile.am b/plugins-scripts/Makefile.am index 594b4a57..af898d2c 100644 --- a/plugins-scripts/Makefile.am +++ b/plugins-scripts/Makefile.am @@ -64,6 +64,7 @@ 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 \ @@ -231,6 +232,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 \ From 86712e684b0288250045d86e47c04f00557bb519 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Mon, 3 Dec 2018 20:52:28 +0100 Subject: [PATCH 58/82] fix ciscoipsecflow fail timestamps --- .../Cisco/CISCOIPSECFLOWMONITOR/Component/VpnSubsystem.pm | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/plugins-scripts/Classes/Cisco/CISCOIPSECFLOWMONITOR/Component/VpnSubsystem.pm b/plugins-scripts/Classes/Cisco/CISCOIPSECFLOWMONITOR/Component/VpnSubsystem.pm index 02f45ffd..2c2b9cf5 100644 --- a/plugins-scripts/Classes/Cisco/CISCOIPSECFLOWMONITOR/Component/VpnSubsystem.pm +++ b/plugins-scripts/Classes/Cisco/CISCOIPSECFLOWMONITOR/Component/VpnSubsystem.pm @@ -73,10 +73,8 @@ sub finish { $self->{cikeFailLocalValue} = $self->unhex_ip($self->{cikeFailLocalValue}); $self->{cikeFailRemoteAddr} = $self->unhex_ip($self->{cikeFailRemoteAddr}); $self->{cikeFailRemoteValue} = $self->unhex_ip($self->{cikeFailRemoteValue}); - $self->{snmp_sysUptime} = $self->get_snmp_object('MIB-2-MIB', 'sysUpTime', 0); - $self->{snmp_sysUptime} /= 100; $self->{cikeFailTime} /= 100; - $self->{cikeFailTimeAgo} = $self->{snmp_sysUptime} - $self->{cikeFailTime}; + $self->{cikeFailTimeAgo} = $self->ago_sysuptime($self->{cikeFailTime}); } sub check { @@ -106,10 +104,8 @@ sub finish { my ($self) = @_; $self->{cipSecFailPktDstAddr} = $self->unhex_ip($self->{cipSecFailPktDstAddr}); $self->{cipSecFailPktSrcAddr} = $self->unhex_ip($self->{cipSecFailPktSrcAddr}); - $self->{snmp_sysUptime} = $self->get_snmp_object('MIB-2-MIB', 'sysUpTime', 0); - $self->{snmp_sysUptime} /= 100; $self->{cipSecFailTime} /= 100; - $self->{cipSecFailTimeAgo} = $self->{snmp_sysUptime} - $self->{cipSecFailTime}; + $self->{cipSecFailTimeAgo} = $self->ago_sysuptime($self->{cipSecFailTime}); } sub check { From 858dc1ebf8bb309f3655e30e5fd37c7c0fba5b7c Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Mon, 3 Dec 2018 20:53:53 +0100 Subject: [PATCH 59/82] fix cswStackBandWidth problem --- .../Component/StackSubsystem.pm | 46 ++++++++++++++----- 1 file changed, 35 insertions(+), 11 deletions(-) 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); From 4bb1f03656428a342d7ba2bc5f0237a27457d384 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Mon, 3 Dec 2018 20:55:35 +0100 Subject: [PATCH 60/82] add servertype generic_ucd --- plugins-scripts/Classes/Device.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins-scripts/Classes/Device.pm b/plugins-scripts/Classes/Device.pm index e512583d..6d90e9a3 100644 --- a/plugins-scripts/Classes/Device.pm +++ b/plugins-scripts/Classes/Device.pm @@ -41,6 +41,7 @@ sub classify { $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; @@ -145,6 +146,8 @@ sub classify { $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) { From ead2749def5ce63ddfb1dc534bf4e2be3565f74c Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Mon, 3 Dec 2018 20:56:43 +0100 Subject: [PATCH 61/82] add lmsensors to hostresources checks --- plugins-scripts/Classes/HOSTRESOURCESMIB.pm | 4 ++++ .../Component/DeviceSubsystem.pm | 24 +++++++++++++++++++ .../Component/EnvironmentalSubsystem.pm | 1 + 3 files changed, 29 insertions(+) diff --git a/plugins-scripts/Classes/HOSTRESOURCESMIB.pm b/plugins-scripts/Classes/HOSTRESOURCESMIB.pm index dcc1b4d3..dc7ac919 100644 --- a/plugins-scripts/Classes/HOSTRESOURCESMIB.pm +++ b/plugins-scripts/Classes/HOSTRESOURCESMIB.pm @@ -6,6 +6,10 @@ 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/) { diff --git a/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/DeviceSubsystem.pm b/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/DeviceSubsystem.pm index ce4bb440..7a15a892 100644 --- a/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/DeviceSubsystem.pm +++ b/plugins-scripts/Classes/HOSTRESOURCESMIB/Component/DeviceSubsystem.pm @@ -15,10 +15,33 @@ use strict; sub finish { 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'; } } @@ -44,3 +67,4 @@ sub check { } } + diff --git a/plugins-scripts/Classes/LMSENSORSMIB/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/LMSENSORSMIB/Component/EnvironmentalSubsystem.pm index b7ad8816..ae3c4b4a 100644 --- a/plugins-scripts/Classes/LMSENSORSMIB/Component/EnvironmentalSubsystem.pm +++ b/plugins-scripts/Classes/LMSENSORSMIB/Component/EnvironmentalSubsystem.pm @@ -14,6 +14,7 @@ sub check { my ($self) = @_; $self->{fan_subsystem}->check(); $self->{temperature_subsystem}->check(); + $self->reduce_messages_short('lmsensors are fine'); } sub dump { From 5904b2c0da4cfa576f54573c70245c255230ec3e Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Mon, 3 Dec 2018 20:57:19 +0100 Subject: [PATCH 62/82] make ospf checks ipv6 ready --- .../OSPF/Component/NeighborSubsystem.pm | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/plugins-scripts/Classes/OSPF/Component/NeighborSubsystem.pm b/plugins-scripts/Classes/OSPF/Component/NeighborSubsystem.pm index 9613a8b9..d81ce2ad 100644 --- a/plugins-scripts/Classes/OSPF/Component/NeighborSubsystem.pm +++ b/plugins-scripts/Classes/OSPF/Component/NeighborSubsystem.pm @@ -7,13 +7,22 @@ sub init { $self->get_snmp_tables('OSPF-MIB', [ ['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) = @_; 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"); } } @@ -24,9 +33,13 @@ sub check { 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}}; } } @@ -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 From d7d6ec491e4e666e744177c82a06feaf85146cc5 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Mon, 3 Dec 2018 20:58:26 +0100 Subject: [PATCH 63/82] forgot lmsensors dreckszeug --- plugins-scripts/Classes/UCDMIB.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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(); + } +} + From 9bbdafcb3821bff5955c79d141f5a0277e806f43 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Mon, 3 Dec 2018 21:10:47 +0100 Subject: [PATCH 64/82] use propritary mibs for cisco bgp --- ChangeLog | 5 + GLPlugin | 2 +- configure.ac | 2 +- plugins-scripts/Classes/Cisco/IOS.pm | 3 +- .../Cisco/IOS/Component/BgpSubsystem.pm | 114 ++++++++++++++++-- plugins-scripts/Makefile.am | 1 + 6 files changed, 111 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4b8696f3..44ed3cb2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +* 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 diff --git a/GLPlugin b/GLPlugin index d70306a9..4a7c4d48 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit d70306a9cac4ed10eb624a1e386c238880625974 +Subproject commit 4a7c4d48ee14a30721bc750613f55163ce97ef50 diff --git a/configure.ac b/configure.ac index 0d323257..e7fa7aae 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,7.3.1) +AC_INIT(check_nwc_health,7.4) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST diff --git a/plugins-scripts/Classes/Cisco/IOS.pm b/plugins-scripts/Classes/Cisco/IOS.pm index d25c5ecf..1ecb3b5d 100644 --- a/plugins-scripts/Classes/Cisco/IOS.pm +++ b/plugins-scripts/Classes/Cisco/IOS.pm @@ -34,7 +34,8 @@ 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/) { + #} elsif ($self->mode =~ /device::bgp::prefix::count/) { + } elsif ($self->mode =~ /device::bgp/) { $self->analyze_and_check_config_subsystem("Classes::Cisco::IOS::Component::BgpSubsystem"); } elsif ($self->mode =~ /device::wlan/ && $self->implements_mib('AIRESPACE-WIRELESS-MIB')) { $self->analyze_and_check_wlan_subsystem("Classes::Cisco::WLC::Component::WlanSubsystem"); diff --git a/plugins-scripts/Classes/Cisco/IOS/Component/BgpSubsystem.pm b/plugins-scripts/Classes/Cisco/IOS/Component/BgpSubsystem.pm index 39550a21..dc04803b 100644 --- a/plugins-scripts/Classes/Cisco/IOS/Component/BgpSubsystem.pm +++ b/plugins-scripts/Classes/Cisco/IOS/Component/BgpSubsystem.pm @@ -1,22 +1,42 @@ 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) = @_; - $self->get_snmp_tables('CISCO-BGP4-MIB', [ - ['peers', 'cbgpPeerAddrFamilyPrefixTable', 'Classes::Cisco::IOS::Component::BgpSubsystem::Peer', sub { return $self->filter_name(shift->{cbgpPeerRemoteAddr}) } ], - ]); + 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}) } ], + ]); + } + } } sub check { my ($self) = @_; - if ($self->mode =~ /prefix::count/) { + 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(); } } @@ -26,24 +46,92 @@ use strict; sub finish { my ($self) = @_; - $self->{cbgpPeerAddrFamilyAfi} = pop @{$self->{indices}}; - $self->{cbgpPeerAddrFamilySafi} = pop @{$self->{indices}}; - $self->{cbgpPeerRemoteAddr} = join(".", @{$self->{indices}}); + 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) = @_; - if ($self->mode =~ /prefix::count/) { + 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/Makefile.am b/plugins-scripts/Makefile.am index af898d2c..3d22c8e2 100644 --- a/plugins-scripts/Makefile.am +++ b/plugins-scripts/Makefile.am @@ -106,6 +106,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 \ From cee3925b6a7343bf89f1b6e2f6164d21a97a9796 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Tue, 4 Dec 2018 10:12:30 +0100 Subject: [PATCH 65/82] detect more Huawei devices --- ChangeLog | 2 ++ configure.ac | 2 +- plugins-scripts/Classes/Device.pm | 2 ++ plugins-scripts/Classes/Huawei.pm | 8 ++++++++ .../Huawei/Component/EnvironmentalSubsystem.pm | 18 +++++++++++++----- 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 44ed3cb2..69f1e29e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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 diff --git a/configure.ac b/configure.ac index e7fa7aae..5e6dc335 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,7.4) +AC_INIT(check_nwc_health,7.4.1) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST diff --git a/plugins-scripts/Classes/Device.pm b/plugins-scripts/Classes/Device.pm index 6d90e9a3..3029158b 100644 --- a/plugins-scripts/Classes/Device.pm +++ b/plugins-scripts/Classes/Device.pm @@ -128,6 +128,8 @@ sub classify { $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'))) { diff --git a/plugins-scripts/Classes/Huawei.pm b/plugins-scripts/Classes/Huawei.pm index 9863e9a1..c90ac68d 100644 --- a/plugins-scripts/Classes/Huawei.pm +++ b/plugins-scripts/Classes/Huawei.pm @@ -8,6 +8,14 @@ sub init { 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/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Huawei/Component/EnvironmentalSubsystem.pm index 9364076e..6feef61d 100644 --- a/plugins-scripts/Classes/Huawei/Component/EnvironmentalSubsystem.pm +++ b/plugins-scripts/Classes/Huawei/Component/EnvironmentalSubsystem.pm @@ -28,11 +28,19 @@ sub init { ]); $self->merge_tables($_, "entitystates"); } - $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; - }); + 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}; + } + } 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; + }); + } } From 701a44beed97834aa068d88da5b0dbebe452f5bf Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Tue, 4 Dec 2018 14:45:59 +0100 Subject: [PATCH 66/82] fix fortigate sensors --- ChangeLog | 3 + configure.ac | 2 +- .../Fortigate/Component/SensorSubsystem.pm | 108 +++++++++++++++++- .../Component/EnvironmentalSubsystem.pm | 8 ++ .../Classes/Huawei/Component/MemSubsystem.pm | 10 +- 5 files changed, 125 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 69f1e29e..dd17ffb2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +* 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 diff --git a/configure.ac b/configure.ac index 5e6dc335..90c31aac 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,7.4.1) +AC_INIT(check_nwc_health,7.4.1.1) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST diff --git a/plugins-scripts/Classes/Fortigate/Component/SensorSubsystem.pm b/plugins-scripts/Classes/Fortigate/Component/SensorSubsystem.pm index 9691f8e1..7b92a543 100644 --- a/plugins-scripts/Classes/Fortigate/Component/SensorSubsystem.pm +++ b/plugins-scripts/Classes/Fortigate/Component/SensorSubsystem.pm @@ -13,19 +13,121 @@ 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)/) { + # VPP_DDR, VTT_DDR sind irgendwelche voltage regulatory devices + bless $self, "Classes::Fortigate::Component::SensorSubsystem::Voltage"; + } else { +$self->{UNKNOWN} = 1; + } +} + sub check { 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/Huawei/Component/EnvironmentalSubsystem.pm b/plugins-scripts/Classes/Huawei/Component/EnvironmentalSubsystem.pm index 6feef61d..9e2dfdf6 100644 --- a/plugins-scripts/Classes/Huawei/Component/EnvironmentalSubsystem.pm +++ b/plugins-scripts/Classes/Huawei/Component/EnvironmentalSubsystem.pm @@ -33,6 +33,7 @@ sub init { foreach (@{$self->{fanstates}}) { bless $_, "Classes::Huawei::Component::EnvironmentalSubsystem::Fan"; $_->{entPhysicalName} = $_->{flat_indices}; + $_->finish(); } } else { $self->merge_tables_with_code("fans", "fanstates", sub { @@ -48,6 +49,13 @@ 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) = @_; $self->add_info(sprintf 'fan %s is %s, state is %s, admin status is %s, oper status is %s', diff --git a/plugins-scripts/Classes/Huawei/Component/MemSubsystem.pm b/plugins-scripts/Classes/Huawei/Component/MemSubsystem.pm index 03e719f3..1fe92e18 100644 --- a/plugins-scripts/Classes/Huawei/Component/MemSubsystem.pm +++ b/plugins-scripts/Classes/Huawei/Component/MemSubsystem.pm @@ -25,8 +25,14 @@ sub finish { sub check { my ($self) = @_; - $self->add_info(sprintf 'Memory %s usage is %s%% (of %dMB)', - $self->{name}, $self->{hwEntityMemUsage}, $self->{hwEntityMemSizeMega}); + 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}, From fe753c3a806898e43739dc7aba9a59772283344f Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Tue, 4 Dec 2018 15:25:32 +0100 Subject: [PATCH 67/82] fix fortigate sensors2 --- plugins-scripts/Classes/Fortigate/Component/SensorSubsystem.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins-scripts/Classes/Fortigate/Component/SensorSubsystem.pm b/plugins-scripts/Classes/Fortigate/Component/SensorSubsystem.pm index 7b92a543..277fc2af 100644 --- a/plugins-scripts/Classes/Fortigate/Component/SensorSubsystem.pm +++ b/plugins-scripts/Classes/Fortigate/Component/SensorSubsystem.pm @@ -26,8 +26,9 @@ sub finish { } 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)/) { + } 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; From 3a997ae5a49d70227ec11794a72c3a67b3a86f7a Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Wed, 5 Dec 2018 10:06:00 +0100 Subject: [PATCH 68/82] fix cisco bgp for routers which do not export the proptietary mib, but bgp4 --- ChangeLog | 2 ++ configure.ac | 2 +- plugins-scripts/Classes/Cisco/IOS.pm | 2 +- plugins-scripts/Classes/Cisco/IOS/Component/BgpSubsystem.pm | 4 ++++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index dd17ffb2..7ff94b0e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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 diff --git a/configure.ac b/configure.ac index 90c31aac..d2914956 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,7.4.1.1) +AC_INIT(check_nwc_health,7.4.1.2) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST diff --git a/plugins-scripts/Classes/Cisco/IOS.pm b/plugins-scripts/Classes/Cisco/IOS.pm index 1ecb3b5d..2db93b36 100644 --- a/plugins-scripts/Classes/Cisco/IOS.pm +++ b/plugins-scripts/Classes/Cisco/IOS.pm @@ -36,7 +36,7 @@ sub init { $self->analyze_and_check_config_subsystem("Classes::Cisco::IOS::Component::NatSubsystem"); #} elsif ($self->mode =~ /device::bgp::prefix::count/) { } elsif ($self->mode =~ /device::bgp/) { - $self->analyze_and_check_config_subsystem("Classes::Cisco::IOS::Component::BgpSubsystem"); + $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/) { diff --git a/plugins-scripts/Classes/Cisco/IOS/Component/BgpSubsystem.pm b/plugins-scripts/Classes/Cisco/IOS/Component/BgpSubsystem.pm index dc04803b..0d1f2acd 100644 --- a/plugins-scripts/Classes/Cisco/IOS/Component/BgpSubsystem.pm +++ b/plugins-scripts/Classes/Cisco/IOS/Component/BgpSubsystem.pm @@ -22,6 +22,10 @@ sub init { ['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(); + } } } From 0615380027916cafed864eb12c34a7282e1cdfbd Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Wed, 12 Dec 2018 19:46:38 +0100 Subject: [PATCH 69/82] improve ucd memory --- plugins-scripts/Classes/UCDMIB/Components/SwapSubsystem.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins-scripts/Classes/UCDMIB/Components/SwapSubsystem.pm b/plugins-scripts/Classes/UCDMIB/Components/SwapSubsystem.pm index eaeee881..966d2aef 100644 --- a/plugins-scripts/Classes/UCDMIB/Components/SwapSubsystem.pm +++ b/plugins-scripts/Classes/UCDMIB/Components/SwapSubsystem.pm @@ -12,6 +12,8 @@ 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 { From 775e3288da6e57d0dea0afe598fb98af5522677f Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Wed, 12 Dec 2018 19:47:01 +0100 Subject: [PATCH 70/82] improve paloalto uptime model string --- plugins-scripts/Classes/PaloAlto.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins-scripts/Classes/PaloAlto.pm b/plugins-scripts/Classes/PaloAlto.pm index 126e7b6f..139f4265 100644 --- a/plugins-scripts/Classes/PaloAlto.pm +++ b/plugins-scripts/Classes/PaloAlto.pm @@ -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; +} From ea26887ed7a77457d31055187730614c7c40d318 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Wed, 12 Dec 2018 19:50:57 +0100 Subject: [PATCH 71/82] fixup! fix cisco bgp for routers which do not export the proptietary mib, but bgp4 --- .../Cisco/WLC/Component/HaSubsystem.pm | 36 +++++++++++++++++++ .../Classes/UCDMIB/Components/MemSubsystem.pm | 6 ++-- 2 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 plugins-scripts/Classes/Cisco/WLC/Component/HaSubsystem.pm 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..f71151e9 --- /dev/null +++ b/plugins-scripts/Classes/Cisco/WLC/Component/HaSubsystem.pm @@ -0,0 +1,36 @@ +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 access points'); + if ($self->mode =~ /device::ha::status/) { + if ($self->{cLHaNetworkFailOver} && + $self->{cLHaNetworkFailOver} eq 'true') { + if($self->{cLHaPrimaryUnit} && + $self->{cLHaPrimaryUnit} eq 'false') { + $self->add_ok('no access points found, this is a secondary unit in a failover setup'); + } else { + $self->add_unknown('no access points found, this is a primary unit in a failover setup'); + } + } + } +} + diff --git a/plugins-scripts/Classes/UCDMIB/Components/MemSubsystem.pm b/plugins-scripts/Classes/UCDMIB/Components/MemSubsystem.pm index a529b198..45424e0b 100644 --- a/plugins-scripts/Classes/UCDMIB/Components/MemSubsystem.pm +++ b/plugins-scripts/Classes/UCDMIB/Components/MemSubsystem.pm @@ -5,13 +5,13 @@ use strict; sub init { 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->{$_}); } From c023d195d15e3aacbc2d0515d8f41822155a52bc Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Wed, 12 Dec 2018 20:10:30 +0100 Subject: [PATCH 72/82] start ha for cisco wlc --- GLPlugin | 2 +- plugins-scripts/Classes/Cisco/WLC.pm | 2 ++ plugins-scripts/Makefile.am | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/GLPlugin b/GLPlugin index 4a7c4d48..ed131470 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit 4a7c4d48ee14a30721bc750613f55163ce97ef50 +Subproject commit ed13147094cadb26b2789e758fce9b92bd1548f4 diff --git a/plugins-scripts/Classes/Cisco/WLC.pm b/plugins-scripts/Classes/Cisco/WLC.pm index 9bd98c2b..11c92305 100644 --- a/plugins-scripts/Classes/Cisco/WLC.pm +++ b/plugins-scripts/Classes/Cisco/WLC.pm @@ -27,6 +27,8 @@ 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(); } diff --git a/plugins-scripts/Makefile.am b/plugins-scripts/Makefile.am index 3d22c8e2..9eb364b1 100644 --- a/plugins-scripts/Makefile.am +++ b/plugins-scripts/Makefile.am @@ -181,6 +181,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 \ From 7ecc16e237b9fd19a381e0ba97f52c18d86ea01c Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Wed, 12 Dec 2018 20:11:37 +0100 Subject: [PATCH 73/82] changlog --- ChangeLog | 4 ++++ configure.ac | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7ff94b0e..808d5142 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +* 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 diff --git a/configure.ac b/configure.ac index d2914956..6448ea51 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,7.4.1.2) +AC_INIT(check_nwc_health,7.4.2) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST From 012042d3ae9e018f9d665bbf520ce4223a95d8f7 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Mon, 17 Dec 2018 19:44:52 +0100 Subject: [PATCH 74/82] finish ha-status for cisco wlc --- ChangeLog | 2 ++ configure.ac | 2 +- plugins-scripts/Classes/Cisco/WLC.pm | 7 +++++++ .../Classes/Cisco/WLC/Component/HaSubsystem.pm | 14 +++++++++++--- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 808d5142..f92ab6f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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 diff --git a/configure.ac b/configure.ac index 6448ea51..2ce4b865 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,7.4.2) +AC_INIT(check_nwc_health,7.4.2.1) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST diff --git a/plugins-scripts/Classes/Cisco/WLC.pm b/plugins-scripts/Classes/Cisco/WLC.pm index 11c92305..78bdf0fb 100644 --- a/plugins-scripts/Classes/Cisco/WLC.pm +++ b/plugins-scripts/Classes/Cisco/WLC.pm @@ -34,3 +34,10 @@ sub init { } } +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/HaSubsystem.pm b/plugins-scripts/Classes/Cisco/WLC/Component/HaSubsystem.pm index f71151e9..32024872 100644 --- a/plugins-scripts/Classes/Cisco/WLC/Component/HaSubsystem.pm +++ b/plugins-scripts/Classes/Cisco/WLC/Component/HaSubsystem.pm @@ -20,16 +20,24 @@ sub init { sub check { my ($self) = @_; - $self->add_info('checking access points'); + $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('no access points found, this is a secondary unit in a failover setup'); + $self->add_ok(); } else { - $self->add_unknown('no access points found, this is a primary unit in a failover setup'); + $self->add_ok(); } + if ($self->{cLHaBulkSyncStatus} ne "Complete") { + $self->add_warning(); + } + } else { + $self->add_critical_mitigation('ha failover is not configured'); } } } From 029a79e3e7724386bb6d46f4959d166849bc0ba1 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Wed, 9 Jan 2019 15:25:46 +0100 Subject: [PATCH 75/82] add interface-security --- ChangeLog | 2 + GLPlugin | 2 +- configure.ac | 2 +- plugins-scripts/Classes/Cisco.pm | 6 + .../Component/InterfaceSubsystem.pm | 134 ++++++++++++++++++ plugins-scripts/Makefile.am | 2 + plugins-scripts/check_nwc_health.pl | 6 + 7 files changed, 152 insertions(+), 2 deletions(-) create mode 100644 plugins-scripts/Classes/Cisco/CISCOPORTSECURITYMIB/Component/InterfaceSubsystem.pm diff --git a/ChangeLog b/ChangeLog index f92ab6f2..fe5bb2b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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 diff --git a/GLPlugin b/GLPlugin index ed131470..46eb5618 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit ed13147094cadb26b2789e758fce9b92bd1548f4 +Subproject commit 46eb5618127df1f6c44956d48f0c18f737b57503 diff --git a/configure.ac b/configure.ac index 2ce4b865..02218b4a 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,7.4.2.1) +AC_INIT(check_nwc_health,7.4.3) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST diff --git a/plugins-scripts/Classes/Cisco.pm b/plugins-scripts/Classes/Cisco.pm index bf9eeb73..40bf668b 100644 --- a/plugins-scripts/Classes/Cisco.pm +++ b/plugins-scripts/Classes/Cisco.pm @@ -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/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/Makefile.am b/plugins-scripts/Makefile.am index 9eb364b1..9c94514c 100644 --- a/plugins-scripts/Makefile.am +++ b/plugins-scripts/Makefile.am @@ -42,6 +42,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 \ @@ -150,6 +151,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 \ diff --git a/plugins-scripts/check_nwc_health.pl b/plugins-scripts/check_nwc_health.pl index f634bae4..ccf7076c 100644 --- a/plugins-scripts/check_nwc_health.pl +++ b/plugins-scripts/check_nwc_health.pl @@ -148,6 +148,12 @@ 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', From 475921abfdea236a8e80fa708f40cfd8d8a07ad1 Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Sun, 17 Feb 2019 12:51:05 +0100 Subject: [PATCH 76/82] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 86a66fd1..c9cca923 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +Meet me at... +============= +
Monitoring-Workshop 2019
+ Description ============ The plugin check_nwc_health was developed with the aim of having a single tool for all aspects of monitoring of network components. From bef1b8cbf62f09e24477281d5694d11a1f3b6a8f Mon Sep 17 00:00:00 2001 From: victor olalla Date: Mon, 18 Feb 2019 13:57:54 +0100 Subject: [PATCH 77/82] Add --sum option to `interface-usage` mode --- .../IFMIB/Component/InterfaceSubsystem.pm | 36 +++++++++++-------- .../Classes/Server/SolarisLocal.pm | 10 +++++- .../Components/InterfaceSubsystem.pm | 12 +++++-- 3 files changed, 41 insertions(+), 17 deletions(-) diff --git a/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm b/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm index 2642a2df..09fdcbf0 100644 --- a/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm +++ b/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm @@ -614,7 +614,7 @@ sub finish { } 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} && + if ($self->{ifName} && defined $self->{ifHCInOctets} && defined $self->{ifHCOutOctets} && $self->{ifHCInOctets} ne "noSuchObject") { $self->{ifAlias} ||= $self->{ifName}; $self->{ifName} = unpack("Z*", $self->{ifName}); @@ -633,7 +633,7 @@ sub finish { bless $self, 'Classes::IFMIB::Component::InterfaceSubsystem::Interface::StackSub'; } if ($self->{ifPhysAddress}) { - $self->{ifPhysAddress} = join(':', unpack('(H2)*', $self->{ifPhysAddress})); + $self->{ifPhysAddress} = join(':', unpack('(H2)*', $self->{ifPhysAddress})); } } $self->init(); @@ -703,15 +703,15 @@ sub init { } } elsif ($self->mode =~ /device::interfaces::errors/) { $self->valdiff({name => $self->{ifDescr}}, qw(ifInErrors ifOutErrors)); - $self->{inputErrorRate} = $self->{delta_ifInErrors} + $self->{inputErrorRate} = $self->{delta_ifInErrors} / $self->{delta_timestamp}; - $self->{outputErrorRate} = $self->{delta_ifOutErrors} + $self->{outputErrorRate} = $self->{delta_ifOutErrors} / $self->{delta_timestamp}; } elsif ($self->mode =~ /device::interfaces::discards/) { $self->valdiff({name => $self->{ifDescr}}, qw(ifInDiscards ifOutDiscards)); - $self->{inputDiscardRate} = $self->{delta_ifInDiscards} + $self->{inputDiscardRate} = $self->{delta_ifInDiscards} / $self->{delta_timestamp}; - $self->{outputDiscardRate} = $self->{delta_ifOutDiscards} + $self->{outputDiscardRate} = $self->{delta_ifOutDiscards} / $self->{delta_timestamp}; } elsif ($self->mode =~ /device::interfaces::broadcasts/) { foreach my $key (qw(ifInUcastPkts @@ -732,7 +732,7 @@ sub init { $self->{delta_ifOutBroadcastPkts}); } elsif ($self->mode =~ /device::interfaces::operstatus/) { } elsif ($self->mode =~ /device::interfaces::availability/) { - $self->{ifStatusDuration} = + $self->{ifStatusDuration} = $self->uptime() - $self->timeticks($self->{ifLastChange}); $self->opts->override_opt('lookback', 1800) if ! $self->opts->lookback; if ($self->{ifAdminStatus} eq "down") { @@ -747,7 +747,7 @@ sub init { my $gb = 1000 * 1000 * 1000; my $mb = 1000 * 1000; my $kb = 1000; - my $speed = $self->{ifHighSpeed} ? + my $speed = $self->{ifHighSpeed} ? ($self->{ifHighSpeed} * $mb) : $self->{ifSpeed}; if ($speed >= $gb) { $self->{ifSpeedText} = sprintf "%.2fGB", $speed / $gb; @@ -842,7 +842,7 @@ sub check { } elsif ($self->mode =~ /device::interfaces::usage/) { $self->add_info(sprintf 'interface %s usage is in:%.2f%% (%s) out:%.2f%% (%s)%s', $full_descr, - $self->{inputUtilization}, + $self->{inputUtilization}, sprintf("%.2f%s/s", $self->{inputRate}, $self->opts->units), $self->{outputUtilization}, sprintf("%.2f%s/s", $self->{outputRate}, $self->opts->units), @@ -880,6 +880,15 @@ sub check { my ($inwarning, $incritical) = $self->get_thresholds( metric => $self->{ifDescr}.'_usage_in', ); + # volalla: Add --sum Option + if ($self->opts->sum){ + $self->interface_traffic_sum( + traffic_in => $self->{inputRate}, + traffic_out => $self->{outputRate}, + interface => $self->{ifDescr}, + warning => $inwarning, + critical => $incritical); + } $self->set_thresholds( metric => $self->{ifDescr}.'_traffic_in', warning => $self->{maxInputRate} / 100 * $inwarning, @@ -1016,7 +1025,7 @@ sub check { # fault condition on the interface. # --warning onu,anu # Admin: admindown,admin - # Admin: --warning + # Admin: --warning # --critical admindown # !ad+od ad+!(od*on) # warn & warnbitfield @@ -1027,7 +1036,7 @@ sub check { # } # if ($self->{ifOperStatus} ne 'up') { # } -# } +# } $self->add_info(sprintf '%s is %s/%s', $full_descr, $self->{ifOperStatus}, $self->{ifAdminStatus}); @@ -1043,7 +1052,7 @@ sub check { sprintf '%s is admin down', $full_descr); } } elsif ($self->mode =~ /device::interfaces::availability/) { - $self->{ifStatusDuration} = + $self->{ifStatusDuration} = $self->human_timeticks($self->{ifStatusDuration}); $self->add_info(sprintf '%s is %savailable (%s/%s, since %s)', $self->{ifDescr}, ($self->{ifAvailable} eq "true" ? "" : "un"), @@ -1225,7 +1234,7 @@ sub init_etherstats { for my $stat (grep { /^(dot3|etherStats)/ } @{$self->{columns}}) { next if ! defined $self->{'delta_'.$stat}; $self->{$stat.'Percent'} = $self->{delta_InPkts} + $self->{delta_OutPkts} ? - 100 * $self->{'delta_'.$stat} / + 100 * $self->{'delta_'.$stat} / ($self->{delta_InPkts} + $self->{delta_OutPkts}) : 0; } } @@ -1259,4 +1268,3 @@ sub check { $self->add_ok(sprintf '%s has no traffic', $full_descr); } } - diff --git a/plugins-scripts/Classes/Server/SolarisLocal.pm b/plugins-scripts/Classes/Server/SolarisLocal.pm index 2b25047b..d98222b1 100644 --- a/plugins-scripts/Classes/Server/SolarisLocal.pm +++ b/plugins-scripts/Classes/Server/SolarisLocal.pm @@ -270,6 +270,15 @@ sub check { my ($inwarning, $incritical) = $self->get_thresholds( metric => $self->{ifDescr}.'_usage_in', ); + # volalla: Add --sum Option + if ($self->opts->sum){ + $self->interface_traffic_sum( + traffic_in => $self->{inputRate}, + traffic_out => $self->{outputRate}, + interface => $self->{ifDescr}, + warning => $inwarning, + critical => $incritical); + } $self->set_thresholds( metric => $self->{ifDescr}.'_traffic_in', warning => $self->{maxInputRate} / 100 * $inwarning, @@ -340,4 +349,3 @@ sub list { my ($self) = @_; printf "%s\n", $self->{ifDescr}; } - diff --git a/plugins-scripts/Classes/UPNP/AVM/FritzBox7390/Components/InterfaceSubsystem.pm b/plugins-scripts/Classes/UPNP/AVM/FritzBox7390/Components/InterfaceSubsystem.pm index 88f04e92..66d558b3 100644 --- a/plugins-scripts/Classes/UPNP/AVM/FritzBox7390/Components/InterfaceSubsystem.pm +++ b/plugins-scripts/Classes/UPNP/AVM/FritzBox7390/Components/InterfaceSubsystem.pm @@ -121,6 +121,15 @@ sub check { my ($inwarning, $incritical) = $self->get_thresholds( metric => $self->{ifDescr}.'_usage_in', ); + # volalla: Add --sum Option + if ($self->opts->sum){ + $self->interface_traffic_sum( + traffic_in => $self->{inputRate}, + traffic_out => $self->{outputRate}, + interface => $self->{ifDescr}, + warning => $inwarning, + critical => $incritical); + } $self->set_thresholds( metric => $self->{ifDescr}.'_traffic_in', warning => $self->{maxInputRate} / 100 * $inwarning, @@ -152,7 +161,7 @@ sub check { ); } elsif ($self->mode =~ /device::interfaces::operstatus/) { $self->add_info(sprintf 'interface %s%s status is %s', - $self->{ifDescr}, + $self->{ifDescr}, $self->{ExternalIPAddress} ? " (".$self->{ExternalIPAddress}.")" : "", $self->{ConnectionStatus}); if ($self->{ConnectionStatus} eq "Connected") { @@ -165,4 +174,3 @@ sub check { $self->add_ok("have fun"); } } - From 5c6850d1d15f8039e20968e5fd1ead322ef6ebc2 Mon Sep 17 00:00:00 2001 From: victor olalla Date: Mon, 18 Feb 2019 14:25:25 +0100 Subject: [PATCH 78/82] Updated `GLPlugin` submodule --- GLPlugin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GLPlugin b/GLPlugin index 46eb5618..0f952bc2 160000 --- a/GLPlugin +++ b/GLPlugin @@ -1 +1 @@ -Subproject commit 46eb5618127df1f6c44956d48f0c18f737b57503 +Subproject commit 0f952bc2bdba3e56d54a3d1333a3b103f5ba33e1 From 1a8fb43c732f7c9f1f3fa2a341dfd1044c2343ee Mon Sep 17 00:00:00 2001 From: Gerhard Lausser Date: Mon, 18 Feb 2019 14:55:28 +0100 Subject: [PATCH 79/82] add Draytek Vigor --- ChangeLog | 2 + configure.ac | 2 +- plugins-scripts/Classes/Device.pm | 2 + plugins-scripts/Classes/DrayTek.pm | 309 ++++++++++++++++++ plugins-scripts/Classes/DrayTek/Vigor.pm | 17 + .../DrayTek/Vigor/Component/CpuSubsystem.pm | 27 ++ .../Vigor/Component/EnvironmentalSubsystem.pm | 34 ++ .../DrayTek/Vigor/Component/MemSubsystem.pm | 27 ++ plugins-scripts/Makefile.am | 5 + 9 files changed, 424 insertions(+), 1 deletion(-) create mode 100644 plugins-scripts/Classes/DrayTek.pm create mode 100644 plugins-scripts/Classes/DrayTek/Vigor.pm create mode 100644 plugins-scripts/Classes/DrayTek/Vigor/Component/CpuSubsystem.pm create mode 100644 plugins-scripts/Classes/DrayTek/Vigor/Component/EnvironmentalSubsystem.pm create mode 100644 plugins-scripts/Classes/DrayTek/Vigor/Component/MemSubsystem.pm diff --git a/ChangeLog b/ChangeLog index fe5bb2b3..2228ef9f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* 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 diff --git a/configure.ac b/configure.ac index 02218b4a..18d7c9be 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,7.4.3) +AC_INIT(check_nwc_health,7.5) AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_MAINTAINER_MODE([disable]) AC_CANONICAL_HOST diff --git a/plugins-scripts/Classes/Device.pm b/plugins-scripts/Classes/Device.pm index 3029158b..b741e82a 100644 --- a/plugins-scripts/Classes/Device.pm +++ b/plugins-scripts/Classes/Device.pm @@ -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) { diff --git a/plugins-scripts/Classes/DrayTek.pm b/plugins-scripts/Classes/DrayTek.pm new file mode 100644 index 00000000..56237511 --- /dev/null +++ b/plugins-scripts/Classes/DrayTek.pm @@ -0,0 +1,309 @@ +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; + } +} + + +package Monitoring::GLPlugin::SNMP::MibsAndOids::ADSLLINEMIB; + +$Monitoring::GLPlugin::SNMP::MibsAndOids::origin->{'ADSL-LINE-MIB'} = { + url => '', + name => 'ADSL-LINE-MIB', +}; + +#$Monitoring::GLPlugin::SNMP::MibsAndOids::mib_ids->{'ADSL-LINE-MIB'} = + +$Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{'ADSL-LINE-MIB'} = { + adslMIB => '1.3.6.1.2.1.10.94', + adslLineMib => '1.3.6.1.2.1.10.94.1', + adslMibObjects => '1.3.6.1.2.1.10.94.1.1', + adslLineTable => '1.3.6.1.2.1.10.94.1.1.1', + adslLineEntry => '1.3.6.1.2.1.10.94.1.1.1.1', + adslLineCoding => '1.3.6.1.2.1.10.94.1.1.1.1.1', + adslLineCodingDefinition => 'ADSL-LINE-MIB::adslLineCoding', + adslLineType => '1.3.6.1.2.1.10.94.1.1.1.1.2', + adslLineTypeDefinition => 'ADSL-LINE-MIB::adslLineType', + adslLineSpecific => '1.3.6.1.2.1.10.94.1.1.1.1.3', + adslLineConfProfile => '1.3.6.1.2.1.10.94.1.1.1.1.4', + adslLineAlarmConfProfile => '1.3.6.1.2.1.10.94.1.1.1.1.5', + adslAtucPhysTable => '1.3.6.1.2.1.10.94.1.1.2', + adslAtucPhysEntry => '1.3.6.1.2.1.10.94.1.1.2.1', + adslAtucInvSerialNumber => '1.3.6.1.2.1.10.94.1.1.2.1.1', + adslAtucInvVendorID => '1.3.6.1.2.1.10.94.1.1.2.1.2', + adslAtucInvVersionNumber => '1.3.6.1.2.1.10.94.1.1.2.1.3', + adslAtucCurrSnrMgn => '1.3.6.1.2.1.10.94.1.1.2.1.4', + adslAtucCurrAtn => '1.3.6.1.2.1.10.94.1.1.2.1.5', + adslAtucCurrStatus => '1.3.6.1.2.1.10.94.1.1.2.1.6', + adslAtucCurrOutputPwr => '1.3.6.1.2.1.10.94.1.1.2.1.7', + adslAtucCurrAttainableRate => '1.3.6.1.2.1.10.94.1.1.2.1.8', + adslAturPhysTable => '1.3.6.1.2.1.10.94.1.1.3', + adslAturPhysEntry => '1.3.6.1.2.1.10.94.1.1.3.1', + adslAturInvSerialNumber => '1.3.6.1.2.1.10.94.1.1.3.1.1', + adslAturInvVendorID => '1.3.6.1.2.1.10.94.1.1.3.1.2', + adslAturInvVersionNumber => '1.3.6.1.2.1.10.94.1.1.3.1.3', + adslAturCurrSnrMgn => '1.3.6.1.2.1.10.94.1.1.3.1.4', + adslAturCurrAtn => '1.3.6.1.2.1.10.94.1.1.3.1.5', + adslAturCurrStatus => '1.3.6.1.2.1.10.94.1.1.3.1.6', + adslAturCurrOutputPwr => '1.3.6.1.2.1.10.94.1.1.3.1.7', + adslAturCurrAttainableRate => '1.3.6.1.2.1.10.94.1.1.3.1.8', + adslAtucChanTable => '1.3.6.1.2.1.10.94.1.1.4', + adslAtucChanEntry => '1.3.6.1.2.1.10.94.1.1.4.1', + adslAtucChanInterleaveDelay => '1.3.6.1.2.1.10.94.1.1.4.1.1', + adslAtucChanCurrTxRate => '1.3.6.1.2.1.10.94.1.1.4.1.2', + adslAtucChanPrevTxRate => '1.3.6.1.2.1.10.94.1.1.4.1.3', + adslAtucChanCrcBlockLength => '1.3.6.1.2.1.10.94.1.1.4.1.4', + adslAturChanTable => '1.3.6.1.2.1.10.94.1.1.5', + adslAturChanEntry => '1.3.6.1.2.1.10.94.1.1.5.1', + adslAturChanInterleaveDelay => '1.3.6.1.2.1.10.94.1.1.5.1.1', + adslAturChanCurrTxRate => '1.3.6.1.2.1.10.94.1.1.5.1.2', + adslAturChanPrevTxRate => '1.3.6.1.2.1.10.94.1.1.5.1.3', + adslAturChanCrcBlockLength => '1.3.6.1.2.1.10.94.1.1.5.1.4', + adslAtucPerfDataTable => '1.3.6.1.2.1.10.94.1.1.6', + adslAtucPerfDataEntry => '1.3.6.1.2.1.10.94.1.1.6.1', + adslAtucPerfLofs => '1.3.6.1.2.1.10.94.1.1.6.1.1', + adslAtucPerfLoss => '1.3.6.1.2.1.10.94.1.1.6.1.2', + adslAtucPerfLols => '1.3.6.1.2.1.10.94.1.1.6.1.3', + adslAtucPerfLprs => '1.3.6.1.2.1.10.94.1.1.6.1.4', + adslAtucPerfESs => '1.3.6.1.2.1.10.94.1.1.6.1.5', + adslAtucPerfInits => '1.3.6.1.2.1.10.94.1.1.6.1.6', + adslAtucPerfValidIntervals => '1.3.6.1.2.1.10.94.1.1.6.1.7', + adslAtucPerfInvalidIntervals => '1.3.6.1.2.1.10.94.1.1.6.1.8', + adslAtucPerfCurr15MinTimeElapsed => '1.3.6.1.2.1.10.94.1.1.6.1.9', + adslAtucPerfCurr15MinLofs => '1.3.6.1.2.1.10.94.1.1.6.1.10', + adslAtucPerfCurr15MinLoss => '1.3.6.1.2.1.10.94.1.1.6.1.11', + adslAtucPerfCurr15MinLols => '1.3.6.1.2.1.10.94.1.1.6.1.12', + adslAtucPerfCurr15MinLprs => '1.3.6.1.2.1.10.94.1.1.6.1.13', + adslAtucPerfCurr15MinESs => '1.3.6.1.2.1.10.94.1.1.6.1.14', + adslAtucPerfCurr15MinInits => '1.3.6.1.2.1.10.94.1.1.6.1.15', + adslAtucPerfCurr1DayTimeElapsed => '1.3.6.1.2.1.10.94.1.1.6.1.16', + adslAtucPerfCurr1DayLofs => '1.3.6.1.2.1.10.94.1.1.6.1.17', + adslAtucPerfCurr1DayLoss => '1.3.6.1.2.1.10.94.1.1.6.1.18', + adslAtucPerfCurr1DayLols => '1.3.6.1.2.1.10.94.1.1.6.1.19', + adslAtucPerfCurr1DayLprs => '1.3.6.1.2.1.10.94.1.1.6.1.20', + adslAtucPerfCurr1DayESs => '1.3.6.1.2.1.10.94.1.1.6.1.21', + adslAtucPerfCurr1DayInits => '1.3.6.1.2.1.10.94.1.1.6.1.22', + adslAtucPerfPrev1DayMoniSecs => '1.3.6.1.2.1.10.94.1.1.6.1.23', + adslAtucPerfPrev1DayLofs => '1.3.6.1.2.1.10.94.1.1.6.1.24', + adslAtucPerfPrev1DayLoss => '1.3.6.1.2.1.10.94.1.1.6.1.25', + adslAtucPerfPrev1DayLols => '1.3.6.1.2.1.10.94.1.1.6.1.26', + adslAtucPerfPrev1DayLprs => '1.3.6.1.2.1.10.94.1.1.6.1.27', + adslAtucPerfPrev1DayESs => '1.3.6.1.2.1.10.94.1.1.6.1.28', + adslAtucPerfPrev1DayInits => '1.3.6.1.2.1.10.94.1.1.6.1.29', + adslAturPerfDataTable => '1.3.6.1.2.1.10.94.1.1.7', + adslAturPerfDataEntry => '1.3.6.1.2.1.10.94.1.1.7.1', + adslAturPerfLofs => '1.3.6.1.2.1.10.94.1.1.7.1.1', + adslAturPerfLoss => '1.3.6.1.2.1.10.94.1.1.7.1.2', + adslAturPerfLprs => '1.3.6.1.2.1.10.94.1.1.7.1.3', + adslAturPerfESs => '1.3.6.1.2.1.10.94.1.1.7.1.4', + adslAturPerfValidIntervals => '1.3.6.1.2.1.10.94.1.1.7.1.5', + adslAturPerfInvalidIntervals => '1.3.6.1.2.1.10.94.1.1.7.1.6', + adslAturPerfCurr15MinTimeElapsed => '1.3.6.1.2.1.10.94.1.1.7.1.7', + adslAturPerfCurr15MinLofs => '1.3.6.1.2.1.10.94.1.1.7.1.8', + adslAturPerfCurr15MinLoss => '1.3.6.1.2.1.10.94.1.1.7.1.9', + adslAturPerfCurr15MinLprs => '1.3.6.1.2.1.10.94.1.1.7.1.10', + adslAturPerfCurr15MinESs => '1.3.6.1.2.1.10.94.1.1.7.1.11', + adslAturPerfCurr1DayTimeElapsed => '1.3.6.1.2.1.10.94.1.1.7.1.12', + adslAturPerfCurr1DayLofs => '1.3.6.1.2.1.10.94.1.1.7.1.13', + adslAturPerfCurr1DayLoss => '1.3.6.1.2.1.10.94.1.1.7.1.14', + adslAturPerfCurr1DayLprs => '1.3.6.1.2.1.10.94.1.1.7.1.15', + adslAturPerfCurr1DayESs => '1.3.6.1.2.1.10.94.1.1.7.1.16', + adslAturPerfPrev1DayMoniSecs => '1.3.6.1.2.1.10.94.1.1.7.1.17', + adslAturPerfPrev1DayLofs => '1.3.6.1.2.1.10.94.1.1.7.1.18', + adslAturPerfPrev1DayLoss => '1.3.6.1.2.1.10.94.1.1.7.1.19', + adslAturPerfPrev1DayLprs => '1.3.6.1.2.1.10.94.1.1.7.1.20', + adslAturPerfPrev1DayESs => '1.3.6.1.2.1.10.94.1.1.7.1.21', + adslAtucIntervalTable => '1.3.6.1.2.1.10.94.1.1.8', + adslAtucIntervalEntry => '1.3.6.1.2.1.10.94.1.1.8.1', + adslAtucIntervalNumber => '1.3.6.1.2.1.10.94.1.1.8.1.1', + adslAtucIntervalLofs => '1.3.6.1.2.1.10.94.1.1.8.1.2', + adslAtucIntervalLoss => '1.3.6.1.2.1.10.94.1.1.8.1.3', + adslAtucIntervalLols => '1.3.6.1.2.1.10.94.1.1.8.1.4', + adslAtucIntervalLprs => '1.3.6.1.2.1.10.94.1.1.8.1.5', + adslAtucIntervalESs => '1.3.6.1.2.1.10.94.1.1.8.1.6', + adslAtucIntervalInits => '1.3.6.1.2.1.10.94.1.1.8.1.7', + adslAtucIntervalValidData => '1.3.6.1.2.1.10.94.1.1.8.1.8', + adslAturIntervalTable => '1.3.6.1.2.1.10.94.1.1.9', + adslAturIntervalEntry => '1.3.6.1.2.1.10.94.1.1.9.1', + adslAturIntervalNumber => '1.3.6.1.2.1.10.94.1.1.9.1.1', + adslAturIntervalLofs => '1.3.6.1.2.1.10.94.1.1.9.1.2', + adslAturIntervalLoss => '1.3.6.1.2.1.10.94.1.1.9.1.3', + adslAturIntervalLprs => '1.3.6.1.2.1.10.94.1.1.9.1.4', + adslAturIntervalESs => '1.3.6.1.2.1.10.94.1.1.9.1.5', + adslAturIntervalValidData => '1.3.6.1.2.1.10.94.1.1.9.1.6', + adslAtucChanPerfDataTable => '1.3.6.1.2.1.10.94.1.1.10', + adslAtucChanPerfDataEntry => '1.3.6.1.2.1.10.94.1.1.10.1', + adslAtucChanReceivedBlks => '1.3.6.1.2.1.10.94.1.1.10.1.1', + adslAtucChanTransmittedBlks => '1.3.6.1.2.1.10.94.1.1.10.1.2', + adslAtucChanCorrectedBlks => '1.3.6.1.2.1.10.94.1.1.10.1.3', + adslAtucChanUncorrectBlks => '1.3.6.1.2.1.10.94.1.1.10.1.4', + adslAtucChanPerfValidIntervals => '1.3.6.1.2.1.10.94.1.1.10.1.5', + adslAtucChanPerfInvalidIntervals => '1.3.6.1.2.1.10.94.1.1.10.1.6', + adslAtucChanPerfCurr15MinTimeElapsed => '1.3.6.1.2.1.10.94.1.1.10.1.7', + adslAtucChanPerfCurr15MinReceivedBlks => '1.3.6.1.2.1.10.94.1.1.10.1.8', + adslAtucChanPerfCurr15MinTransmittedBlks => '1.3.6.1.2.1.10.94.1.1.10.1.9', + adslAtucChanPerfCurr15MinCorrectedBlks => '1.3.6.1.2.1.10.94.1.1.10.1.10', + adslAtucChanPerfCurr15MinUncorrectBlks => '1.3.6.1.2.1.10.94.1.1.10.1.11', + adslAtucChanPerfCurr1DayTimeElapsed => '1.3.6.1.2.1.10.94.1.1.10.1.12', + adslAtucChanPerfCurr1DayReceivedBlks => '1.3.6.1.2.1.10.94.1.1.10.1.13', + adslAtucChanPerfCurr1DayTransmittedBlks => '1.3.6.1.2.1.10.94.1.1.10.1.14', + adslAtucChanPerfCurr1DayCorrectedBlks => '1.3.6.1.2.1.10.94.1.1.10.1.15', + adslAtucChanPerfCurr1DayUncorrectBlks => '1.3.6.1.2.1.10.94.1.1.10.1.16', + adslAtucChanPerfPrev1DayMoniSecs => '1.3.6.1.2.1.10.94.1.1.10.1.17', + adslAtucChanPerfPrev1DayReceivedBlks => '1.3.6.1.2.1.10.94.1.1.10.1.18', + adslAtucChanPerfPrev1DayTransmittedBlks => '1.3.6.1.2.1.10.94.1.1.10.1.19', + adslAtucChanPerfPrev1DayCorrectedBlks => '1.3.6.1.2.1.10.94.1.1.10.1.20', + adslAtucChanPerfPrev1DayUncorrectBlks => '1.3.6.1.2.1.10.94.1.1.10.1.21', + adslAturChanPerfDataTable => '1.3.6.1.2.1.10.94.1.1.11', + adslAturChanPerfDataEntry => '1.3.6.1.2.1.10.94.1.1.11.1', + adslAturChanReceivedBlks => '1.3.6.1.2.1.10.94.1.1.11.1.1', + adslAturChanTransmittedBlks => '1.3.6.1.2.1.10.94.1.1.11.1.2', + adslAturChanCorrectedBlks => '1.3.6.1.2.1.10.94.1.1.11.1.3', + adslAturChanUncorrectBlks => '1.3.6.1.2.1.10.94.1.1.11.1.4', + adslAturChanPerfValidIntervals => '1.3.6.1.2.1.10.94.1.1.11.1.5', + adslAturChanPerfInvalidIntervals => '1.3.6.1.2.1.10.94.1.1.11.1.6', + adslAturChanPerfCurr15MinTimeElapsed => '1.3.6.1.2.1.10.94.1.1.11.1.7', + adslAturChanPerfCurr15MinReceivedBlks => '1.3.6.1.2.1.10.94.1.1.11.1.8', + adslAturChanPerfCurr15MinTransmittedBlks => '1.3.6.1.2.1.10.94.1.1.11.1.9', + adslAturChanPerfCurr15MinCorrectedBlks => '1.3.6.1.2.1.10.94.1.1.11.1.10', + adslAturChanPerfCurr15MinUncorrectBlks => '1.3.6.1.2.1.10.94.1.1.11.1.11', + adslAturChanPerfCurr1DayTimeElapsed => '1.3.6.1.2.1.10.94.1.1.11.1.12', + adslAturChanPerfCurr1DayReceivedBlks => '1.3.6.1.2.1.10.94.1.1.11.1.13', + adslAturChanPerfCurr1DayTransmittedBlks => '1.3.6.1.2.1.10.94.1.1.11.1.14', + adslAturChanPerfCurr1DayCorrectedBlks => '1.3.6.1.2.1.10.94.1.1.11.1.15', + adslAturChanPerfCurr1DayUncorrectBlks => '1.3.6.1.2.1.10.94.1.1.11.1.16', + adslAturChanPerfPrev1DayMoniSecs => '1.3.6.1.2.1.10.94.1.1.11.1.17', + adslAturChanPerfPrev1DayReceivedBlks => '1.3.6.1.2.1.10.94.1.1.11.1.18', + adslAturChanPerfPrev1DayTransmittedBlks => '1.3.6.1.2.1.10.94.1.1.11.1.19', + adslAturChanPerfPrev1DayCorrectedBlks => '1.3.6.1.2.1.10.94.1.1.11.1.20', + adslAturChanPerfPrev1DayUncorrectBlks => '1.3.6.1.2.1.10.94.1.1.11.1.21', + adslAtucChanIntervalTable => '1.3.6.1.2.1.10.94.1.1.12', + adslAtucChanIntervalEntry => '1.3.6.1.2.1.10.94.1.1.12.1', + adslAtucChanIntervalNumber => '1.3.6.1.2.1.10.94.1.1.12.1.1', + adslAtucChanIntervalReceivedBlks => '1.3.6.1.2.1.10.94.1.1.12.1.2', + adslAtucChanIntervalTransmittedBlks => '1.3.6.1.2.1.10.94.1.1.12.1.3', + adslAtucChanIntervalCorrectedBlks => '1.3.6.1.2.1.10.94.1.1.12.1.4', + adslAtucChanIntervalUncorrectBlks => '1.3.6.1.2.1.10.94.1.1.12.1.5', + adslAtucChanIntervalValidData => '1.3.6.1.2.1.10.94.1.1.12.1.6', + adslAturChanIntervalTable => '1.3.6.1.2.1.10.94.1.1.13', + adslAturChanIntervalEntry => '1.3.6.1.2.1.10.94.1.1.13.1', + adslAturChanIntervalNumber => '1.3.6.1.2.1.10.94.1.1.13.1.1', + adslAturChanIntervalReceivedBlks => '1.3.6.1.2.1.10.94.1.1.13.1.2', + adslAturChanIntervalTransmittedBlks => '1.3.6.1.2.1.10.94.1.1.13.1.3', + adslAturChanIntervalCorrectedBlks => '1.3.6.1.2.1.10.94.1.1.13.1.4', + adslAturChanIntervalUncorrectBlks => '1.3.6.1.2.1.10.94.1.1.13.1.5', + adslAturChanIntervalValidData => '1.3.6.1.2.1.10.94.1.1.13.1.6', + adslLineConfProfileTable => '1.3.6.1.2.1.10.94.1.1.14', + adslLineConfProfileEntry => '1.3.6.1.2.1.10.94.1.1.14.1', + adslLineConfProfileName => '1.3.6.1.2.1.10.94.1.1.14.1.1', + adslAtucConfRateMode => '1.3.6.1.2.1.10.94.1.1.14.1.2', + adslAtucConfRateModeDefinition => 'ADSL-LINE-MIB::adslAtucConfRateMode', + adslAtucConfRateChanRatio => '1.3.6.1.2.1.10.94.1.1.14.1.3', + adslAtucConfTargetSnrMgn => '1.3.6.1.2.1.10.94.1.1.14.1.4', + adslAtucConfMaxSnrMgn => '1.3.6.1.2.1.10.94.1.1.14.1.5', + adslAtucConfMinSnrMgn => '1.3.6.1.2.1.10.94.1.1.14.1.6', + adslAtucConfDownshiftSnrMgn => '1.3.6.1.2.1.10.94.1.1.14.1.7', + adslAtucConfUpshiftSnrMgn => '1.3.6.1.2.1.10.94.1.1.14.1.8', + adslAtucConfMinUpshiftTime => '1.3.6.1.2.1.10.94.1.1.14.1.9', + adslAtucConfMinDownshiftTime => '1.3.6.1.2.1.10.94.1.1.14.1.10', + adslAtucChanConfFastMinTxRate => '1.3.6.1.2.1.10.94.1.1.14.1.11', + adslAtucChanConfInterleaveMinTxRate => '1.3.6.1.2.1.10.94.1.1.14.1.12', + adslAtucChanConfFastMaxTxRate => '1.3.6.1.2.1.10.94.1.1.14.1.13', + adslAtucChanConfInterleaveMaxTxRate => '1.3.6.1.2.1.10.94.1.1.14.1.14', + adslAtucChanConfMaxInterleaveDelay => '1.3.6.1.2.1.10.94.1.1.14.1.15', + adslAturConfRateMode => '1.3.6.1.2.1.10.94.1.1.14.1.16', + adslAturConfRateModeDefinition => 'ADSL-LINE-MIB::adslAturConfRateMode', + adslAturConfRateChanRatio => '1.3.6.1.2.1.10.94.1.1.14.1.17', + adslAturConfTargetSnrMgn => '1.3.6.1.2.1.10.94.1.1.14.1.18', + adslAturConfMaxSnrMgn => '1.3.6.1.2.1.10.94.1.1.14.1.19', + adslAturConfMinSnrMgn => '1.3.6.1.2.1.10.94.1.1.14.1.20', + adslAturConfDownshiftSnrMgn => '1.3.6.1.2.1.10.94.1.1.14.1.21', + adslAturConfUpshiftSnrMgn => '1.3.6.1.2.1.10.94.1.1.14.1.22', + adslAturConfMinUpshiftTime => '1.3.6.1.2.1.10.94.1.1.14.1.23', + adslAturConfMinDownshiftTime => '1.3.6.1.2.1.10.94.1.1.14.1.24', + adslAturChanConfFastMinTxRate => '1.3.6.1.2.1.10.94.1.1.14.1.25', + adslAturChanConfInterleaveMinTxRate => '1.3.6.1.2.1.10.94.1.1.14.1.26', + adslAturChanConfFastMaxTxRate => '1.3.6.1.2.1.10.94.1.1.14.1.27', + adslAturChanConfInterleaveMaxTxRate => '1.3.6.1.2.1.10.94.1.1.14.1.28', + adslAturChanConfMaxInterleaveDelay => '1.3.6.1.2.1.10.94.1.1.14.1.29', + adslLineConfProfileRowStatus => '1.3.6.1.2.1.10.94.1.1.14.1.30', + adslLineAlarmConfProfileTable => '1.3.6.1.2.1.10.94.1.1.15', + adslLineAlarmConfProfileEntry => '1.3.6.1.2.1.10.94.1.1.15.1', + adslLineAlarmConfProfileName => '1.3.6.1.2.1.10.94.1.1.15.1.1', + adslAtucThresh15MinLofs => '1.3.6.1.2.1.10.94.1.1.15.1.2', + adslAtucThresh15MinLoss => '1.3.6.1.2.1.10.94.1.1.15.1.3', + adslAtucThresh15MinLols => '1.3.6.1.2.1.10.94.1.1.15.1.4', + adslAtucThresh15MinLprs => '1.3.6.1.2.1.10.94.1.1.15.1.5', + adslAtucThresh15MinESs => '1.3.6.1.2.1.10.94.1.1.15.1.6', + adslAtucThreshFastRateUp => '1.3.6.1.2.1.10.94.1.1.15.1.7', + adslAtucThreshInterleaveRateUp => '1.3.6.1.2.1.10.94.1.1.15.1.8', + adslAtucThreshFastRateDown => '1.3.6.1.2.1.10.94.1.1.15.1.9', + adslAtucThreshInterleaveRateDown => '1.3.6.1.2.1.10.94.1.1.15.1.10', + adslAtucInitFailureTrapEnable => '1.3.6.1.2.1.10.94.1.1.15.1.11', + adslAtucInitFailureTrapEnableDefinition => 'ADSL-LINE-MIB::adslAtucInitFailureTrapEnable', + adslAturThresh15MinLofs => '1.3.6.1.2.1.10.94.1.1.15.1.12', + adslAturThresh15MinLoss => '1.3.6.1.2.1.10.94.1.1.15.1.13', + adslAturThresh15MinLprs => '1.3.6.1.2.1.10.94.1.1.15.1.14', + adslAturThresh15MinESs => '1.3.6.1.2.1.10.94.1.1.15.1.15', + adslAturThreshFastRateUp => '1.3.6.1.2.1.10.94.1.1.15.1.16', + adslAturThreshInterleaveRateUp => '1.3.6.1.2.1.10.94.1.1.15.1.17', + adslAturThreshFastRateDown => '1.3.6.1.2.1.10.94.1.1.15.1.18', + adslAturThreshInterleaveRateDown => '1.3.6.1.2.1.10.94.1.1.15.1.19', + adslLineAlarmConfProfileRowStatus => '1.3.6.1.2.1.10.94.1.1.15.1.20', + adslLCSMib => '1.3.6.1.2.1.10.94.1.1.16', + adslTraps => '1.3.6.1.2.1.10.94.1.2', + adslAtucTraps => '1.3.6.1.2.1.10.94.1.2.1', + adslAturTraps => '1.3.6.1.2.1.10.94.1.2.2', + adslConformance => '1.3.6.1.2.1.10.94.1.3', + adslGroups => '1.3.6.1.2.1.10.94.1.3.1', + adslCompliances => '1.3.6.1.2.1.10.94.1.3.2', +}; + +$Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{'ADSL-LINE-MIB'} = { + adslAturConfRateMode => { + '1' => 'fixed', + '2' => 'adaptAtStartup', + '3' => 'adaptAtRuntime', + }, + adslLineType => { + '1' => 'noChannel', + '2' => 'fastOnly', + '3' => 'interleavedOnly', + '4' => 'fastOrInterleaved', + '5' => 'fastAndInterleaved', + }, + adslAtucInitFailureTrapEnable => { + '1' => 'enable', + '2' => 'disable', + }, + adslLineCoding => { + '1' => 'other', + '2' => 'dmt', + '3' => 'cap', + '4' => 'qam', + }, + adslAtucConfRateMode => { + '1' => 'fixed', + '2' => 'adaptAtStartup', + '3' => 'adaptAtRuntime', + }, +}; 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..bcf06812 --- /dev/null +++ b/plugins-scripts/Classes/DrayTek/Vigor/Component/EnvironmentalSubsystem.pm @@ -0,0 +1,34 @@ +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) = @_; + chomp $self->{adslAturCurrStatus}; + $self->{adslAturCurrStatus} =~ s/\x0+$//; +} + +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/Makefile.am b/plugins-scripts/Makefile.am index 9c94514c..64e92d2f 100644 --- a/plugins-scripts/Makefile.am +++ b/plugins-scripts/Makefile.am @@ -414,6 +414,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 From 2f7d8ea6074dd044d3bab9a0e13d4dcbc3122cfe Mon Sep 17 00:00:00 2001 From: volalla <37865706+volalla@users.noreply.github.com> Date: Mon, 18 Feb 2019 15:48:40 +0100 Subject: [PATCH 80/82] Add --sum option to interface-usage mode --- .../FritzBox7390/Components/InterfaceSubsystem.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins-scripts/Classes/UPNP/AVM/FritzBox7390/Components/InterfaceSubsystem.pm b/plugins-scripts/Classes/UPNP/AVM/FritzBox7390/Components/InterfaceSubsystem.pm index 88f04e92..66d558b3 100644 --- a/plugins-scripts/Classes/UPNP/AVM/FritzBox7390/Components/InterfaceSubsystem.pm +++ b/plugins-scripts/Classes/UPNP/AVM/FritzBox7390/Components/InterfaceSubsystem.pm @@ -121,6 +121,15 @@ sub check { my ($inwarning, $incritical) = $self->get_thresholds( metric => $self->{ifDescr}.'_usage_in', ); + # volalla: Add --sum Option + if ($self->opts->sum){ + $self->interface_traffic_sum( + traffic_in => $self->{inputRate}, + traffic_out => $self->{outputRate}, + interface => $self->{ifDescr}, + warning => $inwarning, + critical => $incritical); + } $self->set_thresholds( metric => $self->{ifDescr}.'_traffic_in', warning => $self->{maxInputRate} / 100 * $inwarning, @@ -152,7 +161,7 @@ sub check { ); } elsif ($self->mode =~ /device::interfaces::operstatus/) { $self->add_info(sprintf 'interface %s%s status is %s', - $self->{ifDescr}, + $self->{ifDescr}, $self->{ExternalIPAddress} ? " (".$self->{ExternalIPAddress}.")" : "", $self->{ConnectionStatus}); if ($self->{ConnectionStatus} eq "Connected") { @@ -165,4 +174,3 @@ sub check { $self->add_ok("have fun"); } } - From 1a3456290dbb7d40dd4f9af3eff58ed8af836213 Mon Sep 17 00:00:00 2001 From: volalla <37865706+volalla@users.noreply.github.com> Date: Mon, 18 Feb 2019 15:49:44 +0100 Subject: [PATCH 81/82] Add --sum option to interface-usage mode --- plugins-scripts/Classes/Server/SolarisLocal.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins-scripts/Classes/Server/SolarisLocal.pm b/plugins-scripts/Classes/Server/SolarisLocal.pm index 2b25047b..d98222b1 100644 --- a/plugins-scripts/Classes/Server/SolarisLocal.pm +++ b/plugins-scripts/Classes/Server/SolarisLocal.pm @@ -270,6 +270,15 @@ sub check { my ($inwarning, $incritical) = $self->get_thresholds( metric => $self->{ifDescr}.'_usage_in', ); + # volalla: Add --sum Option + if ($self->opts->sum){ + $self->interface_traffic_sum( + traffic_in => $self->{inputRate}, + traffic_out => $self->{outputRate}, + interface => $self->{ifDescr}, + warning => $inwarning, + critical => $incritical); + } $self->set_thresholds( metric => $self->{ifDescr}.'_traffic_in', warning => $self->{maxInputRate} / 100 * $inwarning, @@ -340,4 +349,3 @@ sub list { my ($self) = @_; printf "%s\n", $self->{ifDescr}; } - From ace8a05a9f3aaf9e479a5b5b52a219e8e69a17c0 Mon Sep 17 00:00:00 2001 From: volalla <37865706+volalla@users.noreply.github.com> Date: Mon, 18 Feb 2019 15:50:40 +0100 Subject: [PATCH 82/82] Add --sum option to interface-usage mode --- .../IFMIB/Component/InterfaceSubsystem.pm | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm b/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm index 2642a2df..09fdcbf0 100644 --- a/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm +++ b/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm @@ -614,7 +614,7 @@ sub finish { } 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} && + if ($self->{ifName} && defined $self->{ifHCInOctets} && defined $self->{ifHCOutOctets} && $self->{ifHCInOctets} ne "noSuchObject") { $self->{ifAlias} ||= $self->{ifName}; $self->{ifName} = unpack("Z*", $self->{ifName}); @@ -633,7 +633,7 @@ sub finish { bless $self, 'Classes::IFMIB::Component::InterfaceSubsystem::Interface::StackSub'; } if ($self->{ifPhysAddress}) { - $self->{ifPhysAddress} = join(':', unpack('(H2)*', $self->{ifPhysAddress})); + $self->{ifPhysAddress} = join(':', unpack('(H2)*', $self->{ifPhysAddress})); } } $self->init(); @@ -703,15 +703,15 @@ sub init { } } elsif ($self->mode =~ /device::interfaces::errors/) { $self->valdiff({name => $self->{ifDescr}}, qw(ifInErrors ifOutErrors)); - $self->{inputErrorRate} = $self->{delta_ifInErrors} + $self->{inputErrorRate} = $self->{delta_ifInErrors} / $self->{delta_timestamp}; - $self->{outputErrorRate} = $self->{delta_ifOutErrors} + $self->{outputErrorRate} = $self->{delta_ifOutErrors} / $self->{delta_timestamp}; } elsif ($self->mode =~ /device::interfaces::discards/) { $self->valdiff({name => $self->{ifDescr}}, qw(ifInDiscards ifOutDiscards)); - $self->{inputDiscardRate} = $self->{delta_ifInDiscards} + $self->{inputDiscardRate} = $self->{delta_ifInDiscards} / $self->{delta_timestamp}; - $self->{outputDiscardRate} = $self->{delta_ifOutDiscards} + $self->{outputDiscardRate} = $self->{delta_ifOutDiscards} / $self->{delta_timestamp}; } elsif ($self->mode =~ /device::interfaces::broadcasts/) { foreach my $key (qw(ifInUcastPkts @@ -732,7 +732,7 @@ sub init { $self->{delta_ifOutBroadcastPkts}); } elsif ($self->mode =~ /device::interfaces::operstatus/) { } elsif ($self->mode =~ /device::interfaces::availability/) { - $self->{ifStatusDuration} = + $self->{ifStatusDuration} = $self->uptime() - $self->timeticks($self->{ifLastChange}); $self->opts->override_opt('lookback', 1800) if ! $self->opts->lookback; if ($self->{ifAdminStatus} eq "down") { @@ -747,7 +747,7 @@ sub init { my $gb = 1000 * 1000 * 1000; my $mb = 1000 * 1000; my $kb = 1000; - my $speed = $self->{ifHighSpeed} ? + my $speed = $self->{ifHighSpeed} ? ($self->{ifHighSpeed} * $mb) : $self->{ifSpeed}; if ($speed >= $gb) { $self->{ifSpeedText} = sprintf "%.2fGB", $speed / $gb; @@ -842,7 +842,7 @@ sub check { } elsif ($self->mode =~ /device::interfaces::usage/) { $self->add_info(sprintf 'interface %s usage is in:%.2f%% (%s) out:%.2f%% (%s)%s', $full_descr, - $self->{inputUtilization}, + $self->{inputUtilization}, sprintf("%.2f%s/s", $self->{inputRate}, $self->opts->units), $self->{outputUtilization}, sprintf("%.2f%s/s", $self->{outputRate}, $self->opts->units), @@ -880,6 +880,15 @@ sub check { my ($inwarning, $incritical) = $self->get_thresholds( metric => $self->{ifDescr}.'_usage_in', ); + # volalla: Add --sum Option + if ($self->opts->sum){ + $self->interface_traffic_sum( + traffic_in => $self->{inputRate}, + traffic_out => $self->{outputRate}, + interface => $self->{ifDescr}, + warning => $inwarning, + critical => $incritical); + } $self->set_thresholds( metric => $self->{ifDescr}.'_traffic_in', warning => $self->{maxInputRate} / 100 * $inwarning, @@ -1016,7 +1025,7 @@ sub check { # fault condition on the interface. # --warning onu,anu # Admin: admindown,admin - # Admin: --warning + # Admin: --warning # --critical admindown # !ad+od ad+!(od*on) # warn & warnbitfield @@ -1027,7 +1036,7 @@ sub check { # } # if ($self->{ifOperStatus} ne 'up') { # } -# } +# } $self->add_info(sprintf '%s is %s/%s', $full_descr, $self->{ifOperStatus}, $self->{ifAdminStatus}); @@ -1043,7 +1052,7 @@ sub check { sprintf '%s is admin down', $full_descr); } } elsif ($self->mode =~ /device::interfaces::availability/) { - $self->{ifStatusDuration} = + $self->{ifStatusDuration} = $self->human_timeticks($self->{ifStatusDuration}); $self->add_info(sprintf '%s is %savailable (%s/%s, since %s)', $self->{ifDescr}, ($self->{ifAvailable} eq "true" ? "" : "un"), @@ -1225,7 +1234,7 @@ sub init_etherstats { for my $stat (grep { /^(dot3|etherStats)/ } @{$self->{columns}}) { next if ! defined $self->{'delta_'.$stat}; $self->{$stat.'Percent'} = $self->{delta_InPkts} + $self->{delta_OutPkts} ? - 100 * $self->{'delta_'.$stat} / + 100 * $self->{'delta_'.$stat} / ($self->{delta_InPkts} + $self->{delta_OutPkts}) : 0; } } @@ -1259,4 +1268,3 @@ sub check { $self->add_ok(sprintf '%s has no traffic', $full_descr); } } -