On Tue, 2006-01-17 at 09:09 +0200, David Peer wrote:
> Is it possible to pass an argument to a script/command
> I defined in snmpd.conf OID?
>
> _in snmpd.conf:_
> exec PS /bin/ps
>
> _and in command line tolls:_
> snmpget -v3 ..... hostname OID {argument_to_OID}
Not using that sort of approach.
You'd need to set up several different "exec" commands
(which would therefore use different OIDs), and
retrieve the appropriate value:
exec PS1 /bin/ps
exec PS2 /bin/ps -aux
exec PS3 /bin/ps -ef
snmpget .... hostname OID1
snmpget .... hostname OID2
snmpget .... hostname OID3
Alternatively, the newer "extend" mechanism allows
you to configure the arguments (and input data)
for a given command. So you could do something
like:
extend PS /bin/ps
snmpset .... hostname nsExtendArgs."PS" s "-aux"
snmpget .... hostname nsExtendOutputFull."PS"
snmpset .... hostname nsExtendArgs."PS" s "-ef"
snmpget .... hostname nsExtendOutputFull."PS"
Not quite what you were looking for, but it might
do the trick.
Dave
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users