Selfmade function: Get Aggregation-Link-Speed - help needed

Hi,

i’m trying to combine the linkspeed of 4x1Gbit between two switches.

the idea: Get RX for Port 7 8 9 10 and add them all together

But i’m failing with the simplest part of it: geht RX:Speed for Port 7

There is an awesome tutorial here: http://forum.mikrotik.com/t/norification-if-speed-on-a-link-drops/39246/1


but if i build my function like that:

<?xml version="1.0" ?>
<dude version="4.0beta2">
 <Function>
  <sys-type>57</sys-type>
  <sys-id>73869</sys-id>
  <sys-name>LAG1_RX</sys-name>
  <code>rate(\0d\0a    oid("1.3.6.1.2.1.2.2.1.10.7")*8/(1024*1024)\0d\0a)</code>
 </Function>
</dude>

the result is a value which differs a lot from the [Interface.InBitRate]

it seems, its not the current Bytes per second, its the totally amount of transfered bytes on this interface?

Whats going wrong here?

Thank you

You need to use diff23…

This is the combined tx and rx of g0/0 of a router… Didn’t test it.
string_substring((((rate(diff32(oid(“1.3.6.1.2.1.2.2.1.10.1”))+diff32(oid(“1.3.6.1.2.1.2.2.1.16.1”)))/diff32(oid(“1.3.6.1.2.1.2.2.1.5.1”))))*8),0,4)

You missed the last post here http://forum.mikrotik.com/t/norification-if-speed-on-a-link-drops/39246/1

When using Dude 4.0 you must change functions in order it to work because rate function had changed it’s behavior.

<?xml version="1.0" ?>
<dude version="4.0beta2">
<Function>
  <sys-type>57</sys-type>
  <sys-id>7765875</sys-id>
  <sys-name>If_7_in_rate</sys-name>
  <code>if(oid("1.3.6.1.2.1.2.2.1.10.7"),round(rate(diff32(oid("1.3.6.1.2.1.2.2.1.10.7"))*8)),-1)</code>
  <descr>**** The inbound rate on interface number 7</descr>
</Function>
</dude>

I’m such a fool - thank you very much!

i modified the script a little bit to:

<?xml version="1.0" ?>
<dude version="4.0beta2">
 <Function>
  <sys-type>57</sys-type>
  <sys-id>73869</sys-id>
  <sys-name>LAG1_RX</sys-name>
  <code>concatenate(\0d\0a   round(\0d\0a      rate(diff32(oid("1.3.6.1.2.1.2.2.1.10.9"))*100/(1024*1024)) +\0d\0a      rate(diff32(oid("1.3.6.1.2.1.2.2.1.10.10"))*100/(1024*1024)) +\0d\0a      rate(diff32(oid("1.3.6.1.2.1.2.2.1.10.11"))*100/(1024*1024)) +\0d\0a      rate(diff32(oid("1.3.6.1.2.1.2.2.1.10.12"))*100/(1024*1024))\0d\0a   )/100\0d\0a, " MByte/s")</code>
  <descr>The inbound rate on interface 9+10+11+12</descr>
 </Function>
</dude>

and:

<?xml version="1.0" ?>
<dude version="4.0beta2">
 <Function>
  <sys-type>57</sys-type>
  <sys-id>74229</sys-id>
  <sys-name>LAG1_TX</sys-name>
  <code>concatenate(\0d\0a   round(\0d\0a      rate(diff32(oid("1.3.6.1.2.1.2.2.1.17.9"))*100/(1024*1024)) +\0d\0a      rate(diff32(oid("1.3.6.1.2.1.2.2.1.17.10"))*100/(1024*1024)) +\0d\0a      rate(diff32(oid("1.3.6.1.2.1.2.2.1.17.11"))*100/(1024*1024)) +\0d\0a      rate(diff32(oid("1.3.6.1.2.1.2.2.1.17.12"))*100/(1024*1024))\0d\0a   )/100\0d\0a, " MByte/s")</code>
  <descr>The outbound rate on interface 9+10+11+12</descr>
 </Function>
</dude>

So is it working good? Just want to hear what your thoughts are on your probe and how well it performs.

Looks interesting, some other folks are wanting to do the same thing.

i just tested it with only one client copying a file from a server…
it was very good
i think there was a latency of about 5 seconds - but that doesn’t matter to me

in a few weeks we’ll have a LAN-Party with 15 Switches to be monitored,
i’ll give you some feedback after it!

Sounds cool :slight_smile: What game?

Battlefield 2 4on4 Infantry
Blobby Volley 1on1
Blur
Call of Duty 4 3on3 SD
Call of Duty 4 3on3 SD HC
Call of Duty 4 4on4 TDM
Call of Duty 4 5on5 SD
Call of Duty 4 5on5 SD
Call of Duty 4 Deathmatch
Call of Duty 4 Deathmatch
Call of Duty 5 3on3 TDM
Call of Duty 5 3on3 TDM
Counter Strike 1.6 2on2
Counter Strike 1.6 2on2
Counter strike 1.6 5on5
Counter strike 1.6 5on5
Counter Strike Source 2on2
Counter Strike Source 2on2
Counter Strike Source 5on5
Counter Strike Source 5on5
FIFA 10 1on1
FIFA 10 1on1
Flatout 2
Flatout 2
Kicker 2on2
Kicker 2on2
Lightgun
Lightgun
Poker Texas Hold’em
Poker Texas Hold’em
Pro Evolution Soccer 2010 1on1
Pro Evolution Soccer 2010 1on1
Quake III DM
Quake III DM
Trackmania Timeattack
Trackmania Timeattack
Unreal Tournamente 2k4
Unreal Tournamente 2k4
Warcraft III 1on1
Warcraft III 1on1
Warcraft III 2on2
Warcraft III 2on2
Warcraft III DotA 1on1
Warcraft III DotA 1on1
Warcraft III DotA 2on2
Warcraft III DotA 2on2
Warcraft III Tower wars
Warcraft III Tower wars
WII Bowling
WII Bowling

and many more!

:slight_smile:

That should be awesome!

hi,

just to give some Feedback:

I don’t know why… but the switches we got, had another Firmware, and i weren’t able to get the SNMP-Requests working :frowning:
So i can’t tell if my script would have worked -_-’

Next try in ~5 month :slight_smile: