bkmz
1
Hello. In my script I want parse ping result.
:global tempping [/ping 192.168.100.89 count=2]
[bkmz@MikroTik] > :put $tempping
2
And I want receive ping result with percent and time
sent=2 received=2 packet-loss=0% min-rtt=0ms avg-rtt=0ms max-rtt=0ms
How can i do this?
packet loss/success percent is easy to pull off:
:local totalsent 10
:local success [/ping count=$totalsent x.x.x.x ]
:put ($success * 100 / $totalsent)
due to the nature of mikrotik’s scripting, the numerical values are always integer (64bit signed integer)
time is a harder nut to crack