From 5f4df221628c3db6bc48727550347bf94b6030fc Mon Sep 17 00:00:00 2001 From: Lucas Manuel Rodriguez Date: Fri, 8 Aug 2025 14:31:25 -0300 Subject: [PATCH] Add connectivity check to osquery-perf (#31735) osquery-perf changes to test agent changes in #31592 --- cmd/osquery-perf/agent.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmd/osquery-perf/agent.go b/cmd/osquery-perf/agent.go index 27d2adafe8..a72d959706 100644 --- a/cmd/osquery-perf/agent.go +++ b/cmd/osquery-perf/agent.go @@ -852,6 +852,8 @@ func (a *agent) runOrbitLoop() { capabilitiesCheckerTicker := time.Tick(5 * time.Minute) // fleet desktop polls for policy compliance every 5 minutes fleetDesktopPolicyTicker := time.Tick(5 * time.Minute) + // fleet desktop pings every 10s for connectivity check. + fleetDesktopConnectivityCheck := time.Tick(10 * time.Second) const windowsMDMEnrollmentAttemptFrequency = time.Hour var lastEnrollAttempt time.Time @@ -921,6 +923,14 @@ func (a *agent) runOrbitLoop() { continue } } + case <-fleetDesktopConnectivityCheck: + if !a.disableFleetDesktop { + if err := deviceClient.Ping(); err != nil { + a.stats.IncrementDesktopErrors() + log.Println("deviceClient.Ping: ", err) + continue + } + } } } }