# Let SNMP::Info determine the correct subclass for you. my
$device = SNMP::Info->(
AutoSpecify => 1,
Debug => 1,
DestHost => 'myswitch',
Community => 'public',
Version => 2 ) or die "Can't connect to DestHost.\n";
my $remoteas_for_index =
$device->cisco_bgp_peer2_remoteas;
for my $index (keys
$remoteas_for_index->%*) {
my ($type, $addrlength, $ip)
=
$device->parse_cisco_bgp_peer2_entry_index($index);
printf('remote: %-39s type: %-4s remote AS: %5d',
$ip, $type,
$remoteas_for_index->{$index}); }