snmpwalk/snmpget can't read global variable
Posted: Sat Mar 09, 2024 5:02 pm
RouterOS ver 7.14
Global environment declared before:
test=123
Script code:
Listing name from SNMP:
Trying to get value from snmpwalk:
Trying to get value from snmpget:
SNMP Scripts can't read global var?
Global environment declared before:
test=123
Script code:
Code: Select all
/system script add dont-require-permissions=no name=test policy=read,write,policy,test source=":global test; :put \$test;"
Listing name from SNMP:
Code: Select all
snmpwalk -v3 -l authPriv -u mkuser -a SHA -A xxxxxxxx -x DES -X xxxxxxxxxxx 10.20.30.40 1.3.6.1.4.1.14988.1.1.8.1.1.2
Result:
iso.3.6.1.4.1.14988.1.1.8.1.1.2.11 = STRING: "test"
Trying to get value from snmpwalk:
Code: Select all
snmpwalk -v3 -l authPriv -u mkuser -a SHA -A xxxxxxxx -x DES -X xxxxxxxxxxx 10.20.30.40 1.3.6.1.4.1.14988.1.1.18.1.1.2.11
Result:
iso.3.6.1.4.1.14988.1.1.18.1.1.2.11 = STRING: "
"
Trying to get value from snmpget:
Code: Select all
snmpget -v3 -l authPriv -u mkuser -a SHA -A xxxxxxxx -x DES -X xxxxxxxxxxx 10.20.30.40 1.3.6.1.4.1.14988.1.1.18.1.1.2.11
Result:
iso.3.6.1.4.1.14988.1.1.18.1.1.2.11 = STRING: "
"
SNMP Scripts can't read global var?