even more whitespace cleanup

This commit is contained in:
inphobia
2019-01-19 05:13:01 +01:00
parent 6118b0d012
commit b78b1b4860
12 changed files with 94 additions and 94 deletions

View File

@@ -241,7 +241,7 @@ sub os_ver {
# See if we report from Flash if wouldn't report from running above # See if we report from Flash if wouldn't report from running above
return $foundry->snAgFlashImgVer() if ( defined $foundry->snAgFlashImgVer() ); return $foundry->snAgFlashImgVer() if ( defined $foundry->snAgFlashImgVer() );
# Last resort # Last resort
return $foundry->SUPER::os_ver(); return $foundry->SUPER::os_ver();
@@ -405,7 +405,7 @@ sub brcd_e_index {
my $partial = shift; my $partial = shift;
my $stack_master = $foundry->_brcd_stack_master(); my $stack_master = $foundry->_brcd_stack_master();
my $brcd_e_idx my $brcd_e_idx
= $foundry->snAgentConfigModule2Description($partial) = $foundry->snAgentConfigModule2Description($partial)
|| $foundry->snAgentConfigModuleDescription($partial) || $foundry->snAgentConfigModuleDescription($partial)
|| {}; || {};
@@ -460,7 +460,7 @@ sub brcd_e_descr {
my $partial = shift; my $partial = shift;
my $brcd_e_idx = $foundry->brcd_e_index($partial) || {}; my $brcd_e_idx = $foundry->brcd_e_index($partial) || {};
my $m_descrs my $m_descrs
= $foundry->snAgentConfigModule2Description($partial) = $foundry->snAgentConfigModule2Description($partial)
|| $foundry->snAgentConfigModuleDescription($partial) || $foundry->snAgentConfigModuleDescription($partial)
|| {}; || {};
@@ -526,7 +526,7 @@ sub brcd_e_serial {
my $partial = shift; my $partial = shift;
my $e_idx = $foundry->brcd_e_index($partial) || {}; my $e_idx = $foundry->brcd_e_index($partial) || {};
my $serials my $serials
= $foundry->snAgentConfigModule2SerialNumber($partial) = $foundry->snAgentConfigModule2SerialNumber($partial)
|| $foundry->snAgentConfigModuleSerialNumber($partial) || $foundry->snAgentConfigModuleSerialNumber($partial)
|| {}; || {};
@@ -551,7 +551,7 @@ sub brcd_e_type {
my $partial = shift; my $partial = shift;
my $e_idx = $foundry->brcd_e_index($partial) || {}; my $e_idx = $foundry->brcd_e_index($partial) || {};
my $types my $types
= $foundry->ag_mod2_type($partial) = $foundry->ag_mod2_type($partial)
|| $foundry->ag_mod_type($partial) || $foundry->ag_mod_type($partial)
|| {}; || {};
@@ -861,14 +861,14 @@ Max Baker
=head1 SYNOPSIS =head1 SYNOPSIS
# Let SNMP::Info determine the correct subclass for you. # Let SNMP::Info determine the correct subclass for you.
my $foundry = new SNMP::Info( my $foundry = new SNMP::Info(
AutoSpecify => 1, AutoSpecify => 1,
Debug => 1, Debug => 1,
DestHost => 'myswitch', DestHost => 'myswitch',
Community => 'public', Community => 'public',
Version => 1 Version => 1
) )
or die "Can't connect to DestHost.\n"; or die "Can't connect to DestHost.\n";
my $class = $foundry->class(); my $class = $foundry->class();
@@ -932,7 +932,7 @@ These are methods that return scalar value from SNMP
Returns model type. Checks $foundry->id() against the F<FOUNDRY-SN-ROOT-MIB> Returns model type. Checks $foundry->id() against the F<FOUNDRY-SN-ROOT-MIB>
and removes 'C<sn>' and 'C<Switch>'. EdgeIron models determined and removes 'C<sn>' and 'C<Switch>'. EdgeIron models determined
through F<ENTITY-MIB>. through F<ENTITY-MIB>.
=item $foundry->vendor() =item $foundry->vendor()
@@ -1029,16 +1029,16 @@ Returns reference to hash of interface names to iids.
Returns reference to hash of interfaces to be ignored. Returns reference to hash of interfaces to be ignored.
Ignores interfaces with descriptions of tunnel,loopback,null Ignores interfaces with descriptions of tunnel,loopback,null
=item $foundry->i_duplex() =item $foundry->i_duplex()
Returns reference to hash of interface link duplex status. Returns reference to hash of interface link duplex status.
Crosses $foundry->sw_duplex() with $foundry->sw_index() Crosses $foundry->sw_duplex() with $foundry->sw_index()
=item $foundry->i_stp_state() =item $foundry->i_stp_state()
Returns the mapping of (C<dot1dStpPortState>) to the interface Returns the mapping of (C<dot1dStpPortState>) to the interface
index (iid). index (iid).
@@ -1060,7 +1060,7 @@ for details on brcd_e_* methods.
=over =over
=item $foundry->e_index() =item $foundry->e_index()
If the device doesn't support C<entPhysicalDescr>, this will If the device doesn't support C<entPhysicalDescr>, this will
try brcd_e_index(). try brcd_e_index().
@@ -1068,42 +1068,42 @@ try brcd_e_index().
Note that this is based on C<entPhysicalDescr> due to implementation Note that this is based on C<entPhysicalDescr> due to implementation
details of SNMP::Info::Entity::e_index(). details of SNMP::Info::Entity::e_index().
=item $foundry->e_class() =item $foundry->e_class()
If the device doesn't support C<entPhysicalClass>, this will try If the device doesn't support C<entPhysicalClass>, this will try
brcd_e_class(). brcd_e_class().
=item $foundry->e_descr() =item $foundry->e_descr()
If the device doesn't support C<entPhysicalDescr>, this will try If the device doesn't support C<entPhysicalDescr>, this will try
brcd_e_descr(). brcd_e_descr().
=item $foundry->e_name() =item $foundry->e_name()
If the device doesn't support C<entPhysicalName>, this will try If the device doesn't support C<entPhysicalName>, this will try
brcd_e_name(). brcd_e_name().
=item $foundry->e_parent() =item $foundry->e_parent()
If the device doesn't support C<entPhysicalContainedIn>, this will try If the device doesn't support C<entPhysicalContainedIn>, this will try
brcd_e_parent(). brcd_e_parent().
=item $foundry->e_pos() =item $foundry->e_pos()
If the device doesn't support C<entPhysicalParentRelPos>, this will try If the device doesn't support C<entPhysicalParentRelPos>, this will try
brcd_e_pos(). brcd_e_pos().
=item $foundry->e_serial() =item $foundry->e_serial()
If the device doesn't support C<entPhysicalSerialNum>, this will try If the device doesn't support C<entPhysicalSerialNum>, this will try
brcd_e_serial(). brcd_e_serial().
=item $foundry->e_type() =item $foundry->e_type()
If the device doesn't support C<entPhysicalVendorType>, this will try If the device doesn't support C<entPhysicalVendorType>, this will try
brcd_e_type(). brcd_e_type().
=item $foundry->e_vendor() =item $foundry->e_vendor()
If the device doesn't support C<entPhysicalMfgName>, this will try If the device doesn't support C<entPhysicalMfgName>, this will try
brcd_e_vendor(). brcd_e_vendor().
@@ -1113,7 +1113,7 @@ brcd_e_vendor().
=head2 Pseudo F<ENTITY-MIB> information =head2 Pseudo F<ENTITY-MIB> information
These methods emulate F<ENTITY-MIB> Physical Table methods using These methods emulate F<ENTITY-MIB> Physical Table methods using
F<FOUNDRY-SN-AGENT-MIB>. F<FOUNDRY-SN-AGENT-MIB>.
=over =over
@@ -1135,7 +1135,7 @@ base switches that contain modules, and 'module' for others.
Returns reference to hash. Key: IID, Value: Human friendly name Returns reference to hash. Key: IID, Value: Human friendly name
(C<snAgentConfigModule2Description>) or (C<snAgentConfigModule2Description>) or
(C<snAgentConfigModuleDescription>) (C<snAgentConfigModuleDescription>)
=item $foundry->brcd_e_name() =item $foundry->brcd_e_name()
@@ -1149,14 +1149,14 @@ Returns reference to hash. Key: IID, Value: brocade
Returns reference to hash. Key: IID, Value: Serial number Returns reference to hash. Key: IID, Value: Serial number
Serial number is $foundry->serial() for a stack master unit and Serial number is $foundry->serial() for a stack master unit and
(C<snAgentConfigModule2SerialNumber>) or (C<snAgentConfigModule2SerialNumber>) or
(C<snAgentConfigModuleSerialNumber>) for all others. (C<snAgentConfigModuleSerialNumber>) for all others.
=item $foundry->brcd_e_type() =item $foundry->brcd_e_type()
Returns reference to hash. Key: IID, Value: Type of component/sub-component Returns reference to hash. Key: IID, Value: Type of component/sub-component
as defined under C<snAgentConfigModule2Type> or C<snAgentConfigModule2Type> as defined under C<snAgentConfigModule2Type> or C<snAgentConfigModule2Type>
in F<FOUNDRY-SN-AGENT-MIB>. in F<FOUNDRY-SN-AGENT-MIB>.
=item $foundry->brcd_e_pos() =item $foundry->brcd_e_pos()
@@ -1180,13 +1180,13 @@ this entity is not contained in any other entity.
=item $foundry->sw_index() =item $foundry->sw_index()
Returns reference to hash. Maps Table to Interface IID. Returns reference to hash. Maps Table to Interface IID.
(C<snSwPortIfIndex>) (C<snSwPortIfIndex>)
=item $foundry->sw_duplex() =item $foundry->sw_duplex()
Returns reference to hash. Current duplex status for switch ports. Returns reference to hash. Current duplex status for switch ports.
(C<snSwPortInfoChnMode>) (C<snSwPortInfoChnMode>)
@@ -1198,7 +1198,7 @@ Returns reference to hash. Current Port Type .
=item $foundry->sw_speed() =item $foundry->sw_speed()
Returns reference to hash. Current Port Speed. Returns reference to hash. Current Port Speed.
(C<snSwPortInfoSpeed>) (C<snSwPortInfoSpeed>)

View File

@@ -115,14 +115,14 @@ Netdisco Developers
=head1 SYNOPSIS =head1 SYNOPSIS
# Let SNMP::Info determine the correct subclass for you. # Let SNMP::Info determine the correct subclass for you.
my $genua = new SNMP::Info( my $genua = new SNMP::Info(
AutoSpecify => 1, AutoSpecify => 1,
Debug => 1, Debug => 1,
DestHost => 'myhub', DestHost => 'myhub',
Community => 'public', Community => 'public',
Version => 1 Version => 1
) )
or die "Can't connect to DestHost.\n"; or die "Can't connect to DestHost.\n";
my $class = $genua->class(); my $class = $genua->class();
@@ -163,7 +163,7 @@ Returns 'genua'
=item $genua->os_ver() =item $genua->os_ver()
(C<infoRelease>) and (C<infoPatchlevel>) (C<infoRelease>) and (C<infoPatchlevel>)
=item $genua->model() =item $genua->model()

View File

@@ -89,7 +89,7 @@ sub vendor {
sub model { sub model {
my $h3c = shift; my $h3c = shift;
my $descr = $h3c->description(); my $descr = $h3c->description();
if ($descr =~ /^.*\n(.*)\n/) { if ($descr =~ /^.*\n(.*)\n/) {
return $1; return $1;
@@ -154,14 +154,14 @@ Jeroen van Ingen
=head1 SYNOPSIS =head1 SYNOPSIS
# Let SNMP::Info determine the correct subclass for you. # Let SNMP::Info determine the correct subclass for you.
my $h3c = new SNMP::Info( my $h3c = new SNMP::Info(
AutoSpecify => 1, AutoSpecify => 1,
Debug => 1, Debug => 1,
DestHost => 'myrouter', DestHost => 'myrouter',
Community => 'public', Community => 'public',
Version => 2 Version => 2
) )
or die "Can't connect to DestHost.\n"; or die "Can't connect to DestHost.\n";
my $class = $h3c->class(); my $class = $h3c->class();
@@ -223,7 +223,7 @@ Returns the OS extracted from C<sysDescr>.
=item $h3c->os_ver() =item $h3c->os_ver()
Returns the software version. Either C<entPhysicalSoftwareRev.2> or extracted from Returns the software version. Either C<entPhysicalSoftwareRev.2> or extracted from
C<sysDescr>. C<sysDescr>.
=back =back

View File

@@ -209,14 +209,14 @@ Eric Miller
=head1 SYNOPSIS =head1 SYNOPSIS
# Let SNMP::Info determine the correct subclass for you. # Let SNMP::Info determine the correct subclass for you.
my $hp9300 = new SNMP::Info( my $hp9300 = new SNMP::Info(
AutoSpecify => 1, AutoSpecify => 1,
Debug => 1, Debug => 1,
DestHost => 'myswitch', DestHost => 'myswitch',
Community => 'public', Community => 'public',
Version => 1 Version => 1
) )
or die "Can't connect to DestHost.\n"; or die "Can't connect to DestHost.\n";
my $class = $hp9300->class(); my $class = $hp9300->class();
@@ -359,11 +359,11 @@ Returns reference to hash of interface names to iids.
Returns reference to hash of interfaces to be ignored. Returns reference to hash of interfaces to be ignored.
Ignores interfaces with descriptions of tunnel,loopback,null Ignores interfaces with descriptions of tunnel,loopback,null
=item $hp9300->i_duplex() =item $hp9300->i_duplex()
Returns reference to hash of interface link duplex status. Returns reference to hash of interface link duplex status.
Crosses $hp9300->sw_duplex() with $hp9300->sw_index() Crosses $hp9300->sw_duplex() with $hp9300->sw_index()
@@ -375,13 +375,13 @@ Crosses $hp9300->sw_duplex() with $hp9300->sw_index()
=item $hp9300->sw_index() =item $hp9300->sw_index()
Returns reference to hash. Maps Table to Interface IID. Returns reference to hash. Maps Table to Interface IID.
(C<snSwPortIfIndex>) (C<snSwPortIfIndex>)
=item $hp9300->sw_duplex() =item $hp9300->sw_duplex()
Returns reference to hash. Current duplex status for switch ports. Returns reference to hash. Current duplex status for switch ports.
(C<snSwPortInfoChnMode>) (C<snSwPortInfoChnMode>)
@@ -393,7 +393,7 @@ Returns reference to hash. Current Port Type .
=item $hp9300->sw_speed() =item $hp9300->sw_speed()
Returns reference to hash. Current Port Speed. Returns reference to hash. Current Port Speed.
(C<snSwPortInfoSpeed>) (C<snSwPortInfoSpeed>)

View File

@@ -138,7 +138,7 @@ sub os_ver {
if ($descr =~ /Version\s # Start match on Version string if ($descr =~ /Version\s # Start match on Version string
([\d\.]+) # Capture the primary version in 1 ([\d\.]+) # Capture the primary version in 1
,? # There may be a comma ,? # There may be a comma
\s # Always a space \s # Always a space
(?:Release|Feature)? # Don't capture stanza if present (?:Release|Feature)? # Don't capture stanza if present
(?:\(\w+)? # If paren & model don't capture (?:\(\w+)? # If paren & model don't capture
\s # Always a space \s # Always a space
@@ -154,7 +154,7 @@ sub os_ver {
sub mac { sub mac {
my $huawei = shift; my $huawei = shift;
return $huawei->b_mac(); return $huawei->b_mac();
} }
@@ -393,7 +393,7 @@ sub fan {
my ($slot, $num) = split(/\./, $k); my ($slot, $num) = split(/\./, $k);
my $descr = "Slot $slot,Fan $num"; my $descr = "Slot $slot,Fan $num";
$descr = $fan->{$k} if ($fan->{$k}); $descr = $fan->{$k} if ($fan->{$k});
push @messages, "$descr: $state->{$k}"; push @messages, "$descr: $state->{$k}";
} }
@@ -511,14 +511,14 @@ Jeroen van Ingen and Eric Miller
=head1 SYNOPSIS =head1 SYNOPSIS
# Let SNMP::Info determine the correct subclass for you. # Let SNMP::Info determine the correct subclass for you.
my $huawei = new SNMP::Info( my $huawei = new SNMP::Info(
AutoSpecify => 1, AutoSpecify => 1,
Debug => 1, Debug => 1,
DestHost => 'myrouter', DestHost => 'myrouter',
Community => 'public', Community => 'public',
Version => 2 Version => 2
) )
or die "Can't connect to DestHost.\n"; or die "Can't connect to DestHost.\n";
my $class = $huawei->class(); my $class = $huawei->class();
@@ -553,7 +553,7 @@ Subclass for Huawei switches
=item F<HUAWEI-POE-MIB> =item F<HUAWEI-POE-MIB>
=item F<HUAWEI-ENTITY-EXTENT-MIB> =item F<HUAWEI-ENTITY-EXTENT-MIB>
=item Inherited Classes' MIBs =item Inherited Classes' MIBs
See L<SNMP::Info::Layer3> for its own MIB requirements. See L<SNMP::Info::Layer3> for its own MIB requirements.

View File

@@ -248,14 +248,14 @@ Eric Miller
=head1 SYNOPSIS =head1 SYNOPSIS
# Let SNMP::Info determine the correct subclass for you. # Let SNMP::Info determine the correct subclass for you.
my $ibm = new SNMP::Info( my $ibm = new SNMP::Info(
AutoSpecify => 1, AutoSpecify => 1,
Debug => 1, Debug => 1,
DestHost => 'myswitch', DestHost => 'myswitch',
Community => 'public', Community => 'public',
Version => 1 Version => 1
) )
or die "Can't connect to DestHost.\n"; or die "Can't connect to DestHost.\n";
my $class = $ibm->class(); my $class = $ibm->class();
@@ -335,7 +335,7 @@ Returns the software version
=item $ibm->hasLLDP() =item $ibm->hasLLDP()
Is LLDP is active in this device? Is LLDP is active in this device?
Note: LLDP may be active, but nothing in C<lldpRemoteSystemsData> Tables so Note: LLDP may be active, but nothing in C<lldpRemoteSystemsData> Tables so
the device would not return any useful topology information. the device would not return any useful topology information.
@@ -373,13 +373,13 @@ Ignores interfaces with descriptions of tunnel, loopback, and null.
=item $ibm->i_duplex() =item $ibm->i_duplex()
Returns reference to hash of interface link duplex status. Returns reference to hash of interface link duplex status.
(C<portInfoMode>) (C<portInfoMode>)
=item $ibm->lldp_if() =item $ibm->lldp_if()
Returns the mapping to the SNMP Interface Table. Tries to cross reference Returns the mapping to the SNMP Interface Table. Tries to cross reference
(C<lldpInfoRemoteDevicesLocalPort>) with (C<ifDescr>) and (C<ifAlias>) (C<lldpInfoRemoteDevicesLocalPort>) with (C<ifDescr>) and (C<ifAlias>)
to get (C<ifIndex>). to get (C<ifIndex>).

View File

@@ -106,11 +106,11 @@ sub os {
sub layers { sub layers {
my $juniper = shift; my $juniper = shift;
my $layers = $juniper->SUPER::layers(); my $layers = $juniper->SUPER::layers();
# Some models don't report L2 properly # Some models don't report L2 properly
my $macs = $juniper->fw_mac(); my $macs = $juniper->fw_mac();
if (keys %$macs) { if (keys %$macs) {
my $l = substr $layers, 6, 1, "1"; my $l = substr $layers, 6, 1, "1";
} }
@@ -145,7 +145,7 @@ sub model {
# Query the junos device model. # Query the junos device model.
my $mod = uc $l3->vc_model() || ''; my $mod = uc $l3->vc_model() || '';
if (not $mod eq '') { if (not $mod eq '') {
return $mod; return $mod;
} }
# Fallback to old method # Fallback to old method
@@ -268,14 +268,14 @@ sub i_vlan {
return $i_vlan; return $i_vlan;
} }
sub v_name { sub v_name {
my $juniper = shift; my $juniper = shift;
return $juniper->jnx_els_v_name() || $juniper->jnx_v_name(); return $juniper->jnx_els_v_name() || $juniper->jnx_v_name();
} }
# Index doesn't use VLAN ID, so override the HOA private method here to # Index doesn't use VLAN ID, so override the HOA private method here to
# correct the mapping # correct the mapping
sub _vlan_hoa { sub _vlan_hoa {
my $juniper = shift; my $juniper = shift;
my ( $v_ports, $partial ) = @_; my ( $v_ports, $partial ) = @_;
@@ -373,7 +373,7 @@ sub _e_is_virtual {
my $juniper = shift; my $juniper = shift;
my $v_test = $juniper->jnxVirtualChassisMemberRole() || {}; my $v_test = $juniper->jnxVirtualChassisMemberRole() || {};
#If we are functioning as a stack someone should be master #If we are functioning as a stack someone should be master
foreach my $iid ( keys %$v_test ) { foreach my $iid ( keys %$v_test ) {
my $role = $v_test->{$iid}; my $role = $v_test->{$iid};
@@ -418,7 +418,7 @@ sub e_index {
my $virtuals = $juniper->_e_virtual_index() || {}; my $virtuals = $juniper->_e_virtual_index() || {};
my $is_virtual = $juniper->_e_is_virtual(); my $is_virtual = $juniper->_e_is_virtual();
# Format into consistent integer format so that numeric sorting works # Format into consistent integer format so that numeric sorting works
my %e_index; my %e_index;
if ($is_virtual) { if ($is_virtual) {
foreach my $key ( keys %$virtuals ) { foreach my $key ( keys %$virtuals ) {
@@ -433,7 +433,7 @@ sub e_index {
foreach my $key ( keys %$contents ) { foreach my $key ( keys %$contents ) {
$e_index{$key} = join( '', map { sprintf "%02d", $_ } split /\./, $key ); $e_index{$key} = join( '', map { sprintf "%02d", $_ } split /\./, $key );
} }
return \%e_index; return \%e_index;
} }
@@ -687,14 +687,14 @@ Bill Fenner
=head1 SYNOPSIS =head1 SYNOPSIS
# Let SNMP::Info determine the correct subclass for you. # Let SNMP::Info determine the correct subclass for you.
my $juniper = new SNMP::Info( my $juniper = new SNMP::Info(
AutoSpecify => 1, AutoSpecify => 1,
Debug => 1, Debug => 1,
DestHost => 'myrouter', DestHost => 'myrouter',
Community => 'public', Community => 'public',
Version => 2 Version => 2
) )
or die "Can't connect to DestHost.\n"; or die "Can't connect to DestHost.\n";
my $class = $juniper->class(); my $class = $juniper->class();
@@ -812,7 +812,7 @@ to a hash.
=item $juniper->qb_fdb_index() =item $juniper->qb_fdb_index()
Returns reference to hash: key = FDB ID, value = VLAN ID. Returns reference to hash: key = FDB ID, value = VLAN ID.
=item $juniper->v_index() =item $juniper->v_index()
Returns (C<jnxL2aldVlanTag>) or (C<jnxExVlanTag>) depending upon switch Returns (C<jnxL2aldVlanTag>) or (C<jnxExVlanTag>) depending upon switch
@@ -859,7 +859,7 @@ For example, ge-0/0/1 registers as PowerEthernet interface '1.2'
=head2 Pseudo F<ENTITY-MIB> information =head2 Pseudo F<ENTITY-MIB> information
These methods emulate F<ENTITY-MIB> Physical Table methods using These methods emulate F<ENTITY-MIB> Physical Table methods using
F<JUNIPER-MIB> and F<JUNIPER-VIRTUALCHASSIS-MIB>. F<JUNIPER-MIB> and F<JUNIPER-VIRTUALCHASSIS-MIB>.
=over =over

View File

@@ -113,7 +113,7 @@ sub serial {
$serial = $1 if ( $descr =~ m/Lantronix EDS\w+ V[\d\.R]+ \((\w+)\)/ ); $serial = $1 if ( $descr =~ m/Lantronix EDS\w+ V[\d\.R]+ \((\w+)\)/ );
return $serial; return $serial;
} }
sub model { sub model {
my $device = shift; my $device = shift;
@@ -162,14 +162,14 @@ J R Binks
=head1 SYNOPSIS =head1 SYNOPSIS
# Let SNMP::Info determine the correct subclass for you. # Let SNMP::Info determine the correct subclass for you.
my $device = new SNMP::Info( my $device = new SNMP::Info(
AutoSpecify => 1, AutoSpecify => 1,
Debug => 1, Debug => 1,
DestHost => 'mydevice', DestHost => 'mydevice',
Community => 'public', Community => 'public',
Version => 2 Version => 2
) )
or die "Can't connect to DestHost.\n"; or die "Can't connect to DestHost.\n";
my $class = $device->class(); my $class = $device->class();

View File

@@ -104,14 +104,14 @@ begemot
=head1 SYNOPSIS =head1 SYNOPSIS
# Let SNMP::Info determine the correct subclass for you. # Let SNMP::Info determine the correct subclass for you.
my $router = new SNMP::Info( my $router = new SNMP::Info(
AutoSpecify => 1, AutoSpecify => 1,
Debug => 1, Debug => 1,
DestHost => 'myrouter', DestHost => 'myrouter',
Community => 'public', Community => 'public',
Version => 1 Version => 1
) )
or die "Can't connect to DestHost.\n"; or die "Can't connect to DestHost.\n";
my $class = $router->class(); my $class = $router->class();

View File

@@ -113,14 +113,14 @@ initial version based on SNMP::Info::Layer3::NetSNMP by Bradley Baetz and Bill F
=head1 SYNOPSIS =head1 SYNOPSIS
# Let SNMP::Info determine the correct subclass for you. # Let SNMP::Info determine the correct subclass for you.
my $mikrotik = new SNMP::Info( my $mikrotik = new SNMP::Info(
AutoSpecify => 1, AutoSpecify => 1,
Debug => 1, Debug => 1,
DestHost => 'myrouter', DestHost => 'myrouter',
Community => 'public', Community => 'public',
Version => 2 Version => 2
) )
or die "Can't connect to DestHost.\n"; or die "Can't connect to DestHost.\n";
my $class = $mikrotik->class(); my $class = $mikrotik->class();

View File

@@ -183,14 +183,14 @@ Eric Miller
=head1 SYNOPSIS =head1 SYNOPSIS
# Let SNMP::Info determine the correct subclass for you. # Let SNMP::Info determine the correct subclass for you.
my $n1600 = new SNMP::Info( my $n1600 = new SNMP::Info(
AutoSpecify => 1, AutoSpecify => 1,
Debug => 1, Debug => 1,
DestHost => 'myswitch', DestHost => 'myswitch',
Community => 'public', Community => 'public',
Version => 1 Version => 1
) )
or die "Can't connect to DestHost.\n"; or die "Can't connect to DestHost.\n";
my $class = $n1600->class(); my $class = $n1600->class();
@@ -200,10 +200,10 @@ Eric Miller
=head1 DESCRIPTION =head1 DESCRIPTION
Provides abstraction to the configuration information obtainable from an Provides abstraction to the configuration information obtainable from an
Avaya/Nortel N16XX device through SNMP. Avaya/Nortel N16XX device through SNMP.
For speed or debugging purposes you can call the subclass directly, but not For speed or debugging purposes you can call the subclass directly, but not
after determining a more specific class using the method above. after determining a more specific class using the method above.
my $n1600 = new SNMP::Info::Layer3::N1600(...); my $n1600 = new SNMP::Info::Layer3::N1600(...);
@@ -243,7 +243,7 @@ Return C<1>. Bulkwalk is currently turned off for this class.
=item $n1600->model() =item $n1600->model()
Returns model type. Checks $n1600->id() against the Returns model type. Checks $n1600->id() against the
F<RAPID-CITY-MIB> and then parses out C<rcA>. F<RAPID-CITY-MIB> and then parses out C<rcA>.
=item $n1600->vendor() =item $n1600->vendor()
@@ -300,11 +300,11 @@ SNMP::Info::SONMP.
=item $n1600->i_duplex() =item $n1600->i_duplex()
Returns reference to hash of interface operational link duplex status. Returns reference to hash of interface operational link duplex status.
=item $n1600->i_duplex_admin() =item $n1600->i_duplex_admin()
Returns reference to hash of interface administrative link duplex status. Returns reference to hash of interface administrative link duplex status.
=back =back

View File

@@ -277,7 +277,7 @@ sub i_up_admin {
my %i_up_admin; my %i_up_admin;
foreach my $iid ( keys %$ns_i_map ) { foreach my $iid ( keys %$ns_i_map ) {
$i_up_admin{$iid} $i_up_admin{$iid}
= $i_up->{$iid} eq "up" && "up" = $i_up->{$iid} eq "up" && "up"
|| $i_up_admin->{ $ns_i_map->{$iid} } || $i_up_admin->{ $ns_i_map->{$iid} }
|| 0; || 0;
@@ -324,7 +324,7 @@ sub i_speed {
my %i_speed; my %i_speed;
foreach my $iid ( keys %$ns_i_map ) { foreach my $iid ( keys %$ns_i_map ) {
$i_speed{$iid} $i_speed{$iid}
= $i_speed->{ $ns_i_map->{$iid} } = $i_speed->{ $ns_i_map->{$iid} }
|| $i_name->{$iid} =~ /tunnel/ && "vpn" || $i_name->{$iid} =~ /tunnel/ && "vpn"
|| 0; || 0;
@@ -527,7 +527,7 @@ Kent Hamilton
DestHost => 'myswitch', DestHost => 'myswitch',
Community => 'public', Community => 'public',
Version => 2 Version => 2
) )
or die "Can't connect to DestHost.\n"; or die "Can't connect to DestHost.\n";
@@ -536,11 +536,11 @@ Kent Hamilton
=head1 DESCRIPTION =head1 DESCRIPTION
Provides abstraction to the configuration information obtainable from a Provides abstraction to the configuration information obtainable from a
Juniper Netscreen devices through SNMP. Juniper Netscreen devices through SNMP.
For speed or debugging purposes you can call the subclass directly, but not For speed or debugging purposes you can call the subclass directly, but not
after determining a more specific class using the method above. after determining a more specific class using the method above.
my $netscreen = new SNMP::Info::Layer3::Netscreen(...); my $netscreen = new SNMP::Info::Layer3::Netscreen(...);
@@ -610,7 +610,7 @@ Returns serial number.
=item $netscreen->layers() =item $netscreen->layers()
Returns 01001110. Device doesn't report layers properly, modified to reflect Returns 01001110. Device doesn't report layers properly, modified to reflect
Layer 2 and 3 functionality. Layer 2 and 3 functionality.
=back =back
@@ -641,7 +641,7 @@ name.
Defaults to C<insIfDescr> if available, uses C<nsIfName> if not. Defaults to C<insIfDescr> if available, uses C<nsIfName> if not.
=item $netscreen->i_description() =item $netscreen->i_description()
Description of the interface. Uses C<insIfDescr> if available, C<nsIfName> Description of the interface. Uses C<insIfDescr> if available, C<nsIfName>
if not. if not.
@@ -658,12 +658,12 @@ Default SNMP IID to Interface index.
=item $netscreen->i_lastchange() =item $netscreen->i_lastchange()
The value of C<sysUpTime> when this port last changed states (up,down), The value of C<sysUpTime> when this port last changed states (up,down),
maps from C<ifIndex> to C<nsIfIndex>. maps from C<ifIndex> to C<nsIfIndex>.
(C<ifLastChange>) (C<ifLastChange>)
=item $netscreen->i_mac() =item $netscreen->i_mac()
MAC address of the interface. Note this is just the MAC of the port, not MAC address of the interface. Note this is just the MAC of the port, not
anything connected to it. Uses C<nsIfMAC> if available, C<ifPhysAddress> anything connected to it. Uses C<nsIfMAC> if available, C<ifPhysAddress>
@@ -691,7 +691,7 @@ Interface type. Maps from C<ifIndex> to C<nsIfIndex>.
(C<ifType>) (C<ifType>)
=item $netscreen->i_up() =item $netscreen->i_up()
Link Status of the interface. Typical values are 'up' and 'down'. Link Status of the interface. Typical values are 'up' and 'down'.
@@ -732,7 +732,7 @@ Gives netmask setting for IP table entry.
Uses C<nsIpArpTable> to emulate the forwarding table. Uses C<nsIpArpTable> to emulate the forwarding table.
=over =over
=item $netscreen->fw_index() =item $netscreen->fw_index()
@@ -760,21 +760,21 @@ identifier (IID).
=item $netscreen->at_index() =item $netscreen->at_index()
Returns reference to hash. Maps ARP table entries to Interface IIDs Returns reference to hash. Maps ARP table entries to Interface IIDs
If the device doesn't support C<ipNetToMediaIfIndex>, this will try If the device doesn't support C<ipNetToMediaIfIndex>, this will try
the proprietary C<nsIpArpIfIdx>. the proprietary C<nsIpArpIfIdx>.
=item $netscreen->at_paddr() =item $netscreen->at_paddr()
Returns reference to hash. Maps ARP table entries to MAC addresses. Returns reference to hash. Maps ARP table entries to MAC addresses.
If the device doesn't support C<ipNetToMediaPhysAddress>, this will try If the device doesn't support C<ipNetToMediaPhysAddress>, this will try
the proprietary C<nsIpArpMac>. the proprietary C<nsIpArpMac>.
=item $netscreen->at_netaddr() =item $netscreen->at_netaddr()
Returns reference to hash. Maps ARP table entries to IP addresses. Returns reference to hash. Maps ARP table entries to IP addresses.
If the device doesn't support C<ipNetToMediaNetAddress>, this will try If the device doesn't support C<ipNetToMediaNetAddress>, this will try
the proprietary C<nsIpArpIp>. the proprietary C<nsIpArpIp>.
@@ -783,7 +783,7 @@ the proprietary C<nsIpArpIp>.
=head3 Wireless Information =head3 Wireless Information
=over =over
=item $dot11->i_ssidlist() =item $dot11->i_ssidlist()