Skip to content

Commit

Permalink
Merge pull request #2 from 3xploitGuy/network-interface
Browse files Browse the repository at this point in the history
Added variable to detect active network interface name.
  • Loading branch information
3xploitGuy authored Oct 10, 2021
2 parents 324daa8 + 6690391 commit d025ec2
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 6 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Validate Dashboard JSON

on:
push:
branches: [main]
paths-ignore:
- "README.md"
- "LICENSE"
pull_request:
branches: [main]
paths-ignore:
- "README.md"
- "LICENSE"

jobs:
validate:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Validate JSON
run: cat Dashboard.json | json_pp
35 changes: 29 additions & 6 deletions Dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"gnetId": 14731,
"graphTooltip": 0,
"id": null,
"iteration": 1626540912717,
"iteration": 1633868706184,
"links": [
{
"icon": "question",
Expand All @@ -74,7 +74,7 @@
"title": "GitHub",
"tooltip": "Open GitHub",
"type": "link",
"url": "https://github.com/3xploitGuy"
"url": "https://github.com/3xploitGuy/linuxstats"
}
],
"panels": [
Expand Down Expand Up @@ -616,7 +616,7 @@
"pluginVersion": "7.3.1",
"targets": [
{
"expr": "node_network_receive_bytes_total{device=\"wlan0\",instance=~'$node'}",
"expr": "node_network_receive_bytes_total{device=\"$network_interface\",instance=~'$node'}",
"interval": "",
"legendFormat": "",
"refId": "A"
Expand Down Expand Up @@ -957,7 +957,7 @@
"pluginVersion": "7.3.1",
"targets": [
{
"expr": "node_network_transmit_bytes_total{device=\"wlan0\",instance=~'$node'}",
"expr": "node_network_transmit_bytes_total{device=\"$network_interface\",instance=~'$node'}",
"interval": "",
"legendFormat": "",
"refId": "A"
Expand Down Expand Up @@ -1595,6 +1595,29 @@
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"allValue": null,
"current": {},
"datasource": "${DS_PROMETHEUS}",
"definition": "label_values(node_network_info{operstate=\"up\"}, device)",
"error": null,
"hide": 0,
"includeAll": false,
"label": "Network:",
"multi": false,
"name": "network_interface",
"options": [],
"query": "label_values(node_network_info{operstate=\"up\"}, device)",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
}
]
},
Expand Down Expand Up @@ -1624,5 +1647,5 @@
"timezone": "browser",
"title": "1 Linux Stats with Node Exporter",
"uid": "linux-stats",
"version": 15
}
"version": 3
}

0 comments on commit d025ec2

Please sign in to comment.