in reply to Parsing SNMP output
Of course, if you want to output it like who, an array of hashes would be more convenient. The code for that would be something like
Giving you an array of hashes quite suitable for simple printing a-la who.use SNMP::MIB::Compiler; my $mib = new SNMP::MIB::Compiler; while (my ($oid,$type,$val)=read_snmp) { $oid=s/\.(\d+)$//; $index=$1; $arr[$index]{$mib->convert_oid($oid)}=$val; }
|
|---|