From 477a15a4582d042c9882e846529e4b3946efc45f Mon Sep 17 00:00:00 2001 From: Chris Grindstaff Date: Wed, 4 Mar 2026 09:47:02 -0500 Subject: [PATCH 1/3] feat: Harvest should monitor fabric link status Thanks to dhirajmalkari for reporting! --- .../rest/plugins/snapmirror/snapmirror.go | 28 +++++++++++++++++++ conf/rest/9.12.0/snapmirror.yaml | 2 ++ 2 files changed, 30 insertions(+) diff --git a/cmd/collectors/rest/plugins/snapmirror/snapmirror.go b/cmd/collectors/rest/plugins/snapmirror/snapmirror.go index ba4807b6b..9cdd797a1 100644 --- a/cmd/collectors/rest/plugins/snapmirror/snapmirror.go +++ b/cmd/collectors/rest/plugins/snapmirror/snapmirror.go @@ -113,6 +113,8 @@ func (m *SnapMirror) Run(dataMap map[string]*matrix.Matrix) ([]*matrix.Matrix, * m.updateSMLabels(data) m.currentVal++ + m.checkFabricLinkStatus(data) + return []*matrix.Matrix{m.data}, m.client.Metadata, nil } @@ -291,3 +293,29 @@ func (m *SnapMirror) handleSVMDRRelationships(data *matrix.Matrix, keys []string } } } + +func (m *SnapMirror) checkFabricLinkStatus(data *matrix.Matrix) { + for _, instance := range data.GetInstances() { + if !instance.IsExportable() { + continue + } + flStatus := strings.TrimSpace(instance.GetLabel("fl_status")) + // check if the fabric link status is healthy or not. Healthy looks like this: + // - FabricLink Status: active: 33 objects to transfer, pushing 19.9MB; throughput 25.5MB/sec, 16 ops/sec + // - FabricLink Status: ok; throughput 11.9MB/sec, 11 ops/sec + // - FabricLink Status: ok; throughput 11.9MB/sec, 11 ops/sec + // - FabricLink Status: ok + // - FabricLink Status is empty + // Unhealthy looks like this: + // - FabricLink Status: 20m overdue: 9 objects to transfer, pushing 9.4kb + + flIsHealthy := flStatus == "" || strings.Contains(flStatus, "ok") || strings.Contains(flStatus, "active") + health := instance.GetLabel("healthy") + + // Then set fl_healthy label to true only if healthy label is also true and fabric link status is healthy. Otherwise, set it to false. + instance.SetLabel("fl_healthy", "false") + if flIsHealthy && health == "true" { + instance.SetLabel("fl_healthy", "true") + } + } +} diff --git a/conf/rest/9.12.0/snapmirror.yaml b/conf/rest/9.12.0/snapmirror.yaml index f996679cf..2c39d2ccf 100644 --- a/conf/rest/9.12.0/snapmirror.yaml +++ b/conf/rest/9.12.0/snapmirror.yaml @@ -11,6 +11,7 @@ counters: - ^destination_volume => destination_volume - ^destination_volume_node => destination_node - ^destination_vserver => destination_vserver + - ^fl_status => fl_status - ^healthy => healthy - ^last_transfer_type => last_transfer_type - ^policy_type => policy_type @@ -64,6 +65,7 @@ export_options: instance_labels: - derived_relationship_type - destination_cg_name + - fl_healthy - group_type - healthy - last_transfer_error From 46aa9bc97ca8b0f73456c988d185f03e53859b11 Mon Sep 17 00:00:00 2001 From: Chris Grindstaff Date: Wed, 4 Mar 2026 09:56:10 -0500 Subject: [PATCH 2/3] feat: Harvest should monitor fabric link status Thanks to dhirajmalkari for reporting! --- cmd/collectors/rest/plugins/snapmirror/snapmirror.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/collectors/rest/plugins/snapmirror/snapmirror.go b/cmd/collectors/rest/plugins/snapmirror/snapmirror.go index 9cdd797a1..374d45941 100644 --- a/cmd/collectors/rest/plugins/snapmirror/snapmirror.go +++ b/cmd/collectors/rest/plugins/snapmirror/snapmirror.go @@ -109,6 +109,8 @@ func (m *SnapMirror) Run(dataMap map[string]*matrix.Matrix) ([]*matrix.Matrix, * } } + m.checkFabricLinkStatus(data) + // update volume instance labels m.updateSMLabels(data) m.currentVal++ @@ -309,7 +311,7 @@ func (m *SnapMirror) checkFabricLinkStatus(data *matrix.Matrix) { // Unhealthy looks like this: // - FabricLink Status: 20m overdue: 9 objects to transfer, pushing 9.4kb - flIsHealthy := flStatus == "" || strings.Contains(flStatus, "ok") || strings.Contains(flStatus, "active") + flIsHealthy := flStatus == "" || strings.HasPrefix(flStatus, "ok") || strings.Contains(flStatus, "active") health := instance.GetLabel("healthy") // Then set fl_healthy label to true only if healthy label is also true and fabric link status is healthy. Otherwise, set it to false. From 19603419cc62a09de7bdbda3162261d9858f1aab Mon Sep 17 00:00:00 2001 From: Chris Grindstaff Date: Wed, 4 Mar 2026 10:21:16 -0500 Subject: [PATCH 3/3] feat: Harvest should monitor fabric link status Thanks to dhirajmalkari for reporting! --- cmd/collectors/rest/plugins/snapmirror/snapmirror.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/cmd/collectors/rest/plugins/snapmirror/snapmirror.go b/cmd/collectors/rest/plugins/snapmirror/snapmirror.go index 374d45941..25c282bd8 100644 --- a/cmd/collectors/rest/plugins/snapmirror/snapmirror.go +++ b/cmd/collectors/rest/plugins/snapmirror/snapmirror.go @@ -109,14 +109,11 @@ func (m *SnapMirror) Run(dataMap map[string]*matrix.Matrix) ([]*matrix.Matrix, * } } - m.checkFabricLinkStatus(data) - // update volume instance labels m.updateSMLabels(data) m.currentVal++ m.checkFabricLinkStatus(data) - return []*matrix.Matrix{m.data}, m.client.Metadata, nil }