my $interfaces = Net::SNMP::Interfaces->new( Hostname => '192.168.184.11',
Community => 'public',
Port => '1161',
#RaiseError => 1,
)or die $Net::SNMP::Interfaces::error;
my @ifnames = $interfaces->all_interfaces();
print Dumper (\@ifnames);
####
No response from remote host "127.0.0.1" at test.pl line 10
##
##
my $interfaces = Net::SNMP::Interfaces->new( Hostname => '127.0.0.1',
Community => 'public',
Port => '1161',
RaiseError => 1,
);
my @ifnames = $interfaces->all_interfaces();
##
##
Net::SNMP::Interfaces: at test.pl line 10.
##
##
22:19:01.537280 IP 0.0.0.0 > 0.0.0.0: ICMP 0.0.0.0 udp port 1161 unreachable, length 36
##
##
my $interfaces = Net::SNMP::Interfaces->new( Hostname => '192.168.184.11',
Community => 'public',
Port => '1161',
);
my @ifnames = $interfaces->all_interfaces();
print Dumper (\@ifnames);
##
##
Can't call method "all_interfaces" on an undefined value at test.pl line 12.