diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c0a366b..c403861 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-version: ['1.24'] + go-version: ['1.26'] steps: - name: Checkout code @@ -56,7 +56,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '1.24' + go-version: '1.26' cache: true cache-dependency-path: go.sum @@ -77,7 +77,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '1.24' + go-version: '1.26' cache: true cache-dependency-path: go.sum @@ -99,7 +99,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '1.24' + go-version: '1.26' cache: true cache-dependency-path: go.sum diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a41c9c..29059e2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: '1.24' + go-version: '1.26' cache: true - name: Run GoReleaser uses: goreleaser/goreleaser-action@v6 diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 7e3873d..01791d9 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -18,7 +18,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: '1.24' + go-version: '1.26' cache: true - name: Test GoReleaser Build uses: goreleaser/goreleaser-action@v6 diff --git a/README.md b/README.md index 77a2417..c6f21ed 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,13 @@ mping ![CI](https://github.com/servak/mping/actions/workflows/ci.yml/badge.svg) -**mping** is a multi-target, multi-protocol network monitoring tool that extends traditional ping functionality. Monitor multiple hosts and services simultaneously with real-time statistics and an interactive terminal UI. +**mping** is a `ping` built for network operators: sweep entire subnets, mix ICMP/HTTP/TCP/DNS/NTP checks in a single command, and watch live pass/fail stats in a terminal dashboard — right from the SSH session you're already in. + +![Demo](demo/mping.gif) ## Features +- 🧰 **Built for network ops**: CIDR subnet sweeps, mixed-protocol checks, and a terminal-native dashboard for SSH sessions and jump hosts - 🎯 **Multi-target monitoring**: Monitor dozens of hosts simultaneously - 🌐 **Multi-protocol support**: ICMP, HTTP/HTTPS, TCP, DNS, and NTP monitoring - 📊 **Real-time statistics**: Live success rates, response times, and packet loss @@ -25,10 +28,6 @@ mping | **DNS** | `dns://[server[:port]]/domain[/record_type]` | `dns://8.8.8.8/google.com/A`, `dns:///google.com` | DNS query monitoring | | **NTP** | `ntp://[server[:port]]` | `ntp://pool.ntp.org`, `ntp://time.google.com:123` | Network Time Protocol monitoring | -## Demo - -![Demo](mping.gif) - ## Install https://github.com/servak/mping/releases diff --git a/cmd/mping/main.go b/cmd/mping/main.go index ed46419..2ef4d4a 100644 --- a/cmd/mping/main.go +++ b/cmd/mping/main.go @@ -24,10 +24,12 @@ func Execute() { command.NewConfigCmd(), ) cmd.CompletionOptions.HiddenDefaultCmd = true - cmd.SetOutput(os.Stdout) + cmd.SetOut(os.Stdout) + cmd.SetErr(os.Stdout) if err := cmd.Execute(); err != nil { - cmd.SetOutput(os.Stderr) + cmd.SetOut(os.Stderr) + cmd.SetErr(os.Stderr) cmd.Println(err) os.Exit(1) } diff --git a/demo/demo.tape b/demo/demo.tape new file mode 100644 index 0000000..264f36f --- /dev/null +++ b/demo/demo.tape @@ -0,0 +1,53 @@ +# Regenerate demo/mping.gif (run from the repo root): +# go build -o mping ./cmd/mping/ +# sudo chown root mping && sudo chmod u+s mping # once, so ICMP works without sudo below +# vhs demo/demo.tape + +Output demo/mping.gif + +Set Shell "bash" +Set FontSize 16 +Set Width 1500 +Set Height 560 +Set Padding 20 +Set Theme "Dracula" +Set TypingSpeed 30ms + +# Subnet expansion (CIDR notation expands to individual ICMP targets) +Type "./mping -i 100 192.168.1.1 8.8.8.8 github.com 192.168.1.108/31" +Sleep 1s +Enter +Sleep 2s +Type "v" +Sleep 2s +Type "j" +Sleep 1s +Type "j" +Sleep 1s +Type "j" +Sleep 2s + +Type "q" +Sleep 1s + +# Multi-protocol monitoring +Type@10ms "./mping 192.168.1.1 https://google.com tcp://google.com:443 dns://8.8.8.8/google.com/A ntp://time.cloudflare.com" +Sleep 1500ms +Enter +Sleep 1s +Type "v" +Sleep 3s +Type "j" +Sleep 1s +Type "j" +Sleep 1s +Type "j" +Sleep 1s + +Type "s" +Sleep 1500ms +Type "s" +Sleep 1500ms + +Type "q" +Sleep 1s diff --git a/demo/mping.gif b/demo/mping.gif new file mode 100644 index 0000000..b80f2da Binary files /dev/null and b/demo/mping.gif differ diff --git a/go.mod b/go.mod index 9b6fd19..56b69a2 100644 --- a/go.mod +++ b/go.mod @@ -1,32 +1,32 @@ module github.com/servak/mping -go 1.24 +go 1.26 require ( - github.com/gdamore/tcell/v2 v2.8.1 - github.com/jedib0t/go-pretty/v6 v6.4.6 - github.com/miekg/dns v1.1.66 - github.com/rivo/tview v0.0.0-20250625164341-a4a78f1e05cb - github.com/spf13/cobra v1.7.0 - golang.org/x/net v0.41.0 + github.com/gdamore/tcell/v2 v2.13.10 + github.com/jedib0t/go-pretty/v6 v6.8.2 + github.com/miekg/dns v1.1.72 + github.com/rivo/tview v0.42.0 + github.com/spf13/cobra v1.10.2 + golang.org/x/net v0.56.0 gopkg.in/yaml.v3 v3.0.1 ) require ( + github.com/clipperhouse/uax29/v2 v2.7.0 // indirect github.com/gdamore/encoding v1.0.1 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kr/text v0.2.0 // indirect - github.com/lucasb-eyer/go-colorful v1.2.0 // indirect - github.com/mattn/go-runewidth v0.0.16 // indirect + github.com/lucasb-eyer/go-colorful v1.4.0 // indirect + github.com/mattn/go-runewidth v0.0.24 // indirect github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect github.com/rivo/uniseg v0.4.7 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/testify v1.8.2 // indirect - golang.org/x/mod v0.25.0 // indirect - golang.org/x/sync v0.15.0 // indirect - golang.org/x/sys v0.33.0 // indirect - golang.org/x/term v0.32.0 // indirect - golang.org/x/text v0.26.0 // indirect - golang.org/x/tools v0.33.0 // indirect + github.com/spf13/pflag v1.0.10 // indirect + golang.org/x/mod v0.37.0 // indirect + golang.org/x/sync v0.21.0 // indirect + golang.org/x/sys v0.46.0 // indirect + golang.org/x/term v0.44.0 // indirect + golang.org/x/text v0.38.0 // indirect + golang.org/x/tools v0.47.0 // indirect gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect ) diff --git a/go.sum b/go.sum index a9b3692..6a8976f 100644 --- a/go.sum +++ b/go.sum @@ -1,133 +1,93 @@ -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk= +github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM= +github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/gdamore/encoding v1.0.1 h1:YzKZckdBL6jVt2Gc+5p82qhrGiqMdG/eNs6Wy0u3Uhw= github.com/gdamore/encoding v1.0.1/go.mod h1:0Z0cMFinngz9kS1QfMjCP8TY7em3bZYeeklsSDPivEo= -github.com/gdamore/tcell/v2 v2.8.1 h1:KPNxyqclpWpWQlPLx6Xui1pMk8S+7+R37h3g07997NU= -github.com/gdamore/tcell/v2 v2.8.1/go.mod h1:bj8ori1BG3OYMjmb3IklZVWfZUJ1UBQt9JXrOCOhGWw= +github.com/gdamore/tcell/v2 v2.13.10 h1:Afs3JKt83HnhuUKdZ3MnxUgOqQRWftj5JyDqv1LLynA= +github.com/gdamore/tcell/v2 v2.13.10/go.mod h1:+Wfe208WDdB7INEtCsNrAN6O2m+wsTPk1RAovjaILlo= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/jedib0t/go-pretty/v6 v6.4.6 h1:v6aG9h6Uby3IusSSEjHaZNXpHFhzqMmjXcPq1Rjl9Jw= -github.com/jedib0t/go-pretty/v6 v6.4.6/go.mod h1:Ndk3ase2CkQbXLLNf5QDHoYb6J9WtVfmHZu9n8rk2xs= +github.com/jedib0t/go-pretty/v6 v6.8.2 h1:FmKNr1GOyot/zqNQplE8HLhFguJaeHJTCArntnI4uxE= +github.com/jedib0t/go-pretty/v6 v6.8.2/go.mod h1:YwC5CE4fJ1HFUDeivSV1r//AmANFHyqczZk+U6BDALU= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= -github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= -github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= -github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/miekg/dns v1.1.66 h1:FeZXOS3VCVsKnEAd+wBkjMC3D2K+ww66Cq3VnCINuJE= -github.com/miekg/dns v1.1.66/go.mod h1:jGFzBsSNbJw6z1HYut1RKBKHA9PBdxeHrZG8J+gC2WE= +github.com/lucasb-eyer/go-colorful v1.4.0 h1:UtrWVfLdarDgc44HcS7pYloGHJUjHV/4FwW4TvVgFr4= +github.com/lucasb-eyer/go-colorful v1.4.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= +github.com/mattn/go-runewidth v0.0.24 h1:cpokDiIn0MGnhdHwuWnJBITySJ20QyNGnY2kR/ay2DU= +github.com/mattn/go-runewidth v0.0.24/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= +github.com/miekg/dns v1.1.72 h1:vhmr+TF2A3tuoGNkLDFK9zi36F2LS+hKTRW0Uf8kbzI= +github.com/miekg/dns v1.1.72/go.mod h1:+EuEPhdHOsfk6Wk5TT2CzssZdqkmFhf8r+aVyDEToIs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rivo/tview v0.0.0-20250625164341-a4a78f1e05cb h1:n7UJ8X9UnrTZBYXnd1kAIBc067SWyuPIrsocjketYW8= -github.com/rivo/tview v0.0.0-20250625164341-a4a78f1e05cb/go.mod h1:cSfIYfhpSGCjp3r/ECJb+GKS7cGJnqV8vfjQPwoXyfY= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rivo/tview v0.42.0 h1:b/ftp+RxtDsHSaynXTbJb+/n/BxDEi+W3UfF5jILK6c= +github.com/rivo/tview v0.42.0/go.mod h1:cSfIYfhpSGCjp3r/ECJb+GKS7cGJnqV8vfjQPwoXyfY= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.4/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU= +github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4= +github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= +github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w= -golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= +golang.org/x/mod v0.37.0 h1:vF1DjpVEshcIqoEaauuHebaLk1O1forxjxBaVn884JQ= +golang.org/x/mod v0.37.0/go.mod h1:m8S8VeM9r4dzDwjrKO0a1sZP3YjeMamRRlD+fmR2Q/0= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw= -golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA= +golang.org/x/net v0.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o= +golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8= -golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM= +golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= -golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= +golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= +golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= -golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg= -golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ= +golang.org/x/term v0.44.0 h1:0rLvDRCtNj0gZkyIXhCyOb2OAzEhLVqc4B+hrsBhrmc= +golang.org/x/term v0.44.0/go.mod h1:7ze4MdzUzLXpSAoFP1H0bOI9aXDqveSvatT5vKcFh2Y= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= -golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= +golang.org/x/text v0.38.0 h1:sXmwo9DwP3OK9EZ7PqAdaooSGozfl/3a6/xJcbzPRhE= +golang.org/x/text v0.38.0/go.mod h1:YXZt3QhHUKYT53r2lLKFIVi6Ao1jdzrTR/KQ09qyxF4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= -golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc= -golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI= +golang.org/x/tools v0.47.0 h1:7Kn5x/d1svx/PzryTsqeoZN4TZwqeH5pGWjefhLi/1Q= +golang.org/x/tools v0.47.0/go.mod h1:dFHnyTvFWY212G+h7ZY4Vsp/K3U4/7W9TyVaAul8uCA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/command/batch.go b/internal/command/batch.go index e561dff..e08c0d7 100644 --- a/internal/command/batch.go +++ b/internal/command/batch.go @@ -61,7 +61,10 @@ mping batch dns://8.8.8.8/google.com`, return nil } - cfg, _ := config.LoadFile(path) + cfg, err := config.LoadFile(path) + if cfg == nil { + return fmt.Errorf("failed to load config %q: %w", path, err) + } _interval := time.Duration(interval) * time.Millisecond _timeout := time.Duration(timeout) * time.Millisecond @@ -76,7 +79,7 @@ mping batch dns://8.8.8.8/google.com`, } // Subscribe to events for metrics collection - metricsManager.Subscribe(probeManager.Events()) + done := metricsManager.Subscribe(probeManager.Events()) // Start probing with timeout context ctx, cancel := context.WithTimeout(context.Background(), time.Duration(counter)*_interval) @@ -98,6 +101,7 @@ mping batch dns://8.8.8.8/google.com`, // Stop probing probeManager.Stop() + <-done // wait for in-flight metric updates to settle cmd.Print("\r") metrics := metricsManager.SortBy(stats.Success, true) tableData := shared.NewTableData(metrics, stats.Success, true) diff --git a/internal/command/config.go b/internal/command/config.go index a7682c4..a631375 100644 --- a/internal/command/config.go +++ b/internal/command/config.go @@ -31,10 +31,13 @@ func NewPrintConfigCmd() *cobra.Command { RunE: func(cmd *cobra.Command, args []string) error { flags := cmd.Flags() path, err := flags.GetString("config") - cfg, _ := config.LoadFile(path) if err != nil { return err } + cfg, err := config.LoadFile(path) + if cfg == nil { + return fmt.Errorf("failed to load config %q: %w", path, err) + } cmd.Print(config.Marshal(cfg)) return nil }, diff --git a/internal/command/mping.go b/internal/command/mping.go index ea97a3c..538f7ae 100644 --- a/internal/command/mping.go +++ b/internal/command/mping.go @@ -68,7 +68,10 @@ mping dns://8.8.8.8/google.com`, return nil } - cfg, _ := config.LoadFile(path) + cfg, err := config.LoadFile(path) + if cfg == nil { + return fmt.Errorf("failed to load config %q: %w", path, err) + } cfg.SetTitle(title) cfg.SetSourceInterface(sourceInterface) _interval := time.Duration(interval) * time.Millisecond @@ -85,7 +88,7 @@ mping dns://8.8.8.8/google.com`, } // Subscribe to events for metrics collection - metricsManager.Subscribe(probeManager.Events()) + done := metricsManager.Subscribe(probeManager.Events()) // Start probing in background ctx, cancel := context.WithCancel(context.Background()) @@ -102,6 +105,7 @@ mping dns://8.8.8.8/google.com`, // Stop probing when TUI exits probeManager.Stop() + <-done // wait for in-flight metric updates to settle // Final results metrics := metricsManager.SortBy(stats.Fail, false) diff --git a/internal/prober/dns.go b/internal/prober/dns.go index 596a39f..9f8651d 100644 --- a/internal/prober/dns.go +++ b/internal/prober/dns.go @@ -184,6 +184,7 @@ func (p *DNSProber) Start(result chan *Event, interval, timeout time.Duration) e go func() { defer p.wg.Done() for _, target := range p.targets { + p.wg.Add(1) go p.sendProbe(result, target, timeout) } for { @@ -193,6 +194,7 @@ func (p *DNSProber) Start(result chan *Event, interval, timeout time.Duration) e return case <-ticker.C: for _, target := range p.targets { + p.wg.Add(1) go p.sendProbe(result, target, timeout) } } @@ -208,7 +210,6 @@ func (p *DNSProber) Stop() { } func (p *DNSProber) sendProbe(result chan *Event, target *DNSTarget, timeout time.Duration) { - p.wg.Add(1) defer p.wg.Done() now := time.Now() diff --git a/internal/prober/http.go b/internal/prober/http.go index 2aa2ee4..c7607af 100644 --- a/internal/prober/http.go +++ b/internal/prober/http.go @@ -30,11 +30,11 @@ type ( } HTTPConfig struct { - Header http.Header `yaml:"headers,omitempty"` - ExpectCodes string `yaml:"expect_codes"` // Range/list: "200,201,202", "200-299" - ExpectBody string `yaml:"expect_body,omitempty"` - TLS *TLSConfig `yaml:"tls,omitempty"` - RedirectOFF bool `yaml:"redirect_off,omitempty"` + Header map[string]string `yaml:"headers,omitempty"` + ExpectCodes string `yaml:"expect_codes"` // Range/list: "200,201,202", "200-299" + ExpectBody string `yaml:"expect_body,omitempty"` + TLS *TLSConfig `yaml:"tls,omitempty"` + RedirectOFF bool `yaml:"redirect_off,omitempty"` } TLSConfig struct { @@ -43,7 +43,7 @@ type ( customTransport struct { transport http.RoundTripper - headers http.Header + headers map[string]string } ) @@ -153,7 +153,6 @@ func (p *HTTPProber) failed(r chan *Event, target string, now time.Time, err err } func (p *HTTPProber) probe(r chan *Event, target string) { - p.wg.Add(1) defer p.wg.Done() now := time.Now() p.sent(r, target) @@ -240,6 +239,7 @@ func (p *HTTPProber) Start(r chan *Event, interval, timeout time.Duration) error go func() { defer p.wg.Done() for _, target := range p.targets { + p.wg.Add(1) go p.probe(r, target) } for { @@ -248,6 +248,7 @@ func (p *HTTPProber) Start(r chan *Event, interval, timeout time.Duration) error return case <-ticker.C: for _, target := range p.targets { + p.wg.Add(1) go p.probe(r, target) } } @@ -263,7 +264,7 @@ func (p *HTTPProber) Stop() { func (c *customTransport) RoundTrip(req *http.Request) (*http.Response, error) { for k, v := range c.headers { - req.Header[k] = v + req.Header.Set(k, v) } return c.transport.RoundTrip(req) } diff --git a/internal/prober/icmp.go b/internal/prober/icmp.go index b8295bc..92202af 100644 --- a/internal/prober/icmp.go +++ b/internal/prober/icmp.go @@ -269,7 +269,7 @@ func formatPayloadContent(data []byte) string { if b >= 32 && b <= 126 { // Printable ASCII characters result.WriteByte(b) } else { - result.WriteString(fmt.Sprintf("\\x%02x", b)) + fmt.Fprintf(&result, "\\x%02x", b) } } diff --git a/internal/prober/ntp.go b/internal/prober/ntp.go index 564fe70..5040679 100644 --- a/internal/prober/ntp.go +++ b/internal/prober/ntp.go @@ -150,6 +150,7 @@ func (p *NTPProber) Start(result chan *Event, interval, timeout time.Duration) e go func() { defer p.wg.Done() for serverAddr := range p.targets { + p.wg.Add(1) go p.sendProbe(result, serverAddr, timeout) } for { @@ -159,6 +160,7 @@ func (p *NTPProber) Start(result chan *Event, interval, timeout time.Duration) e return case <-ticker.C: for serverAddr := range p.targets { + p.wg.Add(1) go p.sendProbe(result, serverAddr, timeout) } } @@ -174,7 +176,6 @@ func (p *NTPProber) Stop() { } func (p *NTPProber) sendProbe(result chan *Event, serverAddr string, timeout time.Duration) { - p.wg.Add(1) defer p.wg.Done() now := time.Now() diff --git a/internal/prober/tcp.go b/internal/prober/tcp.go index 0cbe732..66a0aeb 100644 --- a/internal/prober/tcp.go +++ b/internal/prober/tcp.go @@ -84,6 +84,7 @@ func (p *TCPProber) Start(result chan *Event, interval, timeout time.Duration) e go func() { defer p.wg.Done() for target := range p.targets { + p.wg.Add(1) go p.sendProbe(result, target, timeout) } for { @@ -93,6 +94,7 @@ func (p *TCPProber) Start(result chan *Event, interval, timeout time.Duration) e return case <-ticker.C: for target := range p.targets { + p.wg.Add(1) go p.sendProbe(result, target, timeout) } } @@ -108,6 +110,8 @@ func (p *TCPProber) Stop() { } func (p *TCPProber) sendProbe(result chan *Event, target string, timeout time.Duration) { + defer p.wg.Done() + // target is already in "ip:port" format from Accept method now := time.Now() p.sent(result, target, now) diff --git a/internal/stats/interface.go b/internal/stats/interface.go index 2e0a8da..4866d7a 100644 --- a/internal/stats/interface.go +++ b/internal/stats/interface.go @@ -42,7 +42,11 @@ type MetricsSystemManager interface { // MetricsEventRecorder handles internal event recording type MetricsEventRecorder interface { Register(target, name string) - Subscribe(<-chan *prober.Event) + // Subscribe processes events from the channel until it is closed and + // drained. The returned channel is closed once processing has finished, + // so callers can wait for in-flight metric updates to settle before + // reading final results. + Subscribe(<-chan *prober.Event) <-chan struct{} } // MetricsManager provides comprehensive metrics management (for backward compatibility) diff --git a/internal/stats/manager.go b/internal/stats/manager.go index 2b388fd..7905107 100644 --- a/internal/stats/manager.go +++ b/internal/stats/manager.go @@ -35,6 +35,9 @@ func NewMetricsManagerWithHistorySize(historySize int) MetricsManager { } func (mm *metricsManager) Register(target, name string) { + mm.mu.Lock() + defer mm.mu.Unlock() + v, ok := mm.metrics[target] if ok && v.Name != target { return @@ -127,8 +130,10 @@ func (mm *metricsManager) Sent(host string) { mm.mu.Unlock() } -func (mm *metricsManager) Subscribe(res <-chan *prober.Event) { +func (mm *metricsManager) Subscribe(res <-chan *prober.Event) <-chan struct{} { + done := make(chan struct{}) go func() { + defer close(done) for r := range res { switch r.Result { case prober.REGISTER: @@ -144,6 +149,7 @@ func (mm *metricsManager) Subscribe(res <-chan *prober.Event) { } } }() + return done } // autoRegister automatically registers target if not already registered @@ -162,11 +168,11 @@ func (mm *metricsManager) autoRegister(key, displayName string) { // SortBy sorts metrics by specified key and returns Metrics slice func (mm *metricsManager) SortBy(k Key, ascending bool) []Metrics { mm.mu.Lock() + defer mm.mu.Unlock() var res []Metrics for _, m := range mm.metrics { res = append(res, m) } - mm.mu.Unlock() if k != Host { sort.SliceStable(res, func(i, j int) bool { diff --git a/internal/ui/shared/formatters.go b/internal/ui/shared/formatters.go index 90c84d2..241b0d2 100644 --- a/internal/ui/shared/formatters.go +++ b/internal/ui/shared/formatters.go @@ -90,9 +90,9 @@ func FormatHistory(metric stats.Metrics, theme *Theme) string { } var sb strings.Builder - sb.WriteString(fmt.Sprintf("\n[%s]Recent History (last 10 entries):[%s]\n", theme.Warning, theme.Primary)) - sb.WriteString(fmt.Sprintf("[%s]Time Status RTT Details[%s]\n", theme.Accent, theme.Primary)) - sb.WriteString(fmt.Sprintf("[%s]-------- ------ ------- --------[%s]\n", theme.Separator, theme.Primary)) + fmt.Fprintf(&sb, "\n[%s]Recent History (last 10 entries):[%s]\n", theme.Warning, theme.Primary) + fmt.Fprintf(&sb, "[%s]Time Status RTT Details[%s]\n", theme.Accent, theme.Primary) + fmt.Fprintf(&sb, "[%s]-------- ------ ------- --------[%s]\n", theme.Separator, theme.Primary) for _, entry := range history { statusColor := theme.Success @@ -111,12 +111,12 @@ func FormatHistory(metric stats.Metrics, theme *Theme) string { details = formatProbeDetails(entry.Details) } - sb.WriteString(fmt.Sprintf("[%s]%-8s[%s] [%s]%-6s[%s] %-7s %s\n", + fmt.Fprintf(&sb, "[%s]%-8s[%s] [%s]%-6s[%s] %-7s %s\n", theme.Timestamp, entry.Timestamp.Format("15:04:05"), theme.Primary, statusColor, status, theme.Primary, DurationFormater(entry.RTT), details, - )) + ) } return sb.String() diff --git a/internal/ui/tui/panels/host_list.go b/internal/ui/tui/panels/host_list.go index 27930a5..2f740db 100644 --- a/internal/ui/tui/panels/host_list.go +++ b/internal/ui/tui/panels/host_list.go @@ -149,9 +149,11 @@ func (h *HostListPanel) SetSelectionChangeCallback(fn func(metrics stats.Metrics // Navigation methods func (h *HostListPanel) ScrollDown() { row, _ := h.table.GetSelection() - h.table.Select(row+1, 0) - // Update selection state directly - h.updateSelectedHost() + if row+1 < h.table.GetRowCount() { + h.table.Select(row+1, 0) + // Update selection state directly + h.updateSelectedHost() + } } func (h *HostListPanel) ScrollUp() { diff --git a/mping.gif b/mping.gif deleted file mode 100644 index de7e963..0000000 Binary files a/mping.gif and /dev/null differ