On 18 March 2011 23:52, Donald Russell <[email protected]> wrote: > I have net-snmp 5.3 on Linux and I've been able to use the "exec" and > "extend" config statements with great success. > > "pass" on the other hand is driving me crazy... I can't get snmpwalk to walk > the OID I specify at all...
What does your pass script look like? Remember that "exec" and "extend" scripts are SNMP-ignorant. You can run arbitrary commands here, and the agent will report back the output - applying a suitable MIB framework to structure this. "pass", on the other hand, can be used to report back information in a user-defined structure. The price for this is that it does needs to know about SNMP processing, and there is a very clearly defined way of both invoking the command, and how it should return the results. You can't simply use an arbitrary command with "pass", in the way that you can with "exec" or "extend". > But, back to "extend"... I'd like to have an OID that I may both query and > set, and when I look at NET-SNMP-EXTEND-MIB it appears I can have a > "run-on-set" (2) value for nsExtendRunType... > > How do I configure an extend config statement to support both snmpget and > snmpset? Try using "extendFix" instead of "extend" > Or, the man page says "extend" items can be added dynamically.... that would > be great... I can have a system start up script dynamically add the > run-on-get and the run-on-set scripts. (Actually the same script, args would > determine action taken) That would use SET requests to build up the entry in the nsExtendConfigTable. Try configuring a row using "extend", and walk this table to see what the entry looks like. Then use "snmpset" with equivalent varbinds (and an nsExtendStatus value of 'createAndGo') > When the script is run due to run-on-set, is the new value simply passed as > the args or is it more structured than that? It's actually simpler than that. When the nsExtendRunType instance is set to 'run-command(3)', then the corresponding nsExtendCommand is invoked (using the arguments from nsExtendArgs and input from nsExtendInput). The "new value" for nsExtendRunType is never actually used (other than as a trigger for invoking the command). If you read the nsExtendRunType instance again, it will still have the value 'run-on-set(2)' > Similar to "pass" which passes -s OID TYPE VALUE No "pass" is SNMP-knowledgable (and runs a closely defined command) "extend" is SNMP-ignorant (and can run an arbitrary command) These are two very different approaches to extending the agent. Don't try and equate the two. Dave ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
