Net::SNMP::Mixin::ArubaCX::VlanStatic - mixin class for ArubaCX static vlan info
use Net::SNMP; use Net::SNMP::Mixin qw/mixer init_mixins/; my $session = Net::SNMP->session( -hostname => 'foo.bar.com'); $session->mixer('Net::SNMP::Mixin::ArubaCX::VlanStatic'); $session->init_mixins; snmp_dispatcher() if $session->nonblocking; $session->init_ok(); die $session->errors if $session->errors; my $vlan_id2name = $session->map_vlan_id2name(); foreach my $vlan_id ( keys %{$vlan_id2name} ) { printf "Vlan-Id: %4d => Vlan-Name: %s\n", $vlan_id, $vlan_id2name->{$vlan_id}; } my $vlan_ids2if_idx = $session->map_vlan_id2if_idx(); foreach my $id ( keys %{$vlan_ids2if_idx} ) { printf "Vlan-Id: %4d\n", $id; printf "\tTagged-Ports: %s\n", ( join ',', @{ $vlan_ids2if_idx->{$id}{tagged} } ); printf "\tUntagged-Ports: %s\n", ( join ',', @{ $vlan_ids2if_idx->{$id}{untagged} } ); } # sorted by interface my $ports2ids = $session->map_if_idx2vlan_id(); foreach my $if_idx ( keys %{$ports2ids} ) { printf "Interface: %10d\n", $if_idx; printf "\tTagged-Vlans: %s\n", ( join ',', @{ $ports2ids->{$if_idx}{tagged} } ); printf "\tUntagged-Vlans: %s\n", ( join ',', @{ $ports2ids->{$if_idx}{untagged} } ); }
A mixin class for vlan related infos from the IEEE8021-Q-BRIDGE-MIB used by ArubaCX.
The mixin-module provides methods for mapping between vlan-ids and vlan-names und relations between interface indexes and vlan-ids, tagged or untagged on these interfaces.
Returns a hash reference with statically configured vlan-ids as keys and the corresponing vlan-names as values:
{ vlan_id => vlan_name, vlan_id => vlan_name, ... , }
Returns a hash reference with the vlan-ids as keys and tagged and untagged if_idx as values:
{ vlan_id => { tagged => [if_idx, ..., ], untagged => [if_idx, ..., ], }, ... , }
Returns a hash reference with the interfaces as keys and tagged and untagged vlan-ids as values:
{ if_idx => { tagged => [vlan_id, ..., ], untagged => [vlan_id, ..., ], }, ... , }
Fetch basic Dot1Q Vlan related snmp values from the host. Don't call this method direct!
Only for developers or maintainers.
Fetch the mapping between brigePort and ifIndex
The callback for _fetch_dot1d_base_ports.
Fetch the vlan tag info for current vlans.
The callback for _fetch_ieee8021q_vlan_static_tbl_entries_cb.
Fetch the pvid (untag) info for bridge ports.
The callback for _fetch_ieee8021q_port_vlan_tbl_entries.
Net::SNMP, Net::SNMP::Mixin
Johannes Deger <johannes.deger at uni-ulm.de> Karl Gaissmaier <karl.gaissmaier at uni-ulm.de>
Copyright 2021 Karl Gaissmaier, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Net::SNMP::Mixin::ArubaCX::VlanStatic, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::SNMP::Mixin::ArubaCX::VlanStatic
CPAN shell
perl -MCPAN -e shell install Net::SNMP::Mixin::ArubaCX::VlanStatic
For more information on module installation, please visit the detailed CPAN module installation guide.