مهران میرزایی
مهران میرزایی
خواندن ۲ دقیقه·۲ سال پیش

How to command "Ping" display time and date of ping


ping 8.8.8.8 -t | bash -c 'trap "" INT; awk "{print strftime(\"%c - \") \$0}"'

Thu Jan 26 01:59:12 2023 -

Thu Jan 26 01:59:12 2023 - Pinging 8.8.8.8 with 32 bytes of data:

Thu Jan 26 01:59:12 2023 - Reply from 8.8.8.8: bytes=32 time=57ms TTL=111

Thu Jan 26 01:59:12 2023 - Reply from 8.8.8.8: bytes=32 time=56ms TTL=111

Thu Jan 26 01:59:13 2023 - Reply from 8.8.8.8: bytes=32 time=57ms TTL=111

Thu Jan 26 01:59:14 2023 - Reply from 8.8.8.8: bytes=32 time=58ms TTL=111

Thu Jan 26 01:59:15 2023 - Reply from 8.8.8.8: bytes=32 time=58ms TTL=111

Thu Jan 26 01:59:16 2023 - Reply from 8.8.8.8: bytes=32 time=59ms TTL=111

Thu Jan 26 01:59:17 2023 - Reply from 8.8.8.8: bytes=32 time=58ms TTL=111

Thu Jan 26 01:59:18 2023 - Reply from 8.8.8.8: bytes=32 time=57ms TTL=111

Thu Jan 26 01:59:19 2023 - Reply from 8.8.8.8: bytes=32 time=56ms TTL=111

Thu Jan 26 01:59:20 2023 - Reply from 8.8.8.8: bytes=32 time=58ms TTL=111

Thu Jan 26 01:59:20 2023 -

Thu Jan 26 01:59:20 2023 - Ping statistics for 8.8.8.8:

Thu Jan 26 01:59:20 2023 - Packets: Sent = 10, Received = 10, Lost = 0 (0% loss),

Thu Jan 26 01:59:20 2023 - Approximate round trip times in milli-seconds:

Thu Jan 26 01:59:20 2023 - Minimum = 56ms, Maximum = 59ms, Average = 57ms



ping 8.8.8.8 -t | gawk '{print strftime("%c: ") $0}'

Thu, Jan 26, 2023 1:59:52 AM:

Thu, Jan 26, 2023 1:59:52 AM: Pinging 8.8.8.8 with 32 bytes of data:

Thu, Jan 26, 2023 1:59:52 AM: Reply from 8.8.8.8: bytes=32 time=57ms TTL=111

Thu, Jan 26, 2023 1:59:53 AM: Reply from 8.8.8.8: bytes=32 time=57ms TTL=111

Thu, Jan 26, 2023 1:59:54 AM: Reply from 8.8.8.8: bytes=32 time=62ms TTL=111

Thu, Jan 26, 2023 1:59:55 AM: Reply from 8.8.8.8: bytes=32 time=57ms TTL=111

Thu, Jan 26, 2023 1:59:56 AM: Reply from 8.8.8.8: bytes=32 time=58ms TTL=111

pingawkping with datetimemonitoring
MikroTik Certified Consultant (MTCNA , MTCWE)
شاید از این پست‌ها خوشتان بیاید