Community discussions

MikroTik App
 
changeip
Forum Guru
Forum Guru
Topic Author
Posts: 3819
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.
Colo and Wholesale Bandwidth Available! Sales at SanDiegoBroadband dot com
 
changeip
Forum Guru
Forum Guru
Topic Author
Posts: 3819
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.
Colo and Wholesale Bandwidth Available! Sales at SanDiegoBroadband dot com
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 24609
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?
No answer to your question? How to write posts
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8394
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 =)
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 24609
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 :)
No answer to your question? How to write posts
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8394
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 =)
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
User avatar
BrianHiggins
Long time Member
Long time Member
Posts: 600
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...)
-Brian

http://www.aditumims.com
Complete web based ISP in-a-box solution, designed specifically for Multi-Tenant properties, works great for WISPs too.
 
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: 16
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: 8394
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 =)
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6283
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: 8394
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!
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
User avatar
omidkosari
Trainer
Trainer
Posts: 634
Joined: Fri Sep 01, 2006 4:18 pm
Location: Iran , Karaj
Contact:

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
MTCNA , MTCRE, MTCWE, Mikrotik Certified Trainer
 
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: bwooce, Easpeak, eworm, Google [Bot], Sob and 125 guests