added monitoring widget
This commit is contained in:
@@ -21,14 +21,6 @@
|
||||
# 4. Update auth-url annotation with actual outpost service name
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: glance-system
|
||||
labels:
|
||||
app.kubernetes.io/name: glance-kisfenyo
|
||||
app.kubernetes.io/instance: glance-kisfenyo
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: glance-config-kisfenyo
|
||||
@@ -72,6 +64,255 @@ data:
|
||||
# ---------- LEFT COLUMN ----------
|
||||
- size: small
|
||||
widgets:
|
||||
- type: custom-api
|
||||
title: DooPlex Server
|
||||
cache: 30s
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: node_uname_info
|
||||
subrequests:
|
||||
uptime:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: node_boot_time_seconds
|
||||
cpu:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: 100 - (avg(rate(node_cpu_seconds_total{mode="idle"}[5m])) * 100)
|
||||
memory:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: (1 - (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes)) * 100
|
||||
cpu_temp:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: node_hwmon_temp_celsius{instance="dooplex",chip="platform_coretemp_0",sensor="temp1"}
|
||||
fans:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: fan_speed_rpm{instance="dooplex"}
|
||||
disk_root:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: 100 * (1 - node_filesystem_avail_bytes{mountpoint="/"} / node_filesystem_size_bytes{mountpoint="/"})
|
||||
disk_root_used:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: (node_filesystem_size_bytes{mountpoint="/"} - node_filesystem_avail_bytes{mountpoint="/"}) / 1073741824
|
||||
disk_root_total:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: node_filesystem_size_bytes{mountpoint="/"} / 1073741824
|
||||
disk_ssd2:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: 100 * (1 - node_filesystem_avail_bytes{mountpoint="/mnt/ssd_2"} / node_filesystem_size_bytes{mountpoint="/mnt/ssd_2"})
|
||||
disk_ssd2_used:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: (node_filesystem_size_bytes{mountpoint="/mnt/ssd_2"} - node_filesystem_avail_bytes{mountpoint="/mnt/ssd_2"}) / 1073741824
|
||||
disk_ssd2_total:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: node_filesystem_size_bytes{mountpoint="/mnt/ssd_2"} / 1073741824
|
||||
disk_hdd1:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: 100 * (1 - node_filesystem_avail_bytes{mountpoint="/mnt/1_hdd"} / node_filesystem_size_bytes{mountpoint="/mnt/1_hdd"})
|
||||
disk_hdd1_used:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: (node_filesystem_size_bytes{mountpoint="/mnt/1_hdd"} - node_filesystem_avail_bytes{mountpoint="/mnt/1_hdd"}) / 1099511627776
|
||||
disk_hdd1_total:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: node_filesystem_size_bytes{mountpoint="/mnt/1_hdd"} / 1099511627776
|
||||
disk_hdd2:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: 100 * (1 - node_filesystem_avail_bytes{mountpoint="/mnt/2_hdd"} / node_filesystem_size_bytes{mountpoint="/mnt/2_hdd"})
|
||||
disk_hdd2_used:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: (node_filesystem_size_bytes{mountpoint="/mnt/2_hdd"} - node_filesystem_avail_bytes{mountpoint="/mnt/2_hdd"}) / 1099511627776
|
||||
disk_hdd2_total:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: node_filesystem_size_bytes{mountpoint="/mnt/2_hdd"} / 1099511627776
|
||||
disk_hdd3:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: 100 * (1 - node_filesystem_avail_bytes{mountpoint="/mnt/3_hdd"} / node_filesystem_size_bytes{mountpoint="/mnt/3_hdd"})
|
||||
disk_hdd3_used:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: (node_filesystem_size_bytes{mountpoint="/mnt/3_hdd"} - node_filesystem_avail_bytes{mountpoint="/mnt/3_hdd"}) / 1099511627776
|
||||
disk_hdd3_total:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: node_filesystem_size_bytes{mountpoint="/mnt/3_hdd"} / 1099511627776
|
||||
disk_hdd4:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: 100 * (1 - node_filesystem_avail_bytes{mountpoint="/mnt/4_hdd"} / node_filesystem_size_bytes{mountpoint="/mnt/4_hdd"})
|
||||
disk_hdd4_used:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: (node_filesystem_size_bytes{mountpoint="/mnt/4_hdd"} - node_filesystem_avail_bytes{mountpoint="/mnt/4_hdd"}) / 1099511627776
|
||||
disk_hdd4_total:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: node_filesystem_size_bytes{mountpoint="/mnt/4_hdd"} / 1099511627776
|
||||
disk_hdd5:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: 100 * (1 - node_filesystem_avail_bytes{mountpoint="/mnt/5_hdd"} / node_filesystem_size_bytes{mountpoint="/mnt/5_hdd"})
|
||||
disk_hdd5_used:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: (node_filesystem_size_bytes{mountpoint="/mnt/5_hdd"} - node_filesystem_avail_bytes{mountpoint="/mnt/5_hdd"}) / 1099511627776
|
||||
disk_hdd5_total:
|
||||
url: ${PROMETHEUS_URL}/api/v1/query
|
||||
parameters:
|
||||
query: node_filesystem_size_bytes{mountpoint="/mnt/5_hdd"} / 1099511627776
|
||||
template: |
|
||||
<style>
|
||||
.sys-stats { font-size: 0.9em; }
|
||||
.top-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; justify-content: space-around; }
|
||||
.top-item { text-align: center; padding: 8px 12px; background: rgba(255,255,255,0.05); border-radius: 8px; min-width: 70px; }
|
||||
.top-label { font-size: 0.7em; opacity: 0.6; text-transform: uppercase; letter-spacing: 0.5px; }
|
||||
.top-value { font-size: 1.1em; font-weight: 600; margin-top: 2px; }
|
||||
.section-title { font-size: 0.75em; opacity: 0.6; text-transform: uppercase; letter-spacing: 0.5px; margin: 12px 0 8px 0; }
|
||||
.disk-row { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
|
||||
.disk-row:last-child { border-bottom: none; }
|
||||
.disk-name { font-weight: 500; min-width: 55px; font-size: 0.9em; }
|
||||
.disk-bar { flex: 1; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; margin: 0 12px; overflow: hidden; }
|
||||
.disk-fill { height: 100%; border-radius: 3px; }
|
||||
.fill-ok { background: linear-gradient(90deg, #4ade80, #22c55e); }
|
||||
.fill-warn { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
|
||||
.fill-crit { background: linear-gradient(90deg, #f87171, #ef4444); }
|
||||
.disk-info { font-size: 0.8em; opacity: 0.8; text-align: right; min-width: 150px; }
|
||||
</style>
|
||||
|
||||
{{ $hostname := .JSON.String "data.result.0.metric.nodename" }}
|
||||
{{ $bootTime := (.Subrequest "uptime").JSON.Float "data.result.0.value.1" }}
|
||||
{{ $uptimeSec := sub now.Unix (int64 $bootTime) }}
|
||||
{{ $uptimeDays := div $uptimeSec 86400 }}
|
||||
{{ $uptimeHours := div (mod $uptimeSec 86400) 3600 }}
|
||||
{{ $cpu := (.Subrequest "cpu").JSON.Float "data.result.0.value.1" }}
|
||||
{{ $mem := (.Subrequest "memory").JSON.Float "data.result.0.value.1" }}
|
||||
{{ $temp := (.Subrequest "cpu_temp").JSON.Float "data.result.0.value.1" }}
|
||||
{{ $fans := (.Subrequest "fans").JSON.Array "data.result" }}
|
||||
|
||||
<div class="sys-stats">
|
||||
<div class="top-row">
|
||||
<div class="top-item">
|
||||
<div class="top-label">Host</div>
|
||||
<div class="top-value">{{ $hostname }}</div>
|
||||
</div>
|
||||
<div class="top-item">
|
||||
<div class="top-label">Uptime</div>
|
||||
<div class="top-value">{{ $uptimeDays }}d {{ $uptimeHours }}h</div>
|
||||
</div>
|
||||
<div class="top-item">
|
||||
<div class="top-label">CPU</div>
|
||||
<div class="top-value">{{ printf "%.1f" $cpu }}%</div>
|
||||
</div>
|
||||
<div class="top-item">
|
||||
<div class="top-label">Memory</div>
|
||||
<div class="top-value">{{ printf "%.1f" $mem }}%</div>
|
||||
</div>
|
||||
<div class="top-item">
|
||||
<div class="top-label">Temp</div>
|
||||
<div class="top-value">{{ printf "%.0f" $temp }}°C</div>
|
||||
</div>
|
||||
<div class="top-item">
|
||||
<div class="top-label">Fans</div>
|
||||
<div class="top-value">{{ range $i, $fan := $fans }}{{ if $i }}/{{ end }}{{ $fan.Int "value.1" }}{{ end }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section-title">Storage</div>
|
||||
|
||||
{{ $rootPct := (.Subrequest "disk_root").JSON.Float "data.result.0.value.1" }}
|
||||
{{ $rootUsed := (.Subrequest "disk_root_used").JSON.Float "data.result.0.value.1" }}
|
||||
{{ $rootTotal := (.Subrequest "disk_root_total").JSON.Float "data.result.0.value.1" }}
|
||||
<div class="disk-row">
|
||||
<span class="disk-name">Root</span>
|
||||
<div class="disk-bar">
|
||||
<div class="disk-fill {{ if lt $rootPct 70.0 }}fill-ok{{ else if lt $rootPct 85.0 }}fill-warn{{ else }}fill-crit{{ end }}" style="width: {{ printf "%.0f" $rootPct }}%"></div>
|
||||
</div>
|
||||
<span class="disk-info">{{ printf "%.0f" $rootUsed }} / {{ printf "%.0f" $rootTotal }} GB ({{ printf "%.0f" $rootPct }}%)</span>
|
||||
</div>
|
||||
|
||||
{{ $ssd2Pct := (.Subrequest "disk_ssd2").JSON.Float "data.result.0.value.1" }}
|
||||
{{ $ssd2Used := (.Subrequest "disk_ssd2_used").JSON.Float "data.result.0.value.1" }}
|
||||
{{ $ssd2Total := (.Subrequest "disk_ssd2_total").JSON.Float "data.result.0.value.1" }}
|
||||
<div class="disk-row">
|
||||
<span class="disk-name">SSD2</span>
|
||||
<div class="disk-bar">
|
||||
<div class="disk-fill {{ if lt $ssd2Pct 70.0 }}fill-ok{{ else if lt $ssd2Pct 85.0 }}fill-warn{{ else }}fill-crit{{ end }}" style="width: {{ printf "%.0f" $ssd2Pct }}%"></div>
|
||||
</div>
|
||||
<span class="disk-info">{{ printf "%.0f" $ssd2Used }} / {{ printf "%.0f" $ssd2Total }} GB ({{ printf "%.0f" $ssd2Pct }}%)</span>
|
||||
</div>
|
||||
|
||||
{{ $hdd1Pct := (.Subrequest "disk_hdd1").JSON.Float "data.result.0.value.1" }}
|
||||
{{ $hdd1Used := (.Subrequest "disk_hdd1_used").JSON.Float "data.result.0.value.1" }}
|
||||
{{ $hdd1Total := (.Subrequest "disk_hdd1_total").JSON.Float "data.result.0.value.1" }}
|
||||
<div class="disk-row">
|
||||
<span class="disk-name">HDD1</span>
|
||||
<div class="disk-bar">
|
||||
<div class="disk-fill {{ if lt $hdd1Pct 70.0 }}fill-ok{{ else if lt $hdd1Pct 85.0 }}fill-warn{{ else }}fill-crit{{ end }}" style="width: {{ printf "%.0f" $hdd1Pct }}%"></div>
|
||||
</div>
|
||||
<span class="disk-info">{{ printf "%.1f" $hdd1Used }} / {{ printf "%.1f" $hdd1Total }} TB ({{ printf "%.0f" $hdd1Pct }}%)</span>
|
||||
</div>
|
||||
|
||||
{{ $hdd2Pct := (.Subrequest "disk_hdd2").JSON.Float "data.result.0.value.1" }}
|
||||
{{ $hdd2Used := (.Subrequest "disk_hdd2_used").JSON.Float "data.result.0.value.1" }}
|
||||
{{ $hdd2Total := (.Subrequest "disk_hdd2_total").JSON.Float "data.result.0.value.1" }}
|
||||
<div class="disk-row">
|
||||
<span class="disk-name">HDD2</span>
|
||||
<div class="disk-bar">
|
||||
<div class="disk-fill {{ if lt $hdd2Pct 70.0 }}fill-ok{{ else if lt $hdd2Pct 85.0 }}fill-warn{{ else }}fill-crit{{ end }}" style="width: {{ printf "%.0f" $hdd2Pct }}%"></div>
|
||||
</div>
|
||||
<span class="disk-info">{{ printf "%.1f" $hdd2Used }} / {{ printf "%.1f" $hdd2Total }} TB ({{ printf "%.0f" $hdd2Pct }}%)</span>
|
||||
</div>
|
||||
|
||||
{{ $hdd3Pct := (.Subrequest "disk_hdd3").JSON.Float "data.result.0.value.1" }}
|
||||
{{ $hdd3Used := (.Subrequest "disk_hdd3_used").JSON.Float "data.result.0.value.1" }}
|
||||
{{ $hdd3Total := (.Subrequest "disk_hdd3_total").JSON.Float "data.result.0.value.1" }}
|
||||
<div class="disk-row">
|
||||
<span class="disk-name">HDD3</span>
|
||||
<div class="disk-bar">
|
||||
<div class="disk-fill {{ if lt $hdd3Pct 70.0 }}fill-ok{{ else if lt $hdd3Pct 85.0 }}fill-warn{{ else }}fill-crit{{ end }}" style="width: {{ printf "%.0f" $hdd3Pct }}%"></div>
|
||||
</div>
|
||||
<span class="disk-info">{{ printf "%.1f" $hdd3Used }} / {{ printf "%.1f" $hdd3Total }} TB ({{ printf "%.0f" $hdd3Pct }}%)</span>
|
||||
</div>
|
||||
|
||||
{{ $hdd4Pct := (.Subrequest "disk_hdd4").JSON.Float "data.result.0.value.1" }}
|
||||
{{ $hdd4Used := (.Subrequest "disk_hdd4_used").JSON.Float "data.result.0.value.1" }}
|
||||
{{ $hdd4Total := (.Subrequest "disk_hdd4_total").JSON.Float "data.result.0.value.1" }}
|
||||
<div class="disk-row">
|
||||
<span class="disk-name">HDD4</span>
|
||||
<div class="disk-bar">
|
||||
<div class="disk-fill {{ if lt $hdd4Pct 70.0 }}fill-ok{{ else if lt $hdd4Pct 85.0 }}fill-warn{{ else }}fill-crit{{ end }}" style="width: {{ printf "%.0f" $hdd4Pct }}%"></div>
|
||||
</div>
|
||||
<span class="disk-info">{{ printf "%.1f" $hdd4Used }} / {{ printf "%.1f" $hdd4Total }} TB ({{ printf "%.0f" $hdd4Pct }}%)</span>
|
||||
</div>
|
||||
|
||||
{{ $hdd5Pct := (.Subrequest "disk_hdd5").JSON.Float "data.result.0.value.1" }}
|
||||
{{ $hdd5Used := (.Subrequest "disk_hdd5_used").JSON.Float "data.result.0.value.1" }}
|
||||
{{ $hdd5Total := (.Subrequest "disk_hdd5_total").JSON.Float "data.result.0.value.1" }}
|
||||
<div class="disk-row">
|
||||
<span class="disk-name">HDD5</span>
|
||||
<div class="disk-bar">
|
||||
<div class="disk-fill {{ if lt $hdd5Pct 70.0 }}fill-ok{{ else if lt $hdd5Pct 85.0 }}fill-warn{{ else }}fill-crit{{ end }}" style="width: {{ printf "%.0f" $hdd5Pct }}%"></div>
|
||||
</div>
|
||||
<span class="disk-info">{{ printf "%.1f" $hdd5Used }} / {{ printf "%.1f" $hdd5Total }} TB ({{ printf "%.0f" $hdd5Pct }}%)</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
# Weather Widget
|
||||
- type: weather
|
||||
location: Budapest, Hungary
|
||||
@@ -658,6 +899,8 @@ spec:
|
||||
env:
|
||||
- name: TZ
|
||||
value: "Europe/Budapest"
|
||||
- name: PROMETHEUS_URL
|
||||
value: "http://<your-prometheus-service>.<namespace>.svc.cluster.local:9090"
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8080
|
||||
|
||||
@@ -82,10 +82,6 @@ data:
|
||||
- type: calendar
|
||||
first-day-of-week: monday
|
||||
|
||||
# To-Do List
|
||||
- type: to-do
|
||||
title: Tasks
|
||||
|
||||
# Quick Links - Productivity
|
||||
- type: bookmarks
|
||||
title: Productivity
|
||||
@@ -155,6 +151,9 @@ data:
|
||||
title: Recent Notes
|
||||
|
||||
# ---------- RIGHT COLUMN ----------
|
||||
- type: to-do
|
||||
title: Tasks
|
||||
|
||||
- size: small
|
||||
widgets:
|
||||
# RSS Feeds - Add your favorite feeds here
|
||||
|
||||
Reference in New Issue
Block a user