Hi friend!
I was check your script, technically a simple view don't exist a problem, but depend of routerOS version the scripting present a error.
If you use any Mikrotik equip whit a routerOS v6 your sintaxis when use the next line:
local pingresult [/ping $pinghost count=5 as-value]
Have a sintax error, because the console can't add "as-value" parameter, so for this version exist a error.
Now if use routerOS v7.18.2 (version I was use to make test and don't have idea last routerOS 7 versions if apply this) in the line need add next parameter "proplist", when use this, can add: avg-rtt, packet-loss, max-rtt and min-rtt. (View proplist image add)
With this parameter you can modify script and obtain your interested data but maybe not showing like interesting, because to use proplist the data stored like this:
.id=*0;max-rtt=00:00:00.000171;.id=*1;max-rtt=00:00:00.000171;.id=*2;max-rtt=00:00:00.000171;.id=*3;max-rtt=00:00:00.000171;.id=*4;max-rtt=00:00:00.000171
So, this is a little detail to use proplist parameter. Maybe a solve is try sum values and print result in another variable, but it's important search how routerOS obtain this results when use a simple ping command
I hope my commentaries can help you.
Regards!
You do not have the required permissions to view the files attached to this post.