Community discussions

 
cnolte23
just joined
Topic Author
Posts: 3
Joined: Sat Jul 14, 2018 6:30 pm

RouterOS SNMP Get

Sat Jul 14, 2018 6:36 pm

Can I use the RouterOS commands to pull SNMP OID's from devices attached to the ethernet port of the Router Board? For example I want to pull SNMP data from a device that reads Voltage and I want to store that information on the Router Board in a file. Then once a day have my server pull the data from that Router Board. Is this possible or should the server pull the data directly. Mainly trying to limit bandwidth usage over the wireless back haul from the server to the Router Board. Thanks.
 
cnolte23
just joined
Topic Author
Posts: 3
Joined: Sat Jul 14, 2018 6:30 pm

Re: RouterOS SNMP Get

Sun Aug 05, 2018 4:11 am

Still looking for help... I've started experimenting with the SNMP-GET command, but I'm not able to store the information into a variable or into a file. /tool snmp-get community=XXXXX port=XXXX oid=1.3.6.1.4.1.994.3.4.7.21.1.66.1 version=2c address=XXX.XXX.XXX.XXX returns the following.
[admin@router]
OID TYPE VALUE
1.3.6.1.4.1.994.3.4.7.21.1.66.1 octet-string 53.8

Can I store the value into a variable or into an array if I had the name of the value from another oid from the value below?

OID TYPE VALUE
1.3.6.1.4.1.994.3.4.7.21.1.3.1 octet-string Battery_String_1

There are about 10 values and names I need to store. Please any help would be greatly appreciated!
 
pe1chl
Forum Guru
Forum Guru
Posts: 5927
Joined: Mon Jun 08, 2015 12:09 pm

Re: RouterOS SNMP Get

Sun Aug 05, 2018 1:00 pm

You will have to write a script that uses this command and put the output in a variable, then you can write this variable in a file when you like.
You would use the script construct:

:local variable;
:set variable [ /tool snmp-get .... ];
 
sid5632
Member
Member
Posts: 353
Joined: Fri Feb 17, 2017 6:05 pm

Re: RouterOS SNMP Get

Sun Aug 05, 2018 3:06 pm

This doesn't work...
[admin@MikroTik] > :global x
[admin@MikroTik] > env pr
x=[:nothing]

[admin@MikroTik] > :set x [/tool snmp-get address=192.168.0.1 oid=1.3.6.1.4.1.14988.1.1.11.1.1.4.3]
OID                                 TYPE             VALUE                               
1.3.6.1.4.1.14988.1.1.11.1.1.4.3    octet-string     6.42.6 (stable)                     

[admin@MikroTik] > env pr
x=[]      
 
cnolte23
just joined
Topic Author
Posts: 3
Joined: Sat Jul 14, 2018 6:30 pm

Re: RouterOS SNMP Get

Sun Aug 05, 2018 6:47 pm

Thank you for the responses, I've tried putting the output into a variable before with the same results. I think the issue is the amount of data coming from the snmp-get statement is more than can be held in a single variable. Also the return line and blank spaces could be throwing a wrench into the system.
 
User avatar
dasiu
Trainer
Trainer
Posts: 232
Joined: Fri Jan 30, 2009 11:41 am
Location: Reading, UK
Contact:

Re: RouterOS SNMP Get

Mon Aug 06, 2018 11:12 am

Hi! The is no "issue" with amount of data or anything... It's simple it's just NOT SUPPORTED yet :).

I believe someone from MT staff said that they plan to introduce it later (can't remember, where), for now the snmp-get is just for user interaction, can't be scripted.

I'm also waiting for it to be developed! :)
 
millenium7
Member Candidate
Member Candidate
Posts: 208
Joined: Wed Mar 16, 2016 6:12 am

Re: RouterOS SNMP Get

Wed Mar 27, 2019 8:10 am

This needs to be implemented, would be hugely useful

My particular use case is monitoring link quality of radio's so I can force a re-route when SNR or signal strength drops below a certain point
Without this, link can flap up and down with packet loss, high latency, congestion etc. OSPF becomes very unreliable

I want to move traffic 'before' the link goes down entirely to prevent a poor link (rain, knocked out of alignment, obstruction etc) from affecting network performance
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 1310
Joined: Sat Dec 24, 2016 11:17 am
Location: jo.overland at gmail.com

Re: RouterOS SNMP Get

Wed Mar 27, 2019 9:01 am

If the data is readable within routerOS using a command, you can do it without need for SNMP.
Make a scheduled scripts that reads the data likes this to get the CPU load
:local cpuload ([/system resource get cpu-load])
Then do an if statement and change some when a threshold is passed.
 
How to use Splunk to monitor your MikroTik Router

MikroTik->Splunk
 
 
millenium7
Member Candidate
Member Candidate
Posts: 208
Joined: Wed Mar 16, 2016 6:12 am

Re: RouterOS SNMP Get

Wed Mar 27, 2019 9:47 am

Well yes obviously if it was local to the device, however the point of SNMP is to retrieve data from 'other' devices

i.e.
RouterA->RadioA->RadioB->RouterB

Neither router has any visiblity of the link, they only see the physical ethernet port status, RadioA->RadioB can be down entirely, still shows up from the perspective of either Router though
Or worse, RadioA->RadioB is still up and so OSPF/BGP keepalives get through, barely. But the link performance might be say 3mbit/s when it should be 500mbit/s
Again, no visibility, no way to change link metrics etc

SNMP-GET would mean RouterA can monitor RadioA's reported information on the link to RadioB, then adjust metrics or make it unreachable pre-emptively, meaning near instantaneous and pre-emptive failover when conditions worsen instead of keeping that terrible link alive and passing traffic which is a nightmare for VoIP traffic
 
pe1chl
Forum Guru
Forum Guru
Posts: 5927
Joined: Mon Jun 08, 2015 12:09 pm

Re: RouterOS SNMP Get

Wed Mar 27, 2019 3:18 pm

That is a wellknown problem. Well, at least wellknown to me, it sometimes surprises me that it isn't mentioned more often.
When you make a network out of MikroTik routers (e..g. RBx011) and point-to-point links (e.g. LHG5) where there are redundant paths in the network,
it is quite difficult to get it routing properly, especially out-of-the-box.
Routing protocols like BGP have simple path selection algorithms like "less hops is better" that do not work well in wireless link environments.
E.g. with 3 routers A B and C where all 3 have wireless links but from A to C is a poor link, traffic from A to C should be routed via B when the
two links A-B and B-C are considerably better than A-C. However there is no easy way to feed the link quality into the routing algorithm.

Why not?? I thought that this kind of network was the core business of companies like MikroTik...

Who is online

Users browsing this forum: No registered users and 14 guests