XP is just a number | |
PerlMonks |
Re: Making a scalable Net::SNMP script?by dingus (Friar) |
on Nov 21, 2002 at 18:44 UTC ( [id://214862]=note: print w/replies, xml ) | Need Help?? |
You could use either an array or (probably better) a hash something like this:
and then indeed you can do a If you need them ordered you can EITHER have the order in a separate array or have 2 arrays one for command and one for the OID. Assuming you need to do this sort of thing for many devices and you wish to do it in a reasonable timeframe you may want to look at POE as that should nicely cope with multiple parallel SNMP requests an responses. I seem to recall from days querying SNMP devices that responses are often in the seconds (or worse if you have to retry), which means that if you need to do 100 queries on 100 differnt devices in a strict sequence you get a script that runs for 3 hours instead of under two minutes! POE should let you parallelise nicely - indeed the POE cookbook may actually have sample code for this thing. Dingus Enter any 47-digit prime number to continue.
In Section
Seekers of Perl Wisdom
|
|