SNMP execute scripts

Greetings,
I am trying to execute a script via SNMP v2c using the OID 1.3.6.1.4.1.14988.1.1.8.1.1.3.X (where X is the script’s ID). Problem is, apparently my script does not execute.
I use this command to query the Mikrotik:

snmpwalk -v2c -c CommunityTest 1.2.3.4 1.3.6.1.4.1.14988.1.1.8.1.1.3.3

This script is supposed to return a value with “:put 5”, but I am only getting “iso.3.6.1.4.1.14988.1.1.8.1.1.3.3 = INTEGER: 0”, which (I guess) means the script is not getting executed. This is the snmp’s configuration:

snmp community add addresses=x.x.x.x/32 authentication-password=xxxxxx encryption-password=xxxxxx name=CommunityTest write-access=yes
/snmp set contact=COMPANY enabled=yes location="DATACENTER" trap-community=CommunityTest trap-version=2

If I query the Mikrotik with another OID (i.e. 3.6.1.2.1.2.2.1.2.15728641) I do get a result, so the client connects successfully to the Mikrotik.
What am I doing wrong?
Do you need some extra detail?
Thank you for any help

Try replace snmpwalk (that is used to read subtree of information) with snmpget that is used for one oid.

Hello Jotne,
thank you for your reply.
I changed the command to

snmpget -v2c -c CommunityTest 1.2.3.4 1.3.6.1.4.1.14988.1.1.8.1.1.3.3

to execute the third script - with no luck though.
What seems even stranger to me is that if I query some other OID, say 3.6.1.2.1.25.2.3.1.6.131072 (used disk space) or 3.6.1.2.1.25.2.3.1.5.131072 (free disk space) I do get the correct result, so it must be something I did wrong with the scripts. Is

:put 5

correct to return a value?

what mean “:put 5”?
Put 5 inline on terminal (when is opened)…
SNMP do not have any interactive terminal open on that moment… or not?

I want a script to get snmp configuration details through SNMP.
when i create a script about any interface & get the details from custom OID i am able to do that for example “interface wireless print” when i execute though custom OID i getting the value but when i create a snmp print script and executing through custom OID i am getting error i.e %Failed to get value of SNMP variable. Timeout.

Pls suggest if any correction required in script

Crystal ball … Crystal ball …
Nope.
Not seeing anything.

I can make the snmp script, the display is like the photo below, if you are interested, please contact us via telegram t.me/nb21org

@horasjey, why not post it here, so others can make use of it as well?

+1

For the OP problem only the solution is simple, add “1” in the right point…


1.2.3.4 1.3.6.1.4.1.14988.1.1.8.1.1.3.3
=>
1.2.3.4 1.3.6.1.4.1.14988.1.1.**1**8.1.1.3.3

@rextended:

What is this magic that you do? How did you know the value was 18 and not 8?

I have the VICE of READING documentation, at least the little written, should be read…

At the time of the OP:
https://wiki.mikrotik.com/Manual:SNMP#Runing_scripts_with_GET

Now:
https://help.mikrotik.com/docs/spaces/ROS/pages/8978519/SNMP#SNMP-RunningscriptswithGET

I thought it was just a random OID.

May we all be smitten with such a vice.