From ee6b7a87632aa9a309aec91d65fd40d43919a92c Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Sun, 5 Apr 2026 11:47:08 +0700 Subject: [PATCH] New checker: ICMP ping checker with RTT and packet loss metrics --- checkers/ping.go | 32 ++++++++++++++++++++++++++++++++ cmd/happyDomain/main.go | 1 + go.mod | 1 + 3 files changed, 34 insertions(+) create mode 100644 checkers/ping.go diff --git a/checkers/ping.go b/checkers/ping.go new file mode 100644 index 00000000..c289d892 --- /dev/null +++ b/checkers/ping.go @@ -0,0 +1,32 @@ +// This file is part of the happyDomain (R) project. +// Copyright (c) 2020-2026 happyDomain +// Authors: Pierre-Olivier Mercier, et al. +// +// This program is offered under a commercial and under the AGPL license. +// For commercial licensing, contact us at . +// +// For AGPL licensing: +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package checkers + +import ( + ping "git.happydns.org/checker-ping/checker" + "git.happydns.org/happyDomain/internal/checker" +) + +func init() { + checker.RegisterObservationProvider(ping.Provider()) + checker.RegisterExternalizableChecker(ping.Definition()) +} diff --git a/cmd/happyDomain/main.go b/cmd/happyDomain/main.go index 30cffc04..6d8285c9 100644 --- a/cmd/happyDomain/main.go +++ b/cmd/happyDomain/main.go @@ -30,6 +30,7 @@ import ( "github.com/earthboundkid/versioninfo/v2" "github.com/fatih/color" + _ "git.happydns.org/happyDomain/checkers" "git.happydns.org/happyDomain/internal/api/controller" "git.happydns.org/happyDomain/internal/app" "git.happydns.org/happyDomain/internal/config" diff --git a/go.mod b/go.mod index ca1f11c5..fe9da664 100644 --- a/go.mod +++ b/go.mod @@ -183,6 +183,7 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/pquerna/otp v1.5.0 // indirect + github.com/prometheus-community/pro-bing v0.8.0 // indirect github.com/prometheus/client_golang v1.23.2 // indirect github.com/prometheus/client_model v0.6.2 // indirect github.com/prometheus/common v0.67.5 // indirect