Skip to content

Commit e58637d

Browse files
bastienwirtzManuel Quarneti
and
Manuel Quarneti
authored
Glances service improvements (#837)
* feat: add a basic glances service widget * feat: auto update for glances widget * feat(services/glances): multiple metric support * Update dependencies --------- Co-authored-by: Manuel Quarneti <[email protected]>
1 parent 496f908 commit e58637d

File tree

5 files changed

+433
-310
lines changed

5 files changed

+433
-310
lines changed

docs/customservices.md

+32
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ within Homer:
1717
- [Emby / Jellyfin](#emby--jellyfin)
1818
- [FreshRSS](#freshrss)
1919
- [Gitea / Forgejo](#gitea--forgejo)
20+
- [Glances](#glances)
2021
- [Gotify](#gotify)
2122
- [Healthchecks](#healthchecks)
2223
- [Home Assistant](#home-assistant)
@@ -128,6 +129,37 @@ This service displays a version string instead of a subtitle. Example configurat
128129
url: http://git.example.com
129130
```
130131

132+
## Glances
133+
134+
This is a basic widget for showing cpu and ram usage using a glances server
135+
136+
You'll need a glances server up and running, this is a sample compose.yml
137+
138+
```yml
139+
---
140+
services:
141+
glances:
142+
image: nicolargo/glances:latest
143+
container_name: glances
144+
environment:
145+
- TZ=Europe/Rome
146+
- GLANCES_OPT=-w
147+
ports:
148+
- 61208:61208
149+
restart: unless-stopped
150+
```
151+
152+
And this is a sample homer configuration
153+
154+
```yml
155+
- name: System
156+
icon: "fa-solid fa-heart-pulse"
157+
url: http://192.168.1.2:61208
158+
type: Glances
159+
stats: [cpu, mem] # Metric to display. Possible values are: load, cpu, mem, swap.
160+
updateInterval: 5000 # (Optional) Interval (in ms) for updating the stats
161+
```
162+
131163
## Gotify
132164

133165
The Gotify service will show the number of currently oustanding messages

dummy-data/glances/api/4/quicklook

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"cpu_name":"AMD Ryzen 7 3700X 8-Core Processor","cpu_hz_current":2662987562.5,"cpu_hz":3600000000.0,"cpu":3.7,"percpu":[{"key":"cpu_number","cpu_number":0,"total":5.1,"user":3.3,"system":0.6,"idle":94.9,"nice":0.0,"iowait":0.0,"irq":0.8,"softirq":0.3,"steal":0.0,"guest":0.0,"guest_nice":0.0,"dpc":null,"interrupt":null},{"key":"cpu_number","cpu_number":1,"total":2.6,"user":2.0,"system":0.5,"idle":97.4,"nice":0.0,"iowait":0.0,"irq":0.1,"softirq":0.1,"steal":0.0,"guest":0.0,"guest_nice":0.0,"dpc":null,"interrupt":null},{"key":"cpu_number","cpu_number":2,"total":1.6,"user":1.1,"system":0.3,"idle":98.4,"nice":0.0,"iowait":0.1,"irq":0.1,"softirq":0.0,"steal":0.0,"guest":0.0,"guest_nice":0.0,"dpc":null,"interrupt":null},{"key":"cpu_number","cpu_number":3,"total":7.4,"user":6.2,"system":0.9,"idle":92.6,"nice":0.0,"iowait":0.1,"irq":0.1,"softirq":0.0,"steal":0.0,"guest":0.0,"guest_nice":0.0,"dpc":null,"interrupt":null},{"key":"cpu_number","cpu_number":4,"total":1.3,"user":0.9,"system":0.4,"idle":98.7,"nice":0.0,"iowait":0.0,"irq":0.1,"softirq":0.0,"steal":0.0,"guest":0.0,"guest_nice":0.0,"dpc":null,"interrupt":null},{"key":"cpu_number","cpu_number":5,"total":10.4,"user":8.9,"system":1.2,"idle":89.6,"nice":0.0,"iowait":0.1,"irq":0.1,"softirq":0.0,"steal":0.0,"guest":0.0,"guest_nice":0.0,"dpc":null,"interrupt":null},{"key":"cpu_number","cpu_number":6,"total":3.1,"user":2.3,"system":0.6,"idle":96.9,"nice":0.0,"iowait":0.1,"irq":0.1,"softirq":0.0,"steal":0.0,"guest":0.0,"guest_nice":0.0,"dpc":null,"interrupt":null},{"key":"cpu_number","cpu_number":7,"total":2.1,"user":1.3,"system":0.6,"idle":97.9,"nice":0.0,"iowait":0.1,"irq":0.1,"softirq":0.0,"steal":0.0,"guest":0.0,"guest_nice":0.0,"dpc":null,"interrupt":null},{"key":"cpu_number","cpu_number":8,"total":5.8,"user":4.9,"system":0.7,"idle":94.2,"nice":0.0,"iowait":0.1,"irq":0.1,"softirq":0.0,"steal":0.0,"guest":0.0,"guest_nice":0.0,"dpc":null,"interrupt":null},{"key":"cpu_number","cpu_number":9,"total":2.0,"user":1.3,"system":0.4,"idle":98.0,"nice":0.0,"iowait":0.2,"irq":0.1,"softirq":0.0,"steal":0.0,"guest":0.0,"guest_nice":0.0,"dpc":null,"interrupt":null},{"key":"cpu_number","cpu_number":10,"total":1.5,"user":0.9,"system":0.3,"idle":98.5,"nice":0.0,"iowait":0.2,"irq":0.1,"softirq":0.0,"steal":0.0,"guest":0.0,"guest_nice":0.0,"dpc":null,"interrupt":null},{"key":"cpu_number","cpu_number":11,"total":5.3,"user":4.6,"system":0.6,"idle":94.7,"nice":0.0,"iowait":0.1,"irq":0.1,"softirq":0.0,"steal":0.0,"guest":0.0,"guest_nice":0.0,"dpc":null,"interrupt":null},{"key":"cpu_number","cpu_number":12,"total":1.5,"user":1.0,"system":0.4,"idle":98.5,"nice":0.0,"iowait":0.0,"irq":0.1,"softirq":0.0,"steal":0.0,"guest":0.0,"guest_nice":0.0,"dpc":null,"interrupt":null},{"key":"cpu_number","cpu_number":13,"total":5.7,"user":4.9,"system":0.7,"idle":94.3,"nice":0.0,"iowait":0.0,"irq":0.1,"softirq":0.0,"steal":0.0,"guest":0.0,"guest_nice":0.0,"dpc":null,"interrupt":null},{"key":"cpu_number","cpu_number":14,"total":2.9,"user":2.0,"system":0.8,"idle":97.1,"nice":0.0,"iowait":0.0,"irq":0.1,"softirq":0.0,"steal":0.0,"guest":0.0,"guest_nice":0.0,"dpc":null,"interrupt":null},{"key":"cpu_number","cpu_number":15,"total":1.7,"user":1.1,"system":0.5,"idle":98.3,"nice":0.0,"iowait":0.0,"irq":0.1,"softirq":0.0,"steal":0.0,"guest":0.0,"guest_nice":0.0,"dpc":null,"interrupt":null}],"mem":59.6,"swap":0.0,"cpu_log_core":16,"cpu_phys_core":8,"load":5.7}

package.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@
1010
"lint": "eslint . --fix"
1111
},
1212
"dependencies": {
13-
"@fortawesome/fontawesome-free": "^6.6.0",
13+
"@fortawesome/fontawesome-free": "^6.7.0",
1414
"bulma": "^1.0.2",
1515
"lodash.merge": "^4.6.2",
16-
"vue": "^3.5.12",
17-
"yaml": "^2.6.0"
16+
"vue": "^3.5.13",
17+
"yaml": "^2.6.1"
1818
},
1919
"devDependencies": {
20-
"@vitejs/plugin-vue": "^5.1.4",
20+
"@vitejs/plugin-vue": "^5.2.0",
2121
"@vue/eslint-config-prettier": "^10.0.0",
22-
"eslint": "^9.12.0",
23-
"eslint-plugin-vue": "^9.29.0",
22+
"eslint": "^9.15.0",
23+
"eslint-plugin-vue": "^9.31.0",
2424
"http-server": "^14.1.1",
2525
"prettier": "^3.3.3",
26-
"sass-embedded": "^1.79.5",
27-
"vite": "^5.4.9",
28-
"vite-plugin-pwa": "^0.20.5"
26+
"sass-embedded": "^1.81.0",
27+
"vite": "^5.4.11",
28+
"vite-plugin-pwa": "^0.21.0"
2929
},
3030
"license": "Apache-2.0",
31-
"packageManager": "pnpm@9.12.1+sha512.e5a7e52a4183a02d5931057f7a0dbff9d5e9ce3161e33fa68ae392125b79282a8a8a470a51dfc8a0ed86221442eb2fb57019b0990ed24fab519bf0e1bc5ccfc4"
31+
"packageManager": "pnpm@9.14.2+sha512.6e2baf77d06b9362294152c851c4f278ede37ab1eba3a55fda317a4a17b209f4dbb973fb250a77abc463a341fcb1f17f17cfa24091c4eb319cda0d9b84278387"
3232
}

0 commit comments

Comments
 (0)