On 1 August 2012 07:23, Madhu Sudhana Rao <[email protected]> wrote:
> I think table is registering correctly, as I am getting snmpget output looks
> correct

Yes - that sounds reasonable.


>   only problem is with snmpwalk and getnext

I see from your code that you are using the iterator helper.
This is designed to walk through the list of rows (using
your 'get_first/get_next' hook routines), identify the appropriate
row of the table for a GetNext request, and turn this into the
equivalent Get request before passing it on to the MIB handler.

So your myifTable_handler() will only ever see GET requests.


I presume if you issue a "snmpget" request for an entry in this
table, then you will see assorted "in mode-get" debug statements
printed by the agent.   Are you seeing these?

What happens if you issue a single "snmpgetnext" request for
the same MIB object?   Do you see any "in mode-get" output or not?

What about the 'get_first' debug statement?
Try running the agent using '-Dtemp':
   Do you see the 'if table get first' message with an "snmpget" request?
   Do you see it with an "snmpgetnext" request?




> I tried snmpwalk on nsModuleTable but I endup getting "no such object for
> this OID" even though I added agent_mibs.h for --with-mib-modules option.

You shouldn't need to give any additional options to configure.
nsModuleTable is part of the standard build.   So it's a little worrying
that you don't see it.


> I gave few more details in the attachment please check and give your
> suggestions/comments.

First thing - your MIB file looks broken.
>From a quick glance:

  - The name of the MIB must start with a capital letter
    (MY-MIB, rather than my-MIB)

  - The IMPORTS statement is incomplete.
    There's a whole load of names (trapIdentifier, etc)
    which are listed, but without the name of a MIB that
    they are imported from.

  - The module is rooted at 'my', but this is never defined or imported
    (I'm actually very surprised you were able to run "mib2c" at all!)

  - The SEQUENCE definition of the structure of a row of the table
     must start with a capital letter
        (MyifEntry, not myifEntry)

  - myifTableIndex is defined as 'not-accessible' (which is correct)
    but the code that registers the table has
       table->min_column = 1
            i.e. implies that myifTableIndex *is* accessible
            (again, this indicates a mis-match between this MIB,
             and whatever was passed to 'mib2c'

I *strongly* suggest that you run any MIB you are developing through
the smilint validation tool (or something similar) before trying to do
anything with it.   That will pick up these errors - and probably many
many more.



Dave

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to