This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

MikroTik API Lua library
#11
(09.12.2020, 07:19)admin Wrote: For bandwidth test you need to use readlist because MT will report test result every second (this also means that the timeout value should not be changed). The last element of res table will contain the final result.
Code:
res, err = mt:readlist('/tool/bandwidth-test', '=address=38.104.52.187', '=duration=10s', '=direction=both', '=protocol=tcp', '=user=btest', '=password=btest')
testresults = res[ #res ]
log(testresults, err)

Perfect! 

Thanks!!
Reply


Messages In This Thread
MikroTik API Lua library - by admin - 20.10.2020, 06:57
RE: MikroTik API Lua library - by FatMax - 20.10.2020, 11:48
RE: MikroTik API Lua library - by admin - 20.10.2020, 12:13
RE: MikroTik API Lua library - by DGrandes - 03.12.2020, 17:45
RE: MikroTik API Lua library - by admin - 04.12.2020, 07:35
RE: MikroTik API Lua library - by DGrandes - 07.12.2020, 13:11
RE: MikroTik API Lua library - by admin - 07.12.2020, 13:49
RE: MikroTik API Lua library - by DGrandes - 07.12.2020, 15:03
RE: MikroTik API Lua library - by admin - 09.12.2020, 07:19
RE: MikroTik API Lua library - by DGrandes - 09.12.2020, 08:09
RE: MikroTik API Lua library - by FatMax - 07.01.2021, 23:20
RE: MikroTik API Lua library - by Igori - 10.01.2021, 15:45
RE: MikroTik API Lua library - by admin - 11.01.2021, 08:07
RE: MikroTik API Lua library - by Igori - 11.01.2021, 19:50
RE: MikroTik API Lua library - by edgars - 26.08.2021, 08:28

Forum Jump: