Community discussions

MikroTik App
 
P00HB33R
just joined
Topic Author
Posts: 21
Joined: Tue Aug 10, 2021 4:20 pm

Remote SSH Ping, Get Count

Sun Jul 24, 2022 11:27 am

Hi All,

I am working on a script for failover reasons. I wish to get the the count of successful pings from a remote mikrotik to a remote host. Currently the command I am using is:
/system ssh-exec address=***.***.***.*** command=":put ([/ping 192.168.254.1 interface=vlan10 count=5])"
This returns the following:

|exit-code: 0
output: SEQ HOST SIZE TTL TIME STATUS 0 ***.***.***.*** 56 64 5ms35us 1 ***.***.***.*** 56 64 5ms98us 2 ***.***.***.*** 56 64 5ms54us 3
***.***.***.*** 56 64 5ms84us 4 ***.***.***.*** 56 64 5ms181us sent=5 received=5 packet-loss=0% min-rtt=5ms35us avg-rtt=5ms90us
max-rtt=5ms181us 5
|
All I need to get is the number of successful pings. I have googled A LOT, and cant seem to get an answer. Any help regarding extracting values from a ssh-exec result would be highly appreciated.

Thanks in advance

Who is online

Users browsing this forum: ko00000000001 and 27 guests