Re: I've met some troubles really headachy,pls help me!

"Dave Shield" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On 30/01/07, 洲 金 <[email protected]> wrote:
>     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).

How do you know that the incoming request is running over IP?
What should this object return if the request is being run over
IPX, or IPv6, or via AgentX, or via an internal callback?


>Then, I use the parameters
> "requests->agent_req_info->asp->session->peername"

No - the session structure probably won't have this information
available.   You'd need to look at the PDU structure instead.

Look at  requests->agent_req_info->asp->pdu->transport_data

Note that the interpretation of this data will depend on the transport
layer used for that request, and the version of the code that you are
working with,
   If you are *sure* that this is an IPv4 request, then see
snmplib/snmpUDPDomain.c for the format of 'transport_data'
(aka "opaque").

  But note that this can change between releases (and has done so!)



> 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.

Then it's broken, and needs to be fixed.

>                                                                        So the manager  parse
> trap2 pdu in this simpler format.It can't parse standard trap2 pdu sent by
> net-snmp API.

Then it's broken and needs to be fixed.

> Can net-snmp send or parse trap2 messages in this simpler format?

No.
There is no such thing as a "simpler SNMPv2 trap format".
There is the standard "SNMPv2 trap format", and there is
"not SNMPv2 trap format".
   The Net-SNMP suite implements SNMP - and assumes that
what it is working with is valid SNMP.   If it receives an invalid
packet, this will be discarded.

That's what Internet standards are all about.



> 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?

You may need to run "ldconfig" after installing the software, so that the
linker knows where to find the new libraries.


> 4.About table variable's implement
>     I use the module mib2c.iterate.conf to build C files for the table...
>     But when using a array to store these
> datas,it will automatically add an empty row to the beginning when
> requested.

You should look carefully at how you are initialising the index and
context variables in the 'get_first' hook routine.   Make sure that
these refer to the first (valid) entry in your array.

Dave

-------------------------------------------------------------------------
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.