[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: snmpconf A non-trivial policyAction example




> From: Steve Waldbusser [mailto:waldbusser@nextbeacon.com]
>
> Juergen Schoenwaelder wrote:
>
> > proc create_hlMatrixControlEntry {s ifIndex} {
> >
> >     if {[catch {setRowStatus hlMatrixControlStatus} index]} {
> >         return
> >     }
> >
> >     lappend vbl [list hlMatrixControlDataSource.$index
> ifIndex.$ifIndex]
> >     lappend vbl [list
> hlMatrixControlNlMaxDesiredEntries.$index 1000]
> >     lappend vbl [list
> hlMatrixControlAlMaxDesiredEntries.$index 1000]
> >     lappend vbl [list hlMatrixControlOwner.$index "policy manager"]
> >     lappend vbl [list hlMatrixControlStatus.$index 1]
> >
> >     $s set $vbl
> > }
>
> This API won't work in our environment because agents don't have MIB
> compilers and therefore don't know the type of a variable.
> For example, in
> the maxDesiredEntries varbinds above, it's not clear whether
> to send the
> integer 1000 or the 4 character string "1000".

	This is true if the set function operates strictly as an SNMP set.
However, it is possible to make a copy of the varbind list, issue a get on
it to fill out the type information, and use that information to build the
set operation.  I once wrote an SNMP interface that used this technique, and
I was quite pleasesed with the results - since it checks the agent's idea of
the variable type, it can even detect misconfiguration (i.e.  if the type is
integer and alphabetics occur, an error can be flagged without attempting
the set) due to conflicting MIBs (something which shouldn't occur, but
sometimes does).

	Just a thought,


/|/|ike