From 810b321dbcab12cfe52573566be9580d919c43d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cenk=20K=C4=B1l=C4=B1=C3=A7?= Date: Sat, 18 Jun 2022 18:54:25 +0200 Subject: [PATCH] fix: update health check setup --- pipe/health.go | 7 +++++-- pipe/terminate.go | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pipe/health.go b/pipe/health.go index c1da75c..b177653 100644 --- a/pipe/health.go +++ b/pipe/health.go @@ -51,7 +51,10 @@ func HealthCheckPing(tl *TaskList[Pipe]) *Task[Pipe] { stats := pinger.Statistics() if stats.PacketLoss == 100 { - return fmt.Errorf("Can not reach the upstream DHCP server.") + t.Channel.Fatal <- fmt.Errorf( + "Can not ping the upstream DHCP server: %s", + t.Pipe.Health.DhcpServerAddress, + ) } t.Log.Debugf("Ping health check to %s in avg %s.", stats.IPAddr.String(), stats.AvgRtt) @@ -97,7 +100,7 @@ func HealthCheckDhcpServer(tl *TaskList[Pipe]) *Task[Pipe] { } if process == nil { - t.Channel.Fatal <- fmt.Errorf("SoftEther process is not alive.") + t.Channel.Fatal <- fmt.Errorf("DNSMASQ process is not alive.") } t.Log.Debugf( diff --git a/pipe/terminate.go b/pipe/terminate.go index c2388f0..21c7298 100644 --- a/pipe/terminate.go +++ b/pipe/terminate.go @@ -88,7 +88,7 @@ func TerminateTapInterface(tl *TaskList[Pipe]) *Task[Pipe] { t.Pipe.SoftEther.TapInterface, "down", ). - SetLogLevel(LOG_LEVEL_DEBUG, LOG_LEVEL_DEFAULT, LOG_LEVEL_DEBUG). + SetLogLevel(LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG). AddSelfToTheTask() t.CreateCommand( @@ -97,7 +97,7 @@ func TerminateTapInterface(tl *TaskList[Pipe]) *Task[Pipe] { "delete", t.Pipe.SoftEther.TapInterface, ). - SetLogLevel(LOG_LEVEL_DEBUG, LOG_LEVEL_DEFAULT, LOG_LEVEL_DEBUG). + SetLogLevel(LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG). AddSelfToTheTask() t.CreateCommand( @@ -130,7 +130,7 @@ func TerminateBridgeInterface(tl *TaskList[Pipe]) *Task[Pipe] { t.Pipe.LinuxBridge.BridgeInterface, "down", ). - SetLogLevel(LOG_LEVEL_DEBUG, LOG_LEVEL_DEFAULT, LOG_LEVEL_DEBUG). + SetLogLevel(LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG). AddSelfToTheTask() t.CreateCommand( @@ -138,7 +138,7 @@ func TerminateBridgeInterface(tl *TaskList[Pipe]) *Task[Pipe] { "delbr", t.Pipe.LinuxBridge.BridgeInterface, ). - SetLogLevel(LOG_LEVEL_DEBUG, LOG_LEVEL_DEFAULT, LOG_LEVEL_DEBUG). + SetLogLevel(LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG). AddSelfToTheTask() return nil