Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions cmd/collectors/rest/plugins/snapmirror/snapmirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ 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
}

Expand Down Expand Up @@ -291,3 +292,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.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.
instance.SetLabel("fl_healthy", "false")
if flIsHealthy && health == "true" {
instance.SetLabel("fl_healthy", "true")
}
}
}
2 changes: 2 additions & 0 deletions conf/rest/9.12.0/snapmirror.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -64,6 +65,7 @@ export_options:
instance_labels:
- derived_relationship_type
- destination_cg_name
- fl_healthy
- group_type
- healthy
- last_transfer_error
Expand Down
Loading