I have used perl SNMP module in the past, but you may find things easier if you use the NET-SNMP utilities (formerly UCD-SNMP). These are available for most platforms from
If you backtick the command
`snmptable -Cf '|' -p 161 network_device public ip.ipNetToMediaTable`
You get an easily parsable result as below
SNMP table: ip.ipNetToMediaTable
ipNetToMediaIfIndex|ipNetToMediaPhysAddress|ipNetToMediaNetAddress|ipNetToMediaType
16777220|0:0:c:12:34:56|192.168.0.1|dynamic
---------------------------------------
I'm just trying to help, and am not a spokesman for my employer
Ive just posted a question about some issues on walking arp tables. The code is working, but mac addresses are shown with strange values.
C ya
Rafael Gustavo Gassner
#! /usr/bin/perl -w
use SNMP_util;
#use SNMP_Session;
#use BER;
$ip="10.10.10.10";
$comm="public";
$poort="161";
$timeout="100";
$retries="2";
print "Coletando indices do equipamento $ip\n";
@indice=&snmpwalk("$comm\@$ip:$poort:$timeout:$retries","1.3.6.1.2.1.4.22.1.1"
print "Coletando enderecos MAC do equipamento $ip\n";
@fisico=&snmpwalk("$comm\@$ip:$poort:$timeout:$retries","1.3.6.1.2.1.4.22.1.2"
print "Coletando enderecos IP do equipamento $ip\n";
@rede=&snmpwalk("$comm\@$ip:$poort:$timeout:$retries","1.3.6.1.2.1.4.22.1.3"
print "Coletando tipos de endereco do equipamento $ip\n";
@tipo=&snmpwalk("$comm\@$ip:$poort:$timeout:$retries","1.3.6.1.2.1.4.22.1.4"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.