On 7 September 2012 12:38, Sverre Moe <[email protected]> wrote:
> Yes it is a group of scalar. In my little example it is only one group, but
> it can potentially be many groups. There will never be other groups in a
> group that has scalars, but one group can have 2 group of scalars.
>
> For example it could be something like this. Can all these scalar be counted
> in the main group of test, or the groups of test1, test2, test31 and test32?
No - you would need to register each group individually.
Remember - there must always be something within the code that
implements a given MIB that tells the agent which OIDs correspond
to valid MIB objects.
In the case of the scalar_group helper, the code takes the "root"
OID, and appends each of the subidentifiers from within the range
given in the registration.
So
netsnmp_register_scalar_group( "root", first, last );
is a shorthand for
register root.first
register root.first+1
:
register root.last
There's not really an easy way to tell the agent
register root.group1.obj1
register root.group1.obj2
:
register root.group1.objN
register root.group2.obj1
register root.group2.obj2
:
register root.group2.objM
register root.group3.group3a.obj1
register root.group3.group3a.obj2
:
register root.group3.group3a.objX
register root.group3.group3b.obj1
register root.group3.group3b.obj2
:
register root.group3.group3b.objY
How would you go about specifying this level
of complexity within a single
netsnmp_register_complex( ... )
call?
(Let alone the rats' nest of code that would be
needed to process such a registration).
It's a lot easier to have a registration helper for
a simple group, and let the initialisation code
take care of the heirarchical complexities:
netsnmp_register_scalar_group( root.group1, 1, M );
netsnmp_register_scalar_group( root.group2, 1, N );
netsnmp_register_scalar_group( root.group3.group3a, 1, X );
netsnmp_register_scalar_group( root.group3.group3b, 1, Y );
Dave
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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