Dear All,
I'm trying to add a private/dummy mib into netsnmp agent under interfaces group as
+--interfaces(2)
|
+-- -R-- Integer32 ifNumber(1)
|
+-- -R-- Integer32 ifKMNumber(3)
Steps followed :
1. Integrate ifKMNumber mib in IF-MIB.txt file.
2. mib2c -c mib2c.scalar.conf -f ifKMNumber .1.3.6.1.2.1.2.3
3. Modify ifKMNumber.c i.e in handle_ifKMNumber under switch case MODE_GET calling the function snmp_set_var_typed_value with suitable dataptr & len.
4. ./configure --with-mib-modules="ifKMNumber"
5. make ; make install
Problem : I'm unable to retrieve the value using snmpget. (snmptranslate shows my mib at this OID)
$snmpget -v2c -c public IPaddress .1.3.6.1.2.1.2.3.0
When tracing the code in /var/log/snmpd.log, I found the following lines :
2005-03-07 15:19:35 trace: netsnmp_add_varbind_to_cache(): snmp_agent.c, 1474
2005-03-07 15:19:35 snmp_agent: add_vb_to_cache(0x8103c20, 1, IF-MIB::interfaces.3.0, 0x806f930)
2005-03-07 15:19:35 trace: netsnmp_add_varbind_to_cache(): snmp_agent.c, 1504
2005-03-07 15:19:35 snmp_agent: tp->start IF-MIB::ifEntry.23, tp->end RFC1213-MIB::atIfIndex,
2005-03-07 15:19:35 trace: netsnmp_call_handlers(): agent_handler.c, 282
2005-03-07 15:19:35 handler:calling: calling main handler bulk_to_next
2005-03-07 15:19:35 trace: netsnmp_call_handler(): agent_handler.c, 322
2005-03-07 15:19:35 handler:calling: calling handler null
2005-03-07 15:19:35 trace: netsnmp_null_handler(): null.c, 37
2005-03-07 15:19:35 helper:null: Got request
2005-03-07 15:19:35 trace: netsnmp_null_handler(): null.c, 39
2005-03-07 15:19:35 helper:null: oid:IF-MIB::interfaces.3.0
2005-03-07 15:19:35 trace: netsnmp_call_handler(): agent_handler.c, 327
2005-03-07 15:19:35 handler:returned: handler null returned 0
2005-03-07 15:19:35 trace: netsnmp_handle_request(): snmp_agent.c, 2530
2005-03-07 15:19:35 results: request results (status = 0):
2005-03-07 15:19:35 trace: netsnmp_handle_request(): snmp_agent.c, 2533
2005-03-07 15:19:35 results: IF-MIB::interfaces.3.0 = No Such Object available on this agent at this OID
Can anybody give me a solution in detail.
Thanx in Advance
KM
- not invoking handler Krishna Mohan
- Re: not invoking handler Grasic Igor
