Re: Problem to determinate SNMP version
Wes Hardaker <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Organization | Sparta |
| Message-ID | <[email protected]> |
>>>>> On Tue, 25 Apr 2006 16:51:45 +0200, [email protected] said: mickb> Here's the problem : as there is no specific SNMP query mickb> returning supported version(s), I have the idea to use the mickb> behavior of the SNMP::Session constructor which returns an mickb> object reference if connection successful or undef in case of mickb> error. Unfortunately, it doesn't work in the expected way. I mickb> have made a test on an old switch supporting only SNMP v1. When mickb> I query it with v3, OK : SNMP::Session->new returns mickb> "undef". But when I query it with v2c, how surprising : mickb> SNMP::Session->new returns me a descriptor... :( It's actually fairly easy to determine if something supports SNMPv3 (and has engineID probing turned on). However, it's impossible to tell if something supports SNMPv1 without simply trying it. Thus, we return a session object if v1/v2c are in use but not for v3 if it couldn't at least talk to the agent (this may change in the future so we always return on). The only way to know for sure is to create the session and try to query a object that you know exists on all the machines (sysUpTime.0 is a good choice). mickb> This situation is quite annoying for me. Is this a bug ? Or, if mickb> anyone has a suggestion for a more reliable solution to obtain mickb> version, please tell me. It's a design decision of the protocol; nothing we can do to fix it (aside from adding a local "test the session" api which would functionally do what I described above). -- Wes Hardaker Sparta, Inc. ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Net-snmp-users mailing list [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users