Re: unregister_mib fails

Pal Saint <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <CAJX137o=dTwth=zGy+LibWSLbVoABSKqQU+7GRbXYznM_NSATw@mail.gmail.com>
I am using net-snmp 5.7.2 package running on Linux
2.6.32-220.4.2.el6.x86_64 system.

I added debug statements in unregister_mib_context(), which fails even for
UCD-DLMOD MIB table as well. Looks like, the following for-loop is either
checking the wrong mib tree or netsnmp_subtree_find() isn't returning the
right root of the subtree for this to work. Please see the debug log output
right below the code:

1707         for (child = list, prev = NULL; child != NULL;
1708             prev = child, child = child->children) {
1709
1710             DEBUGMSGTL(("register_mib", "pal:unregistering:"));
1711             DEBUGMSGOIDRANGE(("register_mib", child->name_a,
child->namelen, range_subid, range_ubound));
1712             snmp_log(LOG_INFO, "\nregister_mib pal:child len:%d:\n",
child->namelen);
1713
1714             DEBUGMSGTL(("register_mib", "pal:unregistering start_a:"));
1715             DEBUGMSGOIDRANGE(("register_mib", child->start_a,
child->start_len, range_subid, range_ubound));
1716             snmp_log(LOG_INFO, "\nregister_mib pal:start_a len:%d:\n",
child->start_len);
1717
1718             if (netsnmp_oid_equals(child->name_a, child->namelen,
name, len) == 0 &&
1719                 child->priority == priority) {
1720                 break;              /* found it */
1721              }
1722         }
1723
1724         if (child == NULL) {
1725             DEBUGMSGTL(("register_mib", "pal:failed null child"));
1726             return MIB_NO_SUCH_REGISTRATION;


register_mib: unregistering UCD-DLMOD-MIB::ucdDlmodMIBregister_mib: len:9
register_mib: pal:unregistering:iso
register_mib pal:child len:1:
register_mib: pal:unregistering start_a:UCD-SNMP-MIB::ucdInternal
register_mib pal:start_a len:8:
register_mib: pal:failed null child



On Thu, Mar 7, 2013 at 1:22 AM, Pal Saint <[email protected]> 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
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
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.