Template:FAQ:Agent 07

From Net-SNMP Wiki
Revision as of 19:44, 22 October 2006 by Dts12 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

'exec' will fork off the specified command and return the exit status and/or the output. Arguments are passed directly to the command.

'sh' is similar, but invokes a shell to run the command line given. This means that quoted arguments will be recognised as such, and also allows redirection, and other similar shell interpretation.

Neither of these mechanisms require the command to have any knowledge of the fact that they are being used in this manner. But the output is returned in a fixed format, and it is up to the receiving application to interpret this appropriately.

Note that with the 4.2.x and 5.0.x lines, return values are cached within the agent for 30 seconds, rather than invoking the command for every request. This does not hold for the 5.1.x agent.


'pass' is a more general mechanism for extending the agent, and the command given will be invoked for any request within the specific MIB subtree. Details of precisely how this command will be called in various circumstances is given in the 'snmpd.conf(5)' man page.

'pass-persist' is similar, but the command will continue running even once the initial request has been answered.

See 'snmpd.conf(5)' for more details.