On 24 January 2013 04:53, Mishustin Kirill <mishus...@eltex.nsk.ru> wrote:
>         I have noticed that most tables with integer index have first entry
> with index = 1, and not 0. (ifTable, sysORTable ...) Why is that?
> Is it required by SNMP standarts or it is just common practice?

It's not strictly *required*, but it is definitely strongly recommended.
>From RFC 2578, section 7.7:

   Instances identified by use of integer-valued objects should be
   numbered starting from one (i.e., not from zero).  The use of zero as
   a value for an integer-valued index object should be avoided, except
   in special cases.


If nothing else, avoiding 0 helps draw a distinction between instances
within a table, and instances of scalar objects (which *always* end in 0)


> What should developers of new snmp tables do? Begin with 1 or with 0?

If this is an arbitrary index, then begin with 1 - definitely.

The only time I would consider using a table index of 0 would be if
I'm monitoring some underlying subsystem, which defines its own
internal numeric identifiers, and those started at 0.
   For example, if I was writing a MIB to report on user accounts on
a Unix system, one natural index might be the numeric user ID.
In that case, the indexing would need to start at 0, in order to cover
the root account.

   But in the absence of such an external constraint on the index
values, the traditional "arbitrary index" table should start from 1.

Dave

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
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