Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SNMP purpose of OBJECT-GROUP, MODULE-COMPLIANCE with regards to OBJECT-TYPES

Tags:

snmp

net-snmp

mib

I am implementing my own MIB and also use smilint to check to validate the MIB. I am getting a lot of node xxx must be contained in at least one conformance group warnings.

I am having trouble deciphering the purpose of the OBJECT-GROUP and where it fits in the MIB file. Does it provide a mechanism for grouping related managed OBJECT-TYPES located at various OIDs in the same OID subtree? Is it really required since I can design a useful MIB with out it?

I am also struggling to understand the purpose of the MODULE-COMPLIANCE macro relating to the objects. Is this applicable for when extending the MIB I am creating?

A similar question has been asked on SO here which I sill find unclear since the OBJECT-GROUP is defined under one OID and the referenced OBJECT-TYPEs under a completely different tree. Thanks

like image 950
gavenant Avatar asked Nov 30 '16 09:11

gavenant


1 Answers

The OBJECT-GROUP macro is, as you state, used to group conceptually related managed OBJECT-TYPES located at various OIDs. However, they do not have to be from the same subtree. The OBJECT-GROUP macros are not, strictly speaking, required as the fact that it is only a level 4 warning from smilint will attest.

The answer you linked to does mention some of this, but hopefully this is a more useful answer for you.

As to the purpose of these things, I will attempt to explain. These OBJECT-GROUP and MODULE-COMPLIANCE macros are intended for those that will implement the MIB you are creating, rather than for anything to do with the MIB itself. The OBJECT-GROUPs give an idea about the logical relationships of the OIDs and the MODULE-COMPLIANCE statement shows which OIDs are mandatory under what circumstances. i.e from RFC2580:

The compliance statement contained in the (hypothetical) XYZv2-MIB might be:

    xyzMIBCompliance MODULE-COMPLIANCE

    DESCRIPTION
           "The compliance statement for XYZv2 entities which
           implement the XYZv2 MIB."
      MODULE  -- compliance to the containing MIB module
      MANDATORY-GROUPS { xyzSystemGroup,
                         xyzStatsGroup, xyzTrapGroup,
                         xyzSetGroup,
                         xyzBasicNotificationsGroup }
      GROUP   xyzV1Group
      DESCRIPTION
          "The xyzV1 group is mandatory only for those
           XYZv2 entities which also implement XYZv1."
::= { xyzMIBCompliances 1 }

According to this invocation, to claim alignment with the compliance statement named

   { xyzMIBCompliances 1 }

a system must implement the XYZv2-MIB's xyzSystemGroup, xyzStatsGroup, xyzTrapGroup, and xyzSetGroup object conformance groups, as well as the xyzBasicNotificationsGroup notifications group. Furthermore, if the XYZv2 entity also implements XYZv1, then it must also support the XYZv1Group group, if compliance is to be claimed.

So, as stated in the other question if you do decide to create OBJECT-GROUP macros, you should probably then follow through and also create the supporting MODULE-COMPLIANCE objects to go with them since you've already gone to the trouble.

like image 196
L.McCauslin Avatar answered Oct 23 '22 20:10

L.McCauslin