On Tue, Mar 22, 2011 at 02:49, Dave Shield <[email protected]>wrote:
> On 21 March 2011 19:33, Donald Russell <[email protected]> wrote:
> >> [exec/extend and pass] are two very different approaches to extending
> the agent.
> >> Don't try and equate the two.
> >
>
> > I wonder why the authors didn't think it would be worthwhile for the
> > extend feature to accept the value specified on snmpset.
>
> But the value specified on 'snmpset' will always be 3
> What use would it be to pass this to the script?
>
> If you want to pass request-specific information to the script
> when it's invoked, you can always issue a SET request that
> assigns new values to the nsExtendArgs and/or nsExtendInput
> instances, as well as the nsExtendRunType trigger.
>
> Surely that's more flexible than passing a fixed value to the script?
>
>
I have not made myself clear.... :-)
I have this extend directive in the snmpd.local.conf file:
extend cmm /usr/local/bin/cmm
That is fantastic... within 5 minutes I have a new "OID" I can query. I get
the results of my /usr/local/bin/cmm program.
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,
possibly like:
/usr/local/bin/cmm -s STRING "some new value"
Or, failing that, allow more information in the config file. Perhaps
something like:
extend cmm /usr/local/bin/cmm %t %s
Where "%t" and "%s" are a place holders for the type and value as specified
on the snmpset command.
Yes, I could
snmpset ... nsExtendArgs.\"cmm\" s "some new value"
snmpget ... nsExtendOutputFull.\"cmm\"
I don't like this for the following reasons:
1 - I end up using an snmpget command to effect a change
2 - multiple snmpgets will effect mulitple sets until I can change the args
again.
3 - with the nature of snmp and udp, what if the snmpset to change the args
fails for some reason, but the get is successful... the get uses the old
args... not what I want. So, I could "set args", get args" to make sure they
are correct"... if not try the set again, rinse and repeat.
exec is deprecated in favour of extend... that's fine, extend is great.
>From what I can determine, extend can't be used so that snmpset will pass
the new requested value to the arbitrary program.
So, I opt for pass.. but that is so much more complicated than extend. No
matter, if I can get pass working, I'm happy and I see that it provides the
most flexibility of all, but if I'm going to use pass, I may as well create
a MIB and go the whole nine yards. Extend is great, just not quite
extensible enough IMHO. ;-)
I'll follow up with you on my "pass" problem in a separate email.
Thanks, I really appreciate the discussion.
Donald
------------------------------------------------------------------------------
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