Re: Problem with mib2c.iterate.conf

"Sridhar Addagada" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
I ran into few problems when compiling my mib using
mib2c.iterate.conf.  Mentioned below is the sample of the table.

1.  The data structure that got generated  "sensorTable_entry" had
problem.  The sensorIndex was repeted twice.
struct sensorTable_entry {
    /* Index values */
    long            sensorIndex;

    /* Column values */
    long            sensorIndex;
    long            sensorSdrVersion;
    .....
....
}

2.  bad function definition sensorTable_createEntry(long sensorIndex,)
as you can see the function prototype has a problem.

3. after fixing the above two and populating the table using a dummy
function inviked in initialize_table_sensorTable, I had a crash when i
performed snmpwalk.  Attached is the backtrace from the crash.

Hope someone can take a look and give me pointer to fix this, the
crash problem but the problem with mib2c.iterate.conf, a perl expert
need to take a look.

Thanks,
Sridhar

-------------------------------- MIB-EXTRACT
---------------------------------------------

SensorEntry ::= SEQUENCE {
    sensorIndex                             INTEGER,        -- 01
    sensorSdrVersion                        INTEGER,        -- 02
    sensorRecordType                        INTEGER,        -- 03
    sensorOwnerId                           INTEGER,        -- 04
    sensorOwnerLun                          INTEGER,        -- 05
    sensorNumber                            INTEGER,        -- 06
    sensorEntityId                          INTEGER,        -- 07
    sensorEntityInstance                    INTEGER,        -- 08
    sensorInitialization                    INTEGER,        -- 09
    sensorCapabilities                      INTEGER,        -- 10
    sensorType                              INTEGER,        -- 11
    sensorEvent                             INTEGER,        -- 12
    sensorAssertionEventMask                INTEGER,        -- 13
    sensorDeassertionEventMask              INTEGER,        -- 14
    sensorMask                              INTEGER,        -- 15
    sensorUnits                             INTEGER,        -- 16
    sensorBaseUnit                          INTEGER,        -- 17
    sensorModifierUnit                      INTEGER,        -- 18
    sensorLinearization                     INTEGER,        -- 19
    sensorM                                 INTEGER,        -- 20
    sensorTolerance                         INTEGER,        -- 21
    sensorB                                 INTEGER,        -- 22
    sensorAccuracy                          INTEGER,        -- 23
    sensorAccuracyExp                       INTEGER,        -- 24
    sensorRExp                              INTEGER,        -- 25
    sensorBExp                              INTEGER,        -- 26
    sensorCharacteristicFlags               INTEGER,        -- 27
    sensorNominalReading                    INTEGER,        -- 28
    sensorNormalMaximum                     INTEGER,        -- 29
    sensorNormalMinimum                     INTEGER,        -- 30
    sensorMaximumReading                    INTEGER,        -- 31
    sensorMinimumReading                    INTEGER,        -- 32
    sensorUpperNonRecoverableThreshold      INTEGER,        -- 33
    sensorUpperCriticalThreshold            INTEGER,        -- 34
    sensorUpperNonCriticalThreshold         INTEGER,        -- 35
    sensorLowerNonRecoverableThreshold      INTEGER,        -- 36
    sensorLowerCriticalThreshold            INTEGER,        -- 37
    sensorLowerNonCriticalThreshold         INTEGER,        -- 38
    sensorPositiveGoingThresholdHysteresis  INTEGER,        -- 39
    sensorNegativeGoingThresholdHysteresis  INTEGER,        -- 40
    sensorOem                               INTEGER,        -- 41
    sensorIdStringType                      INTEGER,        -- 42
    sensorIdString                          DisplayString,  -- 43
}

Thanks
Sridhar
gdb.txt (text/plain, 2.1 KB)
#1  0x08071f45 in build_oid_segment (var=0x9fd0108) at mib.c:3516
#2  0x08071fa1 in build_oid_noalloc (in=0xbfec3020, in_len=128,
    out_len=0xbfec301c, prefix=0xbfec32d4, prefix_len=73, indexes=0x9fd0108)
    at mib.c:3575
#3  0x08069bf7 in netsnmp_check_getnext_reply (request=0x49,
    prefix=0xbfec32a0, prefix_len=13, newvar=0x9fd0108, outvar=0xa004898)
    at table.c:893
#4  0x08066786 in netsnmp_table_iterator_helper_handler (handler=0x9fd0598,
    reginfo=0x9fd02e8, reqinfo=0x9fd7328, requests=0x9fec378)
    at table_iterator.c:541
#5  0x0806048a in netsnmp_call_handler (next_handler=0x9fd0598,
    reginfo=0x9fd02e8, reqinfo=0x9fd7328, requests=0x9fec378)
    at agent_handler.c:423
#6  0x08068424 in table_helper_handler (handler=0x9fd05d0, reginfo=0x9fd02e8,
    reqinfo=0x9fd7328, requests=0x9fec378) at table.c:622
#7  0x0806048a in netsnmp_call_handler (next_handler=0x9fd05d0,
    reginfo=0x9fd02e8, reqinfo=0x9fd7328, requests=0x9fec378)
    at agent_handler.c:423
#8  0x08060769 in netsnmp_call_handlers (reginfo=0x9fd02e8, reqinfo=0x9fd7328,
    requests=0x9fec378) at agent_handler.c:504
#9  0x08058c8e in handle_var_requests (asp=0x9fea358) at snmp_agent.c:2423
#10 0x080593e7 in handle_getnext_loop (asp=0x9fea358) at snmp_agent.c:2844
#11 0x08059bb2 in handle_pdu (asp=0x9fea358) at snmp_agent.c:3213
#12 0x0805981b in netsnmp_handle_request (asp=0x9fea358, status=49)
    at snmp_agent.c:2996
#13 0x08057c8b in handle_snmp_packet (op=1, session=0x85e764,
    reqid=1387617724, pdu=0x9fea358, magic=0x49) at snmp_agent.c:1821
#14 0x0808a144 in _sess_process_packet (sessp=0x9fea3a8, sp=0x9ff2838,
    isp=0x9fe15d8, transport=0x9fea2b0, opaque=0x9febf80, olength=16,
    packetptr=0x9ff3fc8 "0/\002\001", length=49) at snmp_api.c:5276
#15 0x0808acb8 in _sess_read (sessp=0x9fea3a8, fdset=0x9ff3fc8)
    at snmp_api.c:5675
#16 0x0808b187 in snmp_sess_read (sessp=0x9fea3a8, fdset=0xbfec3890)
    at snmp_api.c:5694
#17 0x0808a49a in snmp_read (fdset=0xbfec3890) at snmp_api.c:5328
#18 0x0804bc15 in receive () at snmpd.c:1168
#19 0x0804b356 in main (argc=5, argv=0xbfec4aa4) at snmpd.c:1004
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.