Thanks, Brian.  However, I think the doco you were refering to was SNMP and not 
Net::SNMP.  Two diffrent modules.  SNMP requires the, formerly ucd-snmp, 
software on your *nix box, then interfaces to that.  Net::SNMP does not require 
ucd-snmp.

Mitch

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Brian
Raven
Sent: Friday, August 18, 2006 10:04 AM
To: [email protected]
Subject: RE: :SNMP and asynchronous callbacks


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Raful
Mr Mitchell H
Sent: 18 August 2006 14:33
To: [email protected]
Subject: Net::SNMP and asynchronous callbacks

> I have been working for years with Net::SNMP, not to be confused with
use SNMP of UCD-SNMP fame.  As my bosses > and colleagues reqest more
information via my perl scripts they get slower and slower.  Wait for
the response 
> from one OID from the CDP mib, grab the unique dots and grab the
specific info. For example 
> 1.3.6.1.4.1.9.9.23.1.2.1.1.4.x.x will be the OID for an address of a
cdp neighbor, grab the x.x and concatenate > to
1.3.6.1.4.1.9.9.23.1.2.1.1.6 and get the name as it appears in the cdp
cache of the same device.  Obviously > all the get and get_next requests
move slowly, especially to overseas remote sites.  Therefore, I tried
using 
> Net::SNMP asynchronously with callbacks.  Is is it my imagination, or,
because of the asynchronous nature do I > get things returned out of
order?  That is, if I have an array of ip addresses that are placed into

> asynchronous calls, it seems that the script just keeps executing the
callback regardless.  Therefore, if I 
> perform a request on a switch or router in Japan well before one on
the east coast, it appears that I am 
> parsing the snmp session results of the east coast come back first so
I can't track what is where.  Am I doing > something wrong, or is this
the just the asynchronous nature of the beast.

First I know little about Net::SNMP (or indeed SNMP). 

However, if you are making asynchronous (i.e. non-blocking) resuests,
you cannot expect the responses to be in the same order as the requests.
If you are using the same callback function to process all responses,
then you need to provide it with a parameter that identifies the request
that it is a response to. I have just had a look at the doco and it
describes how to do this, but essentially, instead of -callback =>
sub{..}, or -callback => \&sub, you have -callback => [\&sub,
$request_id]. This is pretty much a standard way of specifying callbacks
in Perl.

The above assumes that I have understood your question.

HTH

-- 
Brian Raven 


=================================
Atos Euronext Market Solutions Disclaimer
=================================
The information contained in this e-mail is confidential and solely for the 
intended addressee(s). Unauthorised reproduction, disclosure, modification, 
and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediately 
and delete it from your system. The views expressed in this message do not 
necessarily reflect those of Atos Euronext Market Solutions.

L'information contenue dans cet e-mail est confidentielle et uniquement 
destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. 
Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail 
vous parvient par erreur, nous vous prions de bien vouloir prevenir 
l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre 
systeme. Le contenu de ce message electronique ne represente pas necessairement 
la position ou le point de vue d'Atos Euronext Market Solutions.

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to