[repost because I forgot to respond to the list]

Hello,

Le 23/07/2014 00:22, Turbo Fredriksson a écrit :
> Hope it's ok to ask a MIB design question here, I couldn't find any more
> suitable list for this... 

I hope it's ok, too. I will try to answer, but please note that my
answer may be incorrect (I'm not a guru).

> In my MIB, I have a couple of tables:
> 
> $ smidump -f tree ./BAYOUR-COM-MIB.txt
> [....]
>      +--zfsPoolStatusTable(5)
>      |  |
>      |  +--zfsPoolStatusEntry(1) [zfsPoolStatusIndex]
>      |     |
>      |     +-- --- CounterIndex       zfsPoolStatusIndex(1)
>      |     +-- r-n DisplayString      zfsPoolName(2)
> [....]
>      +--zfsVFSIOPSTable(8)
>      |  |
>      |  +--zfsVFSIOPSEntry(1) [zfsVFSIOPSIndex]
>      |     |
>      |     +-- --- CounterIndex  zfsVFSIOPSIndex(1)
>      |     +-- r-n DisplayString zfsPoolNameVFSIOPS(2)
> 
> Now, I'd like to "reuse" 'zfsPoolName' in 'zfsVFSIOPSTable', but if I just
> add that there:
> 
>           ZFSVFSIOPSEntry             ::= SEQUENCE {
>             zfsVFSIOPSIndex           CounterIndex,
> 
>             zfsPoolName               DisplayString,
>             zfsOperReads              Counter32,
>             zfsOperWrites             Counter32
>           }
> 
> I get:
> 
>       BAYOUR-COM-MIB.txt:2213: SEQUENCE element #2 `zfsPoolName' is not a 
> child node under `zfsVFSIOPSEntry'
>       BAYOUR-COM-MIB.txt:2213: warning: SEQUENCE element #3 `zfsOperReads' 
> does not match order of columnar objects under `zfsVFSIOPSEntry'
> 
> Which is why I had to name it something really ugly like 'zfsPoolNameVFSIOPS' 
> (this
> is not the only place I want/need to reuse it in)...
> 
> The error in itself is quite obvious, don't get me wrong! But how can I 
> include
> a defined ... 'node' from/in another 'parent'?

It think that the answer will depend on whether zfsPoolStatusIndex and
zfsVFSIOPSIndex represent the same physical instance.


If the answer is yes, then a ZFSVFSIOPSEntry augments the
zfsPoolStatusEntry, and you could define the second table, either with
  INDEX { zfsPoolStatusIndex }
or
  AUGMENTS { zfsPoolStatusEntry }
instead of
  INDEX { zfsVFSIOPSIndex }

In that case, it use useless to redefine a zfsPoolName in the second
table, since it is already in first table, with same index.


But if the answer is no, then the poolName in the second table can't
be the same object as that in the first table! I'm not sure, but maybe
you simply need a sort of pointer from the second table to the first
one : for example, if there is a zfsPoolStatusIndex corresponding to
each instance of a ZFSVFSIOPSEntry, you could add in ZFSVFSIOPSEntry
an object 'zfsVFSIOPSPoolIndex' whose value would be the corresponding
zfsPoolStatusIndex in ZFSVFSIOPSEntry.


Regards,
-- 
Olivier Miakinen

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
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