Community discussions

MikroTik App
 
changeip
Forum Guru
Forum Guru
Topic Author
Posts: 3830
Joined: Fri May 28, 2004 5:22 pm

SNMP OID for Script Results

Thu Apr 09, 2009 9:02 am

This is directed at Mikrotik - I know tons of users would benefit.

Can you please extend SNMP to allow results of scripts to be returned, ie:

/system script print oid
0.1.2.3.4.5.6.7.8.9.0.1 script1
0.1.2.3.4.5.6.7.8.9.0.2 script2

then you could perform snmp get against the OID to run the script and return the result to the snmp get request. Pretttttttyyyy please.
 
changeip
Forum Guru
Forum Guru
Topic Author
Posts: 3830
Joined: Fri May 28, 2004 5:22 pm

Re: SNMP OID for Script Results

Thu Apr 09, 2009 9:06 am

or just allow variables to have OIDs:

[@cip-office] > :env print
"temp"="running"

and

[@cip-office] > :env print oid
"temp"="running" 0.1.2.3.4.5.6.7.8.9.0.1

then you could query just about anything you could dream of by setting the variable in a script.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26322
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: SNMP OID for Script Results

Thu Apr 09, 2009 9:08 am

why do you need this? example?

did you know that the Dude can get results of any command even if there is no OID for it?
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: SNMP OID for Script Results

Thu Apr 09, 2009 9:47 am

get var by The Dude, then run external program and send the value to it - it's so romantic =)
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26322
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: SNMP OID for Script Results

Thu Apr 09, 2009 9:58 am

it depends on where you need that var. if it's in dude, you don't need to send it anywhere. if not in dude, then of course nothing I can do :)
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: SNMP OID for Script Results

Thu Apr 09, 2009 10:10 am

not now, but in future releases =)
 
User avatar
BrianHiggins
Forum Veteran
Forum Veteran
Posts: 702
Joined: Mon Jan 16, 2006 6:07 am
Location: Norwalk, CT
Contact:

Re: SNMP OID for Script Results

Fri Apr 17, 2009 12:05 am

This is directed at Mikrotik - I know tons of users would benefit.

Can you please extend SNMP to allow results of scripts to be returned, ie:

/system script print oid
0.1.2.3.4.5.6.7.8.9.0.1 script1
0.1.2.3.4.5.6.7.8.9.0.2 script2

then you could perform snmp get against the OID to run the script and return the result to the snmp get request. Pretttttttyyyy please.

I second this request... this is something that I've asked for for a long time (I think I even listed it on my requests when i started the original v4.0 Feature Requests thread...)
 
paulyb
just joined
Posts: 2
Joined: Fri Aug 21, 2009 5:32 am
Location: Sydney, Australia

Re: SNMP OID for Script Results

Mon Dec 21, 2009 10:26 am

why do you need this? example?

did you know that the Dude can get results of any command even if there is no OID for it?
I have been trying to find information on using the Dude to do just this, but can not acheive success.
I have an APC UPS connected using USB, I have the UPS Package installed and want to create a Probe to monitor the On-line state. I have read the Probe Thread and other forums but I have been unable to decifer the correct function to read the variable.

Any help greatly appreciated.

Paul
 
User avatar
matrot2
Frequent Visitor
Frequent Visitor
Posts: 79
Joined: Thu Jun 25, 2009 12:34 pm

Re: SNMP OID for Script Results

Mon Dec 21, 2009 8:57 pm

why do you need this? example?

did you know that the Dude can get results of any command even if there is no OID for it?
I have been trying to find information on using the Dude to do just this, but can not acheive success.
I have an APC UPS connected using USB, I have the UPS Package installed and want to create a Probe to monitor the On-line state. I have read the Probe Thread and other forums but I have been unable to decifer the correct function to read the variable.

Any help greatly appreciated.

Paul
From APC UPS work is not convenient if PoE cable length greater than 5 meters.
I am impressed by this:
http://tandem.ck.ua/ups_mtm-eng.php
http://tandem.ck.ua/ups_mt-eng.php
 
