I added additional debugging to 'agent_registry.c' file and recompiled.
During unregistering the MIB, the agent complaints about not finding the
child and returns MIB_NO_SUCH_REGISTRATION.

My subagents registers MIB using default context ("") and default priority.
Any idea why the registering succeeds but not unregistering MIB? I
appreciate your insights and pointers.

1695     while(unregistering){
1696         DEBUGMSGTL(("register_mib", "unregistering "));
1697         DEBUGMSGOIDRANGE(("register_mib", name, len, range_subid,
range_ubound));
1698         DEBUGMSG(("register_mib", "\n"));
1699
1700         list = netsnmp_subtree_find(name, len,
netsnmp_subtree_find_first(context),
1701                     context);
1702         if (list == NULL) {
1703             DEBUGMSGTL(("register_mib", "pal:failed to find subtree"));
1704             return MIB_NO_SUCH_REGISTRATION;
1705         }
1706
1707         for (child = list, prev = NULL; child != NULL;
1708             prev = child, child = child->children) {
1709             if (netsnmp_oid_equals(child->name_a, child->namelen,
name, len) == 0 &&
1710                 child->priority == priority) {
1711                 break;              /* found it */
1712              }
1713         }
1714
1715         if (child == NULL) {
1716             DEBUGMSGTL(("register_mib", "pal:failed null child"));
<<<<<<<<<<<< Returns from here
1717             return MIB_NO_SUCH_REGISTRATION;
1718         }



On Thu, Mar 7, 2013 at 1:22 AM, Pal Saint <pals...@gmail.com> wrote:

> All,
>
> We use REGISTER_MIB() to register our MIB tables, and use unregister_mib()
> for unregistering them. However, when SIGHUP is sent to snmpd, it fails to
> unregister the MIB variables. It fails with "MIB_NO_SUCH_REGISTRATION".
> Registering and unregistering code  is actually created by mib2c.old_api
> code generation configuration. Let me know if you need more information.
>
> Here is snmpd debug info...
>
> dlmod: dlmod_create_module
> dlmod: dlmod_load_module exampleTable: /usr/lib/snmp/dlmod/exampleTable.so
> ................. Registering exampleTable
> register_mib: registering "exampleTable" at
> SNMPv2-SMI::enterprises.8075.1.3.2.1.1 with context ""
> register_mib: registering "exampleTable" at
> SNMPv2-SMI::enterprises.8075.1.3.2.1.2 with context ""
> register_mib: registering "exampleTable" at
> SNMPv2-SMI::enterprises.8075.1.3.2.1.3 with context ""
> register_mib: registering "exampleTable" at
> SNMPv2-SMI::enterprises.8075.1.3.2.1.4 with context ""
> register_mib: registering "exampleTable" at
> SNMPv2-SMI::enterprises.8075.1.3.2.1.5 with context ""
> register_mib: registering "exampleTable" at
> SNMPv2-SMI::enterprises.8075.1.3.2.1.6 with context ""
> register_mib: registering "exampleTable" at
> SNMPv2-SMI::enterprises.8075.1.3.2.1.7 with context ""
>
> ...
> dlmod: Calling deinit_exampleTable()
> deinit_exampleTable: unregistering exampleTable...
> register_mib: unregistering SNMPv2-SMI::enterprises.8075.1.3.2
> deinit_exampleTable: unregistering exampleTable failed:-1
> dlmod: Module exampleTable unloaded
>
>
------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to