Skip to content

Commit

Permalink
fixup! fix cisco bgp for routers which do not export the proptietary …
Browse files Browse the repository at this point in the history
…mib, but bgp4
  • Loading branch information
lausser committed Dec 12, 2018
1 parent 775e328 commit ea26887
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
36 changes: 36 additions & 0 deletions plugins-scripts/Classes/Cisco/WLC/Component/HaSubsystem.pm
Original file line number Diff line number Diff line change
@@ -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');
}
}
}
}

6 changes: 3 additions & 3 deletions plugins-scripts/Classes/UCDMIB/Components/MemSubsystem.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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->{$_});
}

Expand Down

0 comments on commit ea26887

Please sign in to comment.