I
I
Ivan2019-04-05 13:05:13
Ping
Ivan, 2019-04-05 13:05:13

How to write a simple script for mikrotik with ping results logging?

There is a simple batch file that allows you to log the result of a ping line by line, indicating the time:

for /l %%i in (0,0,1) do @cmd /c "echo.|set/p=%%DATE%%  %%TIME:~0,8^%%"  >> ping_192.168.100.22.log & ping -n 1 192.168.100.22 | find "TTL" >> ping_192.168.100.22.log & ping -n 2 localhost > nul

Generates a log like:
04/05/2019 16:10:30 Response from 192.168.100.22: number of bytes=32 time=1ms TTL=128
04/05/2019 16:10:31 Response from 192.168.100.22: number of bytes=32 time=1ms TTL=128
05.04. 2019 16:10:32 Response from 192.168.100.22: number of bytes=32 time=1ms TTL=128

How to implement this on mikrotik?
The task is to get a log with delay times for subsequent parsing and analysis

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Wexter, 2019-04-05
@Wexter

https://wiki.mikrotik.com/wiki/Manual:Scripting
https://wiki.mikrotik.com/wiki/Manual:Scripting-ex...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question