Community discussions

MikroTik App
 
Massimiliano
just joined
Topic Author
Posts: 2
Joined: Thu Mar 10, 2022 12:05 pm

SNMP execute scripts

Thu Mar 10, 2022 5:02 pm

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
Last edited by Massimiliano on Mon Mar 14, 2022 10:08 am, edited 1 time in total.
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3291
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: SNMP execute scripts

Sat Mar 12, 2022 11:27 am

Try replace snmpwalk (that is used to read subtree of information) with snmpget that is used for one oid.
 
Massimiliano
just joined
Topic Author
Posts: 2
Joined: Thu Mar 10, 2022 12:05 pm

Re: SNMP execute scripts

Mon Mar 14, 2022 10:09 am

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?
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: SNMP execute scripts

Sat Mar 19, 2022 2:22 pm

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?

Who is online

Users browsing this forum: No registered users and 20 guests