paulyb
just joined
Posts: 2
Joined: Fri Aug 21, 2009 5:32 am
Location: Sydney, Australia

Re: SNMP OID for Script Results

Tue Dec 22, 2009 1:30 am

From APC UPS work is not convenient if PoE cable length greater than 5 meters.
I am impressed by this:
http://tandem.ck.ua/ups_mtm-eng.php
http://tandem.ck.ua/ups_mt-eng.php
This a good product, but my UPS is within the same enclousure as the router so cable length is fine. I can see all the data in WinBox, but what I am hoping to do is have a Probe Function that can monitor the On-Battery status within the Dude, but I am yet to make it work.
 
User avatar
matrot2
Frequent Visitor
Frequent Visitor
Posts: 79
Joined: Thu Jun 25, 2009 12:34 pm

Re: SNMP OID for Script Results

Tue Dec 22, 2009 3:01 pm

From APC UPS work is not convenient if PoE cable length greater than 5 meters.
I am impressed by this:
http://tandem.ck.ua/ups_mtm-eng.php
http://tandem.ck.ua/ups_mt-eng.php
This a good product, but my UPS is within the same enclousure as the router so cable length is fine. I can see all the data in WinBox, but what I am hoping to do is have a Probe Function that can monitor the On-Battery status within the Dude, but I am yet to make it work.
Mikrotik does not support SNMP UPS.
The answer of the mikrotik:
"Thank you very much for the request.
Currently such options are not available over SNMP, but we added these
features to our todo list."
See scripts:http://tandem.ck.ua/prg/scripts.txt
Maybe they will help you.
We have also used them for APC.
 
prcek
just joined
Posts: 19
Joined: Mon Apr 17, 2006 5:39 pm

Re: SNMP OID for Script Results

Wed Nov 10, 2010 11:28 pm

why do you need this? example?

did you know that the Dude can get results of any command even if there is no OID for it?
Not everyone uses The Dude, but Zabbix, Zenoss or other NMSs. It would be really handy to have an option to save a value from script as OID. For example count of wireless users (/interface wireless registration-table print count-only where interface="wlan1"). Really handy and useful.

Z.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: SNMP OID for Script Results

Thu Nov 11, 2010 1:44 am

For example count of wireless users (/interface wireless registration-table print count-only where interface="wlan1").
or ':put [/queue tree get test-pcq pcq-queues]' - developers promise that it vill be added in future versions, but with that feature we can get it right now =)
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: SNMP OID for Script Results

Thu Nov 11, 2010 1:03 pm

that will be added at first for simple queues.
 
rmichael
Forum Veteran
Forum Veteran
Posts: 718
Joined: Sun Mar 08, 2009 11:00 pm

Re: SNMP OID for Script Results

Thu Nov 11, 2010 7:27 pm

For now you can "hack around it" and use currently defined OIDs. For example, simple queue's name has an OID and you can change the name to reflect some value with a script. I also manipulate MTU value, since it's got an OID, of dummy VAP to the same effect. I'm sure you can find others... :)
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: SNMP OID for Script Results

Thu Nov 11, 2010 11:33 pm

that will be added at first for simple queues.
simple?!? who need that??? queue tree ruleZ!
 
User avatar
omidkosari
Trainer
Trainer
Posts: 640
Joined: Fri Sep 01, 2006 4:18 pm
Location: Canada, Toronto

Re: SNMP OID for Script Results

Mon Oct 31, 2016 1:09 pm

Congratulations
The feature has been added in 6.37
http://wiki.mikrotik.com/wiki/Manual:SN ... s_with_GET
 
amissboy
just joined
Posts: 2
Joined: Mon Jan 02, 2017 9:15 pm

Re: SNMP OID for Script Results

Mon Jan 02, 2017 9:19 pm

I want to write script for oid ccq .
may help me

Who is online

Users browsing this forum: Amazon [Bot], dioeyandika, Joseph and 91 guests