From 6113dd3b988f216b0aa6f330ea12d49576b6ceed Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sat, 3 Mar 2018 17:18:29 +0000 Subject: [PATCH] fix pod for new Cumulus class --- lib/SNMP/Info.pm | 6 ++ lib/SNMP/Info/Layer3/Cumulus.pm | 98 ++++++++++++++++----------------- 2 files changed, 54 insertions(+), 50 deletions(-) diff --git a/lib/SNMP/Info.pm b/lib/SNMP/Info.pm index 55f04707..994c6a81 100644 --- a/lib/SNMP/Info.pm +++ b/lib/SNMP/Info.pm @@ -766,6 +766,12 @@ Subclass for Avaya/Nortel Contivity/VPN Routers. See documentation in L for details. +=item SNMP::Info::Layer3::Cumulus + +Subclass for Cumulus Networks Routers. + +See documentation in L for details. + =item SNMP::Info::Layer3::DLink Subclass for DLink devices. diff --git a/lib/SNMP/Info/Layer3/Cumulus.pm b/lib/SNMP/Info/Layer3/Cumulus.pm index 34995f37..5e09498c 100644 --- a/lib/SNMP/Info/Layer3/Cumulus.pm +++ b/lib/SNMP/Info/Layer3/Cumulus.pm @@ -112,22 +112,22 @@ sub uptime { return $netsnmp->SUPER::uptime(); } -sub i_ignore { - my $l3 = shift; - my $partial = shift; - - my $interfaces = $l3->interfaces($partial) || {}; - - my %i_ignore; - foreach my $if ( keys %$interfaces ) { - - # lo0 etc - if ( $interfaces->{$if} =~ /\blo\d*\b/i ) { - $i_ignore{$if}++; - } - } - return \%i_ignore; -} +#sub i_ignore { +# my $l3 = shift; +# my $partial = shift; +# +# my $interfaces = $l3->interfaces($partial) || {}; +# +# my %i_ignore; +# foreach my $if ( keys %$interfaces ) { +# +# # lo0 etc +# if ( $interfaces->{$if} =~ /\blo\d*\b/i ) { +# $i_ignore{$if}++; +# } +# } +# return \%i_ignore; +#} sub agg_ports { return agg_ports_lag(@_) } @@ -145,7 +145,7 @@ Oliver Gorwits - based on Layer3::NetSNMP implementation =head1 SYNOPSIS # Let SNMP::Info determine the correct subclass for you. - my $netsnmp = new SNMP::Info( + my $cumulus = new SNMP::Info( AutoSpecify => 1, Debug => 1, DestHost => 'myrouter', @@ -154,12 +154,12 @@ Oliver Gorwits - based on Layer3::NetSNMP implementation ) or die "Can't connect to DestHost.\n"; - my $class = $netsnmp->class(); + my $class = $cumulus->class(); print "SNMP::Info determined this device to fall under subclass : $class\n"; =head1 DESCRIPTION -Subclass for Generic Net-SNMP devices +Subclass for Cumulus Networks devices =head2 Inherited Classes @@ -185,6 +185,8 @@ See L for its own MIB requirements. See L for its own MIB requirements. +See L for its own MIB requirements. + =back =head1 GLOBALS @@ -193,28 +195,27 @@ These are methods that return scalar value from SNMP =over -=item $netsnmp->vendor() +=item $cumulus->vendor() -Returns 'Net-SNMP'. +Returns 'Cumulus Networks'. -=item $netsnmp->os() +=item $cumulus->os() -Returns the OS extracted from C. +Returns 'cumulus'. -=item $netsnmp->os_ver() +=item $cumulus->os_ver() -Returns the software version extracted from C, along -with the Net-SNMP version. +Returns the software version extracted from C. -=item $netsnmp->uptime() +=item $cumulus->uptime() Returns the system uptime instead of the agent uptime. NOTE: discontinuity timers and other Time Stamp based objects are based on agent uptime, so use orig_uptime(). -=item $netsnmp->serial() +=item $l3->model() -Returns ''. +Returns the chassis type. =back @@ -226,20 +227,32 @@ See documentation in L for details. See documentation in L for details. +=head2 Globals imported from SNMP::Info::IEEE802dot3ad + +See documentation in L for details. + =head1 TABLE ENTRIES These are methods that return tables of information in the form of a reference to a hash. +=cut + +#=item $cumulus->i_ignore() +# +#Returns reference to hash. Increments value of IID if port is to be ignored. +# +#Ignores loopback + =head2 Overrides =over -=item $netsnmp->i_ignore() +=item C -Returns reference to hash. Increments value of IID if port is to be ignored. - -Ignores loopback +Returns a HASH reference mapping from slave to master port for each member of +a port bundle on the device. Keys are ifIndex of the slave ports, Values are +ifIndex of the corresponding master ports. =back @@ -251,23 +264,8 @@ See documentation in L for details. See documentation in L for details. -=head1 NOTES +=head2 Table Methods imported from SNMP::Info::IEEE802dot3ad -In order to cause SNMP::Info to classify your device into this class, it -may be necessary to put a configuration line into your F -similar to - - sysobjectid .1.3.6.1.4.1.8072.3.2.N - -where N is the object ID for your OS from the C MIB (or -255 if not listed). Some Net-SNMP installations default to an -incorrect return value for C. - -In order to recognize a Net-SNMP device as Layer3, it may be necessary -to put a configuration line similar to - - sysservices 76 - -in your F. +See documentation in L for details. =cut