Skip to content

Commit

Permalink
feat: adding fc rest template for fibre channel switch (#2424)
Browse files Browse the repository at this point in the history
* feat: adding fc rest template for fibre channel switch

* feat: adding table in dashboard for fibre channel switch
  • Loading branch information
Hardikl authored Oct 23, 2023
1 parent fee6a2a commit c37ad25
Show file tree
Hide file tree
Showing 3 changed files with 269 additions and 10 deletions.
37 changes: 37 additions & 0 deletions conf/rest/9.6.0/fcp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: FCP
query: api/network/fc/ports
object: fcp

counters:
- ^^uuid
- ^enabled => enabled
- ^fabric.connected => fabric_connected
- ^fabric.name => fabric_name
- ^fabric.port_address => fabric_port_address
- ^fabric.switch_port => fabric_switch_port
- ^name => port
- ^node.name => node
- ^physical_protocol
- ^speed.configured => speed_configured
- ^state
- ^supported_protocols => supported_protocols
- fabric.connected_speed => fabric_connected_speed
- speed.maximum => max_speed
- hidden_fields:
- fabric

export_options:
instance_keys:
- node
- port
instance_labels:
- enabled
- fabric_connected
- fabric_name
- fabric_port_address
- fabric_switch_port
- physical_protocol
- speed_configured
- state
- supported_protocols

1 change: 1 addition & 0 deletions conf/rest/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ objects:
Disk: disk.yaml
EmsDestination: ems_destination.yaml
# ExportRule: exports.yaml
FCP: fcp.yaml
LIF: lif.yaml
Health: health.yaml
Lun: lun.yaml
Expand Down
241 changes: 231 additions & 10 deletions grafana/dashboards/cmode/network.json
Original file line number Diff line number Diff line change
Expand Up @@ -1655,6 +1655,227 @@
],
"type": "table"
},
{
"datasource": "${DS_PROMETHEUS}",
"gridPos": {
"h": 2,
"w": 24,
"x": 0,
"y": 23
},
"id": 117,
"options": {
"content": "This panel requires ONTAP 9.6+ and the APIs are only available via REST. Enable the REST collector in your `harvest.yml` config.<br>\nSee https://github.com/NetApp/harvest/wiki/Troubleshooting-Harvest#why-do-i-have-fc-ports-with-fabric-detail-table-empty-in-network-dashboard\nfor more details.",
"mode": "markdown"
},
"pluginVersion": "8.1.8",
"type": "text"
},
{
"datasource": "${DS_PROMETHEUS}",
"fieldConfig": {
"defaults": {
"custom": {
"align": "left",
"displayMode": "auto",
"filterable": true
},
"mappings": [],
"thresholds": {},
"unit": "string"
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Max Speed"
},
"properties": [
{
"id": "unit",
"value": "Gbits"
}
]
},
{
"matcher": {
"id": "byName",
"options": "Connected Speed"
},
"properties": [
{
"id": "unit",
"value": "Gbits"
}
]
},
{
"matcher": {
"id": "byName",
"options": "Enabled"
},
"properties": [
{
"id": "mappings",
"value": [
{
"options": {
"false": {
"index": 1,
"text": "No"
},
"true": {
"index": 0,
"text": "Yes"
}
},
"type": "value"
}
]
}
]
},
{
"matcher": {
"id": "byName",
"options": "Fabric Connected"
},
"properties": [
{
"id": "mappings",
"value": [
{
"options": {
"false": {
"index": 1,
"text": "No"
},
"true": {
"index": 0,
"text": "Yes"
}
},
"type": "value"
}
]
}
]
}
]
},
"gridPos": {
"h": 11,
"w": 24,
"x": 0,
"y": 25
},
"id": 115,
"interval": "",
"options": {
"showHeader": true
},
"pluginVersion": "8.1.8",
"targets": [
{
"exemplar": false,
"expr": "fcp_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\",port=~\"$FCP\"}",
"format": "table",
"hide": false,
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "C"
},
{
"exemplar": false,
"expr": "fcp_max_speed{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\",port=~\"$FCP\"}",
"format": "table",
"hide": false,
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "B"
},
{
"exemplar": false,
"expr": "fcp_fabric_connected_speed{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\",port=~\"$FCP\"}",
"format": "table",
"hide": false,
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"timeFrom": null,
"timeShift": null,
"title": "FC ports with Fabric detail",
"transformations": [
{
"id": "filterFieldsByName",
"options": {
"include": {
"names": [
"fabric_connected",
"fabric_name",
"fabric_switch_port",
"node",
"physical_protocol",
"port",
"speed_configured",
"state",
"supported_protocols",
"Value #B",
"Value #A",
"fabric_port_address",
"enabled"
]
}
}
},
{
"id": "merge",
"options": {}
},
{
"id": "organize",
"options": {
"excludeByName": {},
"indexByName": {
"Value #A": 12,
"Value #B": 11,
"enabled": 2,
"fabric_connected": 3,
"fabric_name": 4,
"fabric_port_address": 5,
"fabric_switch_port": 6,
"node": 1,
"physical_protocol": 7,
"port": 0,
"speed_configured": 8,
"state": 9,
"supported_protocols": 10
},
"renameByName": {
"Value #A": "Connected Speed",
"Value #B": "Max Speed",
"enabled": "Enabled",
"fabric_connected": "Fabric Connected",
"fabric_name": "Fabric Name",
"fabric_port_address": "Fabric Port",
"fabric_switch_port": "Fabric Switch Port",
"node": "Node",
"physical_protocol": "Physical Protocol",
"port": "Port Name",
"speed_configured": "Speed Configured",
"state": "State",
"supported_protocols": "Supported Protocols"
}
}
}
],
"type": "table"
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
Expand Down Expand Up @@ -1715,7 +1936,7 @@
"h": 10,
"w": 12,
"x": 0,
"y": 23
"y": 36
},
"id": 67,
"options": {
Expand Down Expand Up @@ -1808,7 +2029,7 @@
"h": 10,
"w": 12,
"x": 12,
"y": 23
"y": 36
},
"id": 69,
"options": {
Expand Down Expand Up @@ -1900,7 +2121,7 @@
"h": 10,
"w": 12,
"x": 0,
"y": 33
"y": 46
},
"id": 77,
"options": {
Expand Down Expand Up @@ -1993,7 +2214,7 @@
"h": 10,
"w": 12,
"x": 12,
"y": 33
"y": 46
},
"id": 78,
"options": {
Expand Down Expand Up @@ -2086,7 +2307,7 @@
"h": 10,
"w": 6,
"x": 0,
"y": 43
"y": 56
},
"id": 75,
"options": {
Expand Down Expand Up @@ -2206,7 +2427,7 @@
"h": 10,
"w": 6,
"x": 6,
"y": 43
"y": 56
},
"id": 76,
"options": {
Expand Down Expand Up @@ -2332,7 +2553,7 @@
"h": 10,
"w": 6,
"x": 12,
"y": 43
"y": 56
},
"id": 73,
"options": {
Expand Down Expand Up @@ -2424,7 +2645,7 @@
"h": 10,
"w": 6,
"x": 18,
"y": 43
"y": 56
},
"id": 74,
"options": {
Expand Down Expand Up @@ -3291,7 +3512,7 @@
"allValue": null,
"current": {},
"datasource": "${DS_PROMETHEUS}",
"definition": "label_values(fcp_total_data{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\"}, port)",
"definition": "label_values(fcp_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\"}, port)",
"description": null,
"error": null,
"hide": 0,
Expand All @@ -3301,7 +3522,7 @@
"name": "FCP",
"options": [],
"query": {
"query": "label_values(fcp_total_data{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\"}, port)",
"query": "label_values(fcp_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\"}, port)",
"refId": "StandardVariableQuery"
},
"refresh": 2,
Expand Down

0 comments on commit c37ad25

Please sign in to comment.