How to pass variables for a script via SNMP by using snmpget? -


i have 1 simple bash script calls test_snmp, let's say:

#!/bin/bash  echo $1 

i have snmpd.conf set following:

rwcommunity public 127.0.0.1 extend .1.3.6.1.4.1.2021.53 /bin/bash /tmp/test_snmp 

what i'd run snmpwalk command, like:

snmpwalk -v2c -c public 127.0.0.1 .1.3.6.1.4.1.2021.53 "print something" 

from output see oid = iso.3.6.1.4.1.2021.53.3.1.1.9.47.98.105.110.47.98.97.115.104 = "", output of script. i'd pass string "print something", $1 parameter script mentioned above , string (in case "print something") using snmpget command, like:

snmpget -v2c -c public 127.0.0.1 iso.3.6.1.4.1.2021.53.3.1.1.9.47.98.105.110.47.98.97.115.104 

it example, i'm testing options have running scripts via snmp. because if works i'll write scripts run remotely, have run them variables.

does know how it?

thank you


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -