I’m attempting to get a stat panel setup for each network switch where the up/down grid shown matches the physical layout of the switch. The panel seems to change the number shown per row dependent on the size of the panel, that is, as the panel is resized the horizontal number shown changes. I can query the device and get the desired width into a variable if needed.
How can I hard code the width or the row? Can I also hardcode the “cell” size? Not sure if cell is the proper term, image attached.
JSON below.
{
"id": 29,
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 0
},
"type": "stat",
"title": "Switch $instance",
"datasource": {
"type": "prometheus",
"uid": "G7Htlqv4k"
},
"pluginVersion": "9.2.1",
"links": [
{
"title": "Test link title ",
"url": "https://localhost/grafana/d/somedash/${interface:queryparam}"
}
],
"fieldConfig": {
"defaults": {
"mappings": [
{
"options": {
"1": {
"color": "dark-green",
"index": 0,
"text": "UP"
},
"2": {
"color": "dark-red",
"index": 1,
"text": "DOWN"
}
},
"type": "value"
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"links": [
{
"targetBlank": true,
"title": "Show details test",
"url": "https://localhost/grafana/d/dashboard_id/${interface:queryparam}"
}
],
"unit": "short"
},
"overrides": []
},
"options": {
"reduceOptions": {
"values": false,
"calcs": [
"lastNotNull"
],
"fields": ""
},
"orientation": "auto",
"textMode": "value_and_name",
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "G7Htlqv4k"
},
"editorMode": "code",
"expr": "ifOperStatus{job=\"$Job\", instance=~\"$instance\", ifName=~\"$interface\"}",
"legendFormat": "__auto",
"range": true,
"refId": "A"
}
]
}
Running open-source version 9.2.1
Thanks.