PDM> Answers to SNMP questions on DefaultValue (DEFVAL), status enums, etc.

PDM> Answers to SNMP questions on DefaultValue (DEFVAL), status enums, etc.

Richard_Landau at Dell.com Richard_Landau at Dell.com
Tue May 1 19:14:05 EDT 2007


Several questions arose recently regarding some SNMP conventions that we
should follow.  I asked a local PWG expert and got the attached answers.
All good answers that we should internalize.  

The questions related to some of the DefaultValue issues that have come
up on the concalls, a few details on implementing a counter-reset
property, and enum values for status properties.  

Thanks to Ira McDonald for the expert advice.  His answers are edited
inline with the questions.  

rick

--------------------
 

-----Original Message-----
From: Ira McDonald [mailto:blueroofmusic at gmail.com] 
Sent: Tuesday, May 01, 2007 18:03
To: Landau, Richard; Ira McDonald
Subject: Re: Two questions for the SNMP police. And advice needed.

Hi Rick,

Inline.

Cheers,
- Ira

On 5/1/07, Richard_Landau at dell.com <Richard_Landau at dell.com> wrote:
>
>
>
> Ira, need some assistance on the following interesting, I hope, 
> questions, please.  All for the projector mgt effort.
>
> 1.  When one reads a pppXxxCounterReset object, what value does one
receive?
>  Even though the property is supposed to be write-only, it would be 
> bad form to answer NOSUCH, right?  So it has a value.  Any ideas what 
> value?  Maybe the same as the identified value that triggers it on 
> write?  Or zero?  Is there a convention on what value to use for 
> "reset"?  Similar questions will arise when we try to do a FRU reset
object, too, I'm sure.
>

Given that the pppXxxCounterReset object has an enumeration like
idle(1), resetRequest(2), resetInProgress(3), the DEFVAL should be
'idle(1)'
(because SNMP doesn't permit the semantic 'write-only'), the
Manager/Client should set 'resetRequest(2)' which instantaneously
returns the set result of 'resetRequest(2)' and then immediately
transitions to a read-only value 'resetInProgress(3)' until the
operation completes and then transitions to a read-only value of
'idle(1)'.  The attempt to write any value except for 'resetRequest(2)'
into the pppXxxCounterReset object should fail with
SNMPv1 error badValue(3) or SNMPv2 error inconsistentValue(12) (see page
8 of SNMPv2, RFC 3416).


> 2.  What is the default value for a counter?  Or is this an exception 
> to "all objects must have a DEFVAL clause?"  Zero, since that is the 
> starting value?
>

SMIv2 (RFC 2578) specifically prohibits a DEFVAL clause on a Counter32
object (see section 7.1.6 on page 23 of RFC 2578).  However, a
DESCRIPTION clause should specify that a conforming Agent must ensure
that a counter begins at zero initial value.


> 3.  For an enumerated status object, the correct default value is 
> "unknown", right?
>

Yes, correct.


> 4.  Is there a convention for the common enumerated values of a status

> object, e.g.,
> 1 = other  (often needed)
> 2 = unknown  (always needed)
> 3 = okay  (often needed)
> etc.?  I am inclined to go with the CIM convention of the first two of

> these, other and unknown, as always the same values, even if other is 
> not present.
>

The CIM convention of the first two (other and unknown) comes directly
from common SNMP MIB usage.  And I have never found a legitimate case
where both other(1) (meaning vendor-supplied or not yet registered) and
unknown(2) (meaning cannot be reliably detected) don't both apply.
I consider the Printer MIB in error occasionally omit one or the other.

I would NOT standardize on okay(3).  It's not common SNMP MIB usage.


> 5.  In a DEFVAL clause of an enumerated integer, can the value be the 
> string or does it always have to be the number?
>

YES - it MUST be the string value - by convention a trailing ASN.1
comment should state the equivalent numeric value.


>
> Okay, so I can't count.  But I fooled you into opening the message,
eh?
>
> Thanks very much for any assistance.  Short answers will do; don't 
> need lots of justification.
>
> rick
> ----------------------
> Richard_Landau(at)dell(dot)com, Stds & System Mgt Architecture, CTO 
> Office
> +1-512-728-9023, One Dell Way, RR5-3, MS RR5-09, Round Rock, TX 78682


--
Ira McDonald (Musician / Software Architect) Chair - Linux Foundation
Open Printing WG Blue Roof Music / High North Inc PO Box 221  Grand
Marais, MI  49839
phone: +1-906-494-2434
email: blueroofmusic at gmail.com




More information about the Pdm mailing list