pouriyajamshidi / tcping

Ping TCP ports using tcping. Inspired by Linux's ping utility. Written in Go
MIT License
578 stars 60 forks source link

add time in output line please #215

Closed liker5092 closed 2 months ago

liker5092 commented 3 months ago

as the title !!

pouriyajamshidi commented 3 months ago

I am not quite sure if I understand what you need. Please provide an example.

liker5092 commented 3 months ago

image

FYI

display time per line.

pouriyajamshidi commented 3 months ago

I'm not sure what value this brings to the tool in general.

The output of tcping tries to follow the ping utility of Linux.

navossoc commented 3 months ago

I'm not sure what value this brings to the tool in general.

The output of tcping tries to follow the ping utility of Linux.

Here it is:

       -D
           Print timestamp (unix time + microseconds as in gettimeofday)
           before each line.

https://www.man7.org/linux/man-pages/man8/ping.8.html

Sample output from ping on linux:

[1721793663.361009] 64 bytes from xxx.xxx.xxx.xxx: icmp_seq=43177 ttl=121 time=7.69 ms
[1721793664.362074] 64 bytes from xxx.xxx.xxx.xxx: icmp_seq=43178 ttl=121 time=7.63 ms
[1721793677.634183] 64 bytes from xxx.xxx.xxx.xxx: icmp_seq=43191 ttl=121 time=7.69 ms
[1721793678.636049] 64 bytes from xxx.xxx.xxx.xxx: icmp_seq=43192 ttl=121 time=7.78 ms
[1721793679.638207] 64 bytes from xxx.xxx.xxx.xxx: icmp_seq=43193 ttl=121 time=8.08 ms

It is extremely useful if you leave some remote machines being pinged for hours and then need to check if there was any loss at a specific time.

The idea is great, I use it a lot, but timestamping with unix time is not very practical, it could even be the default, but it could offer a more human readable format as well.

pouriyajamshidi commented 3 months ago

I see! Was not aware of that option.

Although, you can still get the same information by pressing the Enter key while tcping is running. will show you when was the last failure.

I will see how much work it is to have this implemented.

SYSHIL commented 2 months ago

Hii @pouriyajamshidi could I take this up as a first issue?

pouriyajamshidi commented 2 months ago

Hi @SYSHIL,

Sure, please go ahead.

pouriyajamshidi commented 2 months ago

Implemented in #225