Community discussions

MikroTik App
 
arnchri
just joined
Topic Author
Posts: 3
Joined: Wed Jul 05, 2006 11:50 am

Monitoring ping and RTT

Wed Feb 14, 2007 1:50 pm

Hello,

I want to monitor the RTT value of a ping request.

I've created a new probe :

Available : ping() > 0
Error : if(array_element(ping();1)<200;"";"RTT > 200ms")
Value : ping()
Unit : ms
Rate : none.

The help for the ping function is :
sends icmp echo request, returns array of four elements - rtt, packet size, ttl and error description. rtt, packet size and ttl is -1 if error occurs. Only first parameter mandatory. First paramerter - ip address, second - packet size - default 28, third - ttl - default 255, forth - if true accept replys from any ip address - default false

So I have two questions :
1- is my syntax correct ?
2- if not, could you help me ? :roll:

Thanks for advance,
Best regards.
 
uldis
MikroTik Support
MikroTik Support
Posts: 3446
Joined: Mon May 31, 2004 2:55 pm

Wed Feb 14, 2007 3:34 pm

1) function parameters are separated with commas;
2) first array element is with index 0;
3) ping() function requires at least one parameter - ip address

So you should use some thing like

Available: ping(device_property("FirstAddress")) >= 0

Error: if(array_element(ping(device_property("FirstAddress")), 0) <
200, "", "RTT > 200ms")

Value: ping(device_property("FirstAddress"))
 
arnchri
just joined
Topic Author
Posts: 3
Joined: Wed Jul 05, 2006 11:50 am

Wed Feb 14, 2007 3:54 pm

Now it works great !

Thanks a lot.
 
winkelman
Member Candidate
Member Candidate
Posts: 231
Joined: Wed Aug 16, 2006 5:00 pm
Location: Amsterdam, The Netherlands

Wed Feb 14, 2007 6:42 pm

Hey arnchri,

Please put your final, working probe in this thread: http://forum.mikrotik.com//viewtopic.php?t=12402

A nice please for people to look for 'could be usefull' probe's. As you now know, it can be a hassle to find out how to do certain things. Let's learn from each other :idea:

Who is online

Users browsing this forum: No registered users and 34 guests