+ | {{ .Labels.instance }} |
+
+ {{ if eq .Value 1.0 }}
+ UP
+ {{ else }}
+ DOWN
+ {{ end }}
+ |
+
+ {{ $cpuQuery := query (printf "100 - (avg by(host) (rate(cpu_seconds_total{mode=\"idle\",host=\"%s\"}[5m])) * 100)" .Labels.instance) }}
+ {{ if $cpuQuery }}
+ {{ with $cpuQuery | first }}
+ {{ . | value | printf "%.1f" }}%
+ {{ end }}
+ {{ else }}
+ N/A
+ {{ end }}
+ |
+
+ {{ $memQuery := query (printf "(1 - (mem_available_bytes{host=\"%s\"} / mem_total_bytes{host=\"%s\"})) * 100" .Labels.instance .Labels.instance) }}
+ {{ if $memQuery }}
+ {{ with $memQuery | first }}
+ {{ . | value | printf "%.1f" }}%
+ {{ end }}
+ {{ else }}
+ N/A
+ {{ end }}
+ |
+
+ {{ $diskQuery := query (printf "(1 - (disk_free_bytes{host=\"%s\",path=\"/\"} / disk_total_bytes{host=\"%s\",path=\"/\"})) * 100" .Labels.instance .Labels.instance) }}
+ {{ if $diskQuery }}
+ {{ with $diskQuery | first }}
+ {{ . | value | printf "%.1f" }}%
+ {{ end }}
+ {{ else }}
+ N/A
+ {{ end }}
+ |
+
+ {{ end }}
+