On 22 March 2011 15:38, Donald Russell <[email protected]> wrote:
> Now, I want to
>    snmpset -v 2c -c rwcommunity host
>       NET-SNMP-EXTEND-MIB::nsExtendCommand.\"cmm\" s "some new value"
>
> and expect that "some new value" be passed to my /usr/local/bin/cmm program,


That would be handled by
    snmpset .... nsExtendArgs.\"cmm\"  s  "some new value"
or
    snmpset .... nsExtendArgs.\"cmm\"  s  "some new value"
nsExtendRunType.\"cmm\" i 3

depending on whether this is a run-on-read, or run-on-set entry.


This would then trigger
     /usr/local/bin/cmm  "some new value"


Setting the nsExtendCommand value would *change* the command that's invoked.
Something like

    snmpset ... nsExtendCommand.\"cmm\" s  /usr/local/bin/cmm-v2




> Yes, I could
> snmpset ... nsExtendArgs.\"cmm\" s "some new value"
> snmpget ... nsExtendOutputFull.\"cmm\"

That's how things have been designed to work - yes.


> I don't like this for the following reasons:
> 1 - I end up using an snmpget command to effect a change

I don't understand this objection.
Even if the agent did invoke the script with the new arguments,
you'd still need to query nsExtendOutputFull in order to see the results.

What's the difference between

     snmpset ... nsExtendArgs.\"cmm\" s "some new value"
     snmpget ... nsExtendOutputFull.\"cmm\"
and
     snmpset ... nsExtendCommand.\"cmm\" s "some new value"
     snmpget ... nsExtendOutputFull.\"cmm\"




> 2 - multiple snmpgets will effect mulitple sets until I can change the args 
> again.

No.
Multiple GETs will return the output of the command (either cached or re-run),
yes.   But you've only got one SET.
   And if you don't like this model - you can still use the
'run-on-set' approach.
so the command will *only* be run if you invoke a suitable SET command.
However many times you run the GET, you'll still get the cached output.


I can't help feeling you're still confusing exec/extend with pass behaviour.

   The whole idea of   "/some/script -s " to apply a SET assignment is *only*
relevant to the "pass" directive.    It's not applicable to exec/extend scripts.


> 3 - with the nature of snmp and udp, what if the snmpset to change the args
> fails for some reason

Presumably your application will check the result of the SET, and
won't proceed with the GET if it fails.

> but the get is successful... the get uses the old args... not what I want.

If you ignore the error message from the SET, then I don't have
much sympathy :-)



> From what I can determine, extend can't be used so that snmpset will pass
> the new requested value to the arbitrary program.

See above.

Dave

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to