Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: collect lif counters #1956

Merged
merged 4 commits into from
Apr 20, 2023
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
10 changes: 6 additions & 4 deletions cmd/collectors/rest/plugins/health/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const (
nodeHealthMatrix = "health_node"
networkEthernetPortHealthMatrix = "health_network_ethernet_port"
networkFCPortHealthMatrix = "health_network_fc_port"
networkInterfaceHealthMatrix = "health_network_interface"
lifHealthMatrix = "health_lif"
volumeRansomwareHealthMatrix = "health_volume_ransomware"
volumeMoveHealthMatrix = "health_volume_move"
licenseHealthMatrix = "health_license"
Expand Down Expand Up @@ -76,7 +76,7 @@ func (h *Health) Init() error {
func (h *Health) initAllMatrix() error {
h.data = make(map[string]*matrix.Matrix)
mats := []string{diskHealthMatrix, shelfHealthMatrix, supportHealthMatrix, nodeHealthMatrix,
networkEthernetPortHealthMatrix, networkFCPortHealthMatrix, networkInterfaceHealthMatrix,
networkEthernetPortHealthMatrix, networkFCPortHealthMatrix, lifHealthMatrix,
volumeRansomwareHealthMatrix, volumeMoveHealthMatrix, licenseHealthMatrix}
for _, m := range mats {
if err := h.initMatrix(m); err != nil {
Expand Down Expand Up @@ -287,16 +287,18 @@ func (h *Health) collectNetworkInterfacesAlerts() {
}
return
}
mat := h.data[networkInterfaceHealthMatrix]
mat := h.data[lifHealthMatrix]
for _, record := range records {
uuid := record.Get("uuid").String()
lif := record.Get("name").String()
svm := record.Get("svm.name").String()
isHome := record.Get("location.is_home").String()
instance, err = mat.NewInstance(uuid)
if err != nil {
h.Logger.Warn().Str("key", uuid).Msg("error while creating instance")
continue
}
instance.SetLabel("svm", svm)
instance.SetLabel("isHome", isHome)
instance.SetLabel("lif", lif)
instance.SetLabel(severityLabel, string(warning))
Expand Down Expand Up @@ -630,7 +632,7 @@ func (h *Health) getNonHomeLIFs() ([]gjson.Result, error) {
)

query := "api/network/ip/interfaces"
href := rest.BuildHref(query, "", []string{"location.is_home=false"}, "", "", "", "", query)
href := rest.BuildHref(query, "svm,location", []string{"location.is_home=false"}, "", "", "", "", query)

if result, err = collectors.InvokeRestCall(h.client, href, h.Logger); err != nil {
return nil, err
Expand Down
41 changes: 41 additions & 0 deletions conf/rest/9.12.0/lif.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: LIF
query: api/network/ip/interfaces
object: lif

counters:
- ^^name => lif
- ^^svm.name => svm
- ^ip.address => address
- ^ipspace.name => ipspace
- ^location.home_node.name => home_node
- ^location.home_port.name => home_port
- ^location.is_home => is_home
- ^location.node.name => node
- ^location.port.name => port
- ^services => services
- ^state => status
- ^subnet.name => subnet

endpoints:
- query: api/private/cli/network/interface
counters:
- ^^lif
- ^^vserver => svm
- ^data_protocol => protocols

export_options:
instance_keys:
- lif
- svm
instance_labels:
- address
- home_node
- home_port
- ipspace
- is_home
- node
- port
- protocols
- services
- status
- subnet
1 change: 1 addition & 0 deletions conf/rest/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ objects:
ClusterPeer: clusterpeer.yaml
Disk: disk.yaml
# ExportRule: exports.yaml
LIF: lif.yaml
Health: health.yaml
Lun: lun.yaml
Namespace: namespace.yaml
Expand Down
41 changes: 41 additions & 0 deletions conf/zapi/cdot/9.8.0/lif.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: LIF
query: net-interface-get-iter
object: lif

counters:
net-interface-info:
- ^^interface-name => lif
- ^^vserver => svm
- ^address => address
- ^current-node => node
- ^current-port => port
- ^home-node => home_node
- ^home-port => home_port
- ^ipspace => ipspace
- ^is-home => is_home
- ^operational-status => status
- ^subnet-name => subnet
- data-protocols:
- ^data-protocol => protocols
- service-names:
- ^lif-service-name => services

collect_only_labels: true

export_options:
instance_keys:
- lif
- svm
instance_labels:
- address
- home_node
- home_port
- ipspace
- is_home
- node
- port
- protocols
- services
- status
- subnet

1 change: 1 addition & 0 deletions conf/zapi/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ objects:
CIFSClients: cifs_clients.yaml
ClusterPeer: clusterpeer.yaml
Disk: disk.yaml
LIF: lif.yaml
Lun: lun.yaml
# NetPort: netPort.yaml
Namespace: namespace.yaml
Expand Down
119 changes: 80 additions & 39 deletions grafana/dashboards/cmode/health.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"gnetId": null,
"graphTooltip": 1,
"id": null,
"iteration": 1681133194625,
"iteration": 1681988994523,
"links": [
{
"asDropdown": true,
Expand Down Expand Up @@ -304,7 +304,7 @@
"targets": [
{
"exemplar": false,
"expr": "(count(health_disk_alerts{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",severity=\"warning\"}) or vector(0))\n+\n(count(health_shelf_alerts{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",severity=\"warning\"}) or vector(0))\n+\n(count(last_over_time(health_support_alerts{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",severity=\"warning\"}[24h]) == 1) or vector(0))\n+\n(count(health_network_interface_alerts{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",severity=\"warning\"}) or vector(0))\n+\n(count(health_volume_move_alerts{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",severity=\"warning\"}) or vector(0))\n+\n(count(health_volume_ransomware_alerts{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",severity=\"error\"}) or vector(0))",
"expr": "(count(health_disk_alerts{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",severity=\"warning\"}) or vector(0))\n+\n(count(health_shelf_alerts{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",severity=\"warning\"}) or vector(0))\n+\n(count(last_over_time(health_support_alerts{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",severity=\"warning\"}[24h]) == 1) or vector(0))\n+\n(count(health_lif_alerts{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",severity=\"warning\"}) or vector(0))\n+\n(count(health_volume_move_alerts{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",severity=\"warning\"}) or vector(0))\n+\n(count(health_volume_ransomware_alerts{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",severity=\"error\"}) or vector(0))",
"instant": true,
"interval": "",
"legendFormat": "",
Expand Down Expand Up @@ -605,11 +605,11 @@
},
{
"exemplar": false,
"expr": "count(health_network_interface_alerts{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",severity=\"warning\"}) or vector(0)",
"expr": "count(health_lif_alerts{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",severity=\"warning\"}) or vector(0)",
"hide": false,
"instant": true,
"interval": "",
"legendFormat": "Network Interface are not at home port",
"legendFormat": "Lif are not at home port",
"refId": "D"
},
{
Expand Down Expand Up @@ -1849,7 +1849,7 @@
"h": 9,
"w": 24,
"x": 0,
"y": 22
"y": 31
},
"id": 264,
"interval": "1m",
Expand Down Expand Up @@ -2235,7 +2235,7 @@
"h": 9,
"w": 24,
"x": 0,
"y": 31
"y": 40
},
"id": 271,
"interval": "1m",
Expand Down Expand Up @@ -2485,7 +2485,7 @@
"h": 7,
"w": 24,
"x": 0,
"y": 1
"y": 32
},
"id": 276,
"options": {
Expand Down Expand Up @@ -2554,7 +2554,7 @@
"id": 255,
"panels": [
{
"datasource": null,
"datasource": "${DS_PROMETHEUS}",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -2594,6 +2594,10 @@
"false": {
"index": 0,
"text": "No"
},
"true": {
"index": 1,
"text": "Yes"
}
},
"type": "value"
Expand All @@ -2605,66 +2609,103 @@
]
},
"gridPos": {
"h": 8,
"h": 10,
"w": 24,
"x": 0,
"y": 23
"y": 33
},
"id": 257,
"id": 280,
"options": {
"showHeader": true
"showHeader": true,
"sortBy": []
},
"pluginVersion": "8.1.8",
"targets": [
{
"exemplar": false,
"expr": "health_network_interface_alerts{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"}",
"expr": "lif_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} * on(lif,svm,cluster,datacenter) group_left(severity) health_lif_alerts{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"}",
"format": "table",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"title": "Network interfaces not at home port",
"title": "Lif not at home port",
"transformations": [
{
"id": "filterFieldsByName",
"options": {
"include": {
"names": [
"address",
"cluster",
"datacenter",
"home_node",
"home_port",
"ipspace",
"is_home",
"lif",
"node",
"port",
"protocols",
"services",
"status",
"subnet",
"svm",
"severity"
]
}
}
},
{
"id": "organize",
"options": {
"excludeByName": {
"Time": true,
"Value": true,
"__name__": true,
"instance": true,
"job": true
},
"excludeByName": {},
"indexByName": {
"Time": 0,
"Value": 9,
"__name__": 1,
"cluster": 3,
"datacenter": 2,
"instance": 7,
"isHome": 5,
"job": 8,
"lif": 4,
"severity": 6
"address": 7,
"cluster": 1,
"datacenter": 0,
"home_node": 11,
"home_port": 12,
"ipspace": 6,
"is_home": 10,
"lif": 2,
"node": 8,
"port": 9,
"protocols": 14,
"services": 15,
"severity": 3,
"status": 4,
"subnet": 13,
"svm": 5
},
"renameByName": {
"address": "Address",
"cluster": "Cluster",
"datacenter": "Datacenter",
"instance": "",
"isHome": "At Home",
"lif": "Network Interface",
"severity": "Severity"
"home_node": "Home Node",
"home_port": "Home Port",
"ipspace": "IPspace",
"is_home": "At Home",
"lif": "Name",
"node": "Current Node",
"port": "Current Port",
"protocols": "Protocols",
"services": "Services",
"severity": "Severity",
"status": "Status",
"subnet": "Subnet",
"svm": "SVM",
"type": "Type"
}
}
}
],
"type": "table"
}
],
"title": "Network Interface",
"title": "Lif",
"type": "row"
},
{
Expand Down Expand Up @@ -2710,7 +2751,7 @@
"h": 8,
"w": 24,
"x": 0,
"y": 24
"y": 34
},
"id": 261,
"options": {
Expand Down Expand Up @@ -2798,7 +2839,7 @@
"h": 8,
"w": 24,
"x": 0,
"y": 32
"y": 42
},
"id": 262,
"options": {
Expand Down Expand Up @@ -3215,5 +3256,5 @@
"timezone": "",
"title": "ONTAP: Health",
"uid": "",
"version": 1
"version": 2
}
Loading