I've met some troubles really headachy,pls help me!
洲 金 <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Dear sir:
I am redeveloping a SNMP agent using net-snmp 5.2.3 package under linux.After nearly 2 moth's using ,I've met several problems i can't resolve which will be listed below.I will really appreciate your help.
1.About scalar variable's handler function
I have a scalar variable in my mib.When it is being GET,it will return the source ip of this GET request(the soruce ip of the UDP packet).Then, I use the parameters "requests->agent_req_info->asp->session->peername" or "reqinfo->asp->session->peername" of the handler function:
handle_peername(netsnmp_mib_handler *handler,
netsnmp_handler_registration *reginfo,
netsnmp_agent_request_info *reqinfo,
netsnmp_request_info *requests)
to get it,but failed.It just returns null string.It seems like that these parameters did not get the value I want and just had their system-initial values.
So,how can i get the ip of the requesting pc?
2.About SNMPV2 trap
My old agent was developed under vxwoks.It send trap2 messages,but don't contain the varbind: sysTimeUp.0 and sysTrapOid.0. So the manager parse trap2 pdu in this simpler format.It can't parse standard trap2 pdu sent by net-snmp API.Can net-snmp send or parse trap2 messages in this simpler format?
3.About general net-snmp apps' executing
I've downloaded all the source files of NET-SNMP-TUTORAIL 5,including the makefile.When making,it succeed.But when executing,1 error occurs:"error while loading shared libraries: libnetsnmp.so.9: cannot open shared object file: No such file or directory".However,the file libnetsnmp.so.9 does exist in the directroy /usr/local/lib.WHY?
4.About table variable's implement
I use the module mib2c.iterate.conf to build C files for the table variable, and modify the codes according to agent/mibgroup/mibII/udptable.c. When using a linked list to store table datas,it is all right.But when using a array to store these datas,it will automatically add an empty row to the beginning when requested.If using snmptable to get the table datas,i will see an empty row with system-initialized values,then there are my correct datas,while the array datas is correct.WHY?
These questions really have puzzled me for a long time.Thank you very much for your help or other useful suggestions!
Best reagards,
zhou
---------------------------------
抢注雅虎免费邮箱-3.5G容量,20M附件!
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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