Re: Understanding snmpwalk
Leo Lin <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Dave, This is part of my MIB output using snmptranslate MyTables |-------- Table1 |-------- Table1Entry | |------- Index: RowIndex | | | |---------------- Iteger32 RowIndex | |------ CR String AlarmDateTime | |------ CR String AlarmType | |------ CR String AlarmDescription Table2 |-------- Table2Entry |-------- Index: RowIndex | |---------------- Integer32 RowIndex |------ RW String IPAddress |------ RW Integer32 PortNumber |------ RW Integer32 Enabled I have 3 modules; agent.c agent.h table.c table.h conf.c conf.h agent.c implements all the scalars oid on my mib, also, it implements the Table1 handler using net-snmp helper handler. The initialization is called initialize_alarm_helper(); table.c contains my custom handlers for Table1. If I include this module, I disable the net-snmp helper handler above (initialize_alarm_helper()); conf.c contains my custom handlers for Table2. Table1 has 2 rows, RowIndex=1 to 2 Table2 has 4 rows, RowIndex=0 ~ 3 With snmpd compiled with agent, table, conf modules (no net-snmp helper handler) snmpwalk –v1 –cprivate localhost IPAddress // works OK snmpwalk –v1 –cprivate localhost PortNumber // works OK snmpwalk –v1 –cprivate localhost Enabled // works OK snmpwalk –v1 –cprivate localhost AlarmDateTime // works OK snmpwalk –v1 –cprivate localhost AlarmType // works OK snmpwalk –v1 –cprivate localhost AlarmDescription // hangs @ AlarmDescription.2 I used snmpd –Dagent, table, conf –d And snmpd.log reveals that snmpwalk-v1 –cprivate localhost AlarmDescription issue getnext and conf.c MODE_GET handler is called. So you are right, the problem is in Table2. I removed table.c module, and compile snmpd with agent.c (using net-snmp helper handler) and conf.c. and I get the same results. I further remove conf.c module and compile only with snmpd with agent.c (using net-snmp helper handler) only. The problem is gone, snmpd does not hangs on AlarmDescription.2 This is what I got with snmpd (--with-mib-modules=”agent”) when invoking snmpgetnext snmpgetnext –v1 –cprivate localhost AlarmDescription.2 UCD-SNMP-MIB::memIndex.0 = INTEGER: 0 Of course, this is with the net-snmp helper, I will try with my own module (snmpd –agent.c table.c) and see if there’s any errors. Leo; --- On Tue, 10/19/10, Dave Shield <[email protected]> wrote: From: Dave Shield <[email protected]> Subject: Re: Understanding snmpwalk To: "Leo Lin" <[email protected]> Cc: "Net-snmp-users" <[email protected]> Date: Tuesday, October 19, 2010, 5:29 AM On 19 October 2010 13:20, Leo Lin <[email protected]> wrote: > Actually I have 2 tables, and on both it behaves differently. What are the root OIDs of each table? What other objects are defined between the two? > On both tables, if I perform snmpgetnext, it works fine. That's a bit vague. What OIDs are you running "snmpgetnext" on? Remember, I suggested you ran snmpgetnext on the *last* instance of the table. I.e. the final value returned by snmpwalk before it hangs. > I'm going to try to revert table 1 using the netsnmp helper handler > instead, to check if this happens with the helper as well. My suspicion is actually with table2, not table1. But you haven't given enough detail to confirm this. Dave ------------------------------------------------------------------------------ Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev _______________________________________________ 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