forked from mathoudebine/turing-smart-screen-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpages.example.yaml
More file actions
178 lines (170 loc) · 10.6 KB
/
Copy pathpages.example.yaml
File metadata and controls
178 lines (170 loc) · 10.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# Carousel pages -- edit freely, the running carousel re-reads this file every
# cycle (no restart needed). Screen orientation/brightness live in display.yaml.
#
# Copy this to pages.yaml and edit for your hosts (pages.yaml is gitignored so
# your site-specific PromQL/instances stay local). If pages.yaml is absent the
# carousel falls back to this example.
#
# Timing:
# dwell: seconds per page (full-frame redraw = visible wipe on transition)
# refresh: seconds between wipe-free in-page value updates
#
# Widget types:
# bar: {type: bar, x, y, w, label, pct: <value-name>, text: "<format>"}
# metric: {type: metric, x, y, label, text: "<format>", color: <spec>}
# radial: {type: radial, x, y, r, width, pct: <value-name>, text, size, label, track: true}
# arc gauge from 12 o'clock; omit `track` to trace background ring art
# text: {type: text, x, y, size, weight, family, anchor, text: "<format>", color: <spec>}
# graph: {type: graph, x, y, w, h, value: <name> | values: [..], colors: [..],
# min, max, samples, label, text} -- history sampled while page is visible
# cores: {type: cores, x, y, h, bar_w, gap, label} -- per-core CPU mini-bars
#
# Page types:
# (default) widget page as below
# type: netmap embeds the netmap app as a page; keys here override
# display.yaml's `netmap:` section (title, up_query, ...)
#
# Page options:
# background: res/themes/<name>/background.png draw widgets over theme art
# header: false / footer: false hide chrome (for art pages)
# disabled: true keep the page, skip the rotation
# dwell / refresh per-page overrides of the globals
# queries: name: <promql> value from the default `prom` source
# name: {source: <name>, query: ...} value from a named source (display.yaml)
# derived: name: <python expr over values> computed values; helpers available:
# human_rate min max round int str abs
# NOTE: queries/derived may reuse local value names (cpu_pct, ram_pct, ...) to
# override them -- that's how remote-host pages reuse the HOST widget layout.
#
# text format: python format string over the value namespace; unavailable -> "-".
# Local values (always): cpu_pct ram_pct ram_used_g ram_total_g disk_pct
# disk_used_g disk_total_g temp load1 uptime time_hm
# net_down net_up (B/s) net_down_h net_up_h (auto-unit)
# cpu_cores (list) cpu_watts (RAPL) fan_rpm nvme_temp
#
# color spec:
# fg | dim | accent | ok | warn | bad fixed color
# auto:<name>[:warn:bad] green/amber/red by thresholds (default 70:90)
# ok_if:<expr>[:<else-color>] OK when expr true, else bad (or <else-color>)
dwell: 60
refresh: 2
pages:
# Local host (psutil) -- no Prometheus needed.
- title: HOST
widgets:
- {type: bar, x: 16, y: 62, w: 250, label: CPU, pct: cpu_pct, text: "{cpu_pct:.0f}%"}
- {type: bar, x: 16, y: 122, w: 250, label: RAM, pct: ram_pct, text: "{ram_used_g:.1f}/{ram_total_g:.0f}G"}
- {type: bar, x: 16, y: 182, w: 250, label: DISK /, pct: disk_pct, text: "{disk_used_g:.0f}/{disk_total_g:.0f}G"}
- {type: metric, x: 300, y: 58, label: TEMP, text: "{temp:.0f}°C", color: "auto:temp:75:90"}
- {type: metric, x: 300, y: 138, label: LOAD, text: "{load1:.2f}"}
- {type: metric, x: 300, y: 218, label: UPTIME, text: "{uptime}"}
- {type: cores, x: 16, y: 248, h: 36, bar_w: 10, gap: 4, label: CORES}
- {type: text, x: 150, y: 254, size: 13, anchor: lm, text: "DN {net_down_h}"}
- {type: text, x: 150, y: 274, size: 13, anchor: lm, text: "UP {net_up_h}"}
- title: TRENDS
widgets:
- {type: graph, x: 16, y: 84, w: 215, h: 80, values: [cpu_pct, ram_pct], colors: [accent, ok],
max: 100, samples: 90, label: CPU / RAM, text: "{cpu_pct:.0f}% / {ram_pct:.0f}%"}
- {type: graph, x: 250, y: 84, w: 215, h: 80, value: temp, min: 30, max: 90,
samples: 90, label: TEMP, text: "{temp:.0f}°C"}
- {type: graph, x: 16, y: 205, w: 215, h: 80, value: net_down,
samples: 90, label: NET DOWN, text: "{net_down_h}"}
- {type: graph, x: 250, y: 205, w: 215, h: 80, value: net_up,
samples: 90, label: NET UP, text: "{net_up_h}"}
# Example Prometheus page -- generic kube-state-metrics, no host names.
- title: K3S CLUSTER
queries:
nodes_ready: sum(kube_node_status_condition{condition="Ready",status="true"})
nodes_total: count(kube_node_info)
pods_run: sum(kube_pod_status_phase{phase="Running"})
pods_fail: sum(kube_pod_status_phase{phase="Failed"}) or vector(0)
pods_pend: sum(kube_pod_status_phase{phase="Pending"}) or vector(0)
namespaces: count(count by (namespace)(kube_pod_info))
cpu: 100-(avg(rate(node_cpu_seconds_total{mode="idle"}[2m]))*100)
mem: 100*(1-sum(node_memory_MemAvailable_bytes)/sum(node_memory_MemTotal_bytes))
derived:
pods_bad: "(pods_fail or 0) + (pods_pend or 0)"
widgets:
- {type: metric, x: 16, y: 60, label: NODES READY, text: "{nodes_ready:.0f}/{nodes_total:.0f}", color: "ok_if:nodes_ready>=nodes_total"}
- {type: metric, x: 176, y: 60, label: PODS RUN, text: "{pods_run:.0f}"}
- {type: metric, x: 336, y: 60, label: PODS BAD, text: "{pods_bad:.0f}", color: "ok_if:pods_bad==0:warn"}
- {type: metric, x: 16, y: 170, label: NAMESPACES, text: "{namespaces:.0f}"}
- {type: metric, x: 176, y: 170, label: CPU, text: "{cpu:.0f}%", color: "auto:cpu"}
- {type: metric, x: 336, y: 170, label: MEM, text: "{mem:.0f}%", color: "auto:mem"}
- title: FLEET
queries:
hosts_up: sum(up{job=~".*node.*"})
hosts_total: count(node_uname_info)
alerts: count(ALERTS{alertstate="firing"}) or vector(0)
cpu: 100-(avg(rate(node_cpu_seconds_total{mode="idle"}[2m]))*100)
mem: 100*(1-sum(node_memory_MemAvailable_bytes)/sum(node_memory_MemTotal_bytes))
widgets:
- {type: metric, x: 16, y: 60, label: HOSTS UP, text: "{hosts_up:.0f}/{hosts_total:.0f}", color: "ok_if:hosts_up>=hosts_total"}
- {type: metric, x: 176, y: 60, label: ALERTS, text: "{alerts:.0f}", color: "ok_if:alerts==0"}
- {type: metric, x: 16, y: 170, label: CPU, text: "{cpu:.0f}%", color: "auto:cpu"}
- {type: metric, x: 176, y: 170, label: MEM, text: "{mem:.0f}%", color: "auto:mem"}
# The netmap app embedded as a page (settings inherit from display.yaml `netmap:`).
# Fast refresh animates the packet dots on spokes with live traffic; host/traffic
# data itself is cached and only re-queried every `data_refresh` (5s) seconds.
- type: netmap
refresh: 0.5
# Remote host page -- queries another node-exporter by instance, then reuses
# the local HOST widget layout by overriding the same value names. Duplicate
# this block per host; change the instance and title.
- title: REMOTE HOST
queries:
cpu_pct: 100-(avg(rate(node_cpu_seconds_total{instance="node-a.example:9100",mode="idle"}[2m]))*100)
ram_t: node_memory_MemTotal_bytes{instance="node-a.example:9100"}
ram_a: node_memory_MemAvailable_bytes{instance="node-a.example:9100"}
disk_t: node_filesystem_size_bytes{instance="node-a.example:9100",mountpoint="/"}
disk_a: node_filesystem_avail_bytes{instance="node-a.example:9100",mountpoint="/"}
temp: max(node_hwmon_temp_celsius{instance="node-a.example:9100"})
load1: node_load1{instance="node-a.example:9100"}
up_s: time()-node_boot_time_seconds{instance="node-a.example:9100"}
net_down: sum(rate(node_network_receive_bytes_total{instance="node-a.example:9100",device=~"en.*|eth.*|nic.*"}[2m]))
net_up: sum(rate(node_network_transmit_bytes_total{instance="node-a.example:9100",device=~"en.*|eth.*|nic.*"}[2m]))
derived:
ram_pct: "100*(1-ram_a/ram_t)"
ram_used_g: "(ram_t-ram_a)/2**30"
ram_total_g: "ram_t/2**30"
disk_pct: "100*(1-disk_a/disk_t)"
disk_used_g: "(disk_t-disk_a)/2**30"
disk_total_g: "disk_t/2**30"
uptime: "str(int(up_s//86400))+'d '+str(int(up_s%86400//3600))+'h'"
net_down_h: "human_rate(net_down)"
net_up_h: "human_rate(net_up)"
widgets:
- {type: bar, x: 16, y: 62, w: 250, label: CPU, pct: cpu_pct, text: "{cpu_pct:.0f}%"}
- {type: bar, x: 16, y: 122, w: 250, label: RAM, pct: ram_pct, text: "{ram_used_g:.1f}/{ram_total_g:.0f}G"}
- {type: bar, x: 16, y: 182, w: 250, label: DISK /, pct: disk_pct, text: "{disk_used_g:.0f}/{disk_total_g:.0f}G"}
- {type: metric, x: 300, y: 58, label: TEMP, text: "{temp:.0f}°C", color: "auto:temp:75:90"}
- {type: metric, x: 300, y: 138, label: LOAD, text: "{load1:.2f}"}
- {type: metric, x: 300, y: 218, label: UPTIME, text: "{uptime}"}
- {type: text, x: 16, y: 254, size: 13, anchor: lm, text: "DN {net_down_h}"}
- {type: text, x: 16, y: 274, size: 13, anchor: lm, text: "UP {net_up_h}"}
# Live values over the stock Cyberdeck theme art: radials trace the ring art,
# text widgets sit in its value boxes. GPU ring shows disk until the GPU lands.
# Parked from the rotation -- flip `disabled` to bring it back.
- title: CYBERDECK
disabled: true
background: res/themes/Cyberdeck/background.png
header: false
footer: false
queries:
hosts_up: sum(up{job=~".*node.*"})
hosts_total: count(node_uname_info)
pods_run: sum(kube_pod_status_phase{phase="Running"})
derived:
temp_pct: "(temp or 0)/90*100"
load_pct: "(load1 or 0)/8*100"
widgets:
- {type: radial, x: 96, y: 79, r: 37, width: 9, pct: cpu_pct, text: "{cpu_pct:.0f}%"}
- {type: radial, x: 107, y: 206, r: 35, width: 9, pct: ram_pct, text: "{ram_pct:.0f}%"}
- {type: radial, x: 164, y: 136, r: 27, width: 7, pct: temp_pct, text: "{temp:.0f}°", size: 16}
- {type: radial, x: 232, y: 69, r: 31, width: 8, pct: load_pct, text: "{load1:.1f}", size: 16}
- {type: radial, x: 388, y: 165, r: 50, width: 10, pct: disk_pct, text: "{disk_pct:.0f}%"}
- {type: text, x: 375, y: 47, size: 12, text: "{ram_used_g:.1f} / {ram_total_g:.0f} G"}
- {type: text, x: 72, y: 137, size: 14, text: "{uptime}"}
- {type: text, x: 266, y: 160, size: 14, text: "{time_hm}"}
- {type: text, x: 252, y: 250, size: 22, weight: Bold, text: "{pods_run:.0f} pods"}
- {type: text, x: 398, y: 292, size: 12, text: "{hosts_up:.0f}/{hosts_total:.0f} up", color: "ok_if:hosts_up>=hosts_total"}