Fix statuses
This commit is contained in:
parent
b6951992d5
commit
3185180f10
1 changed files with 13 additions and 16 deletions
|
|
@ -2,31 +2,30 @@
|
||||||
services:
|
services:
|
||||||
pkgs.writers.writeJSON "status.json" {
|
pkgs.writers.writeJSON "status.json" {
|
||||||
title = "Service Status";
|
title = "Service Status";
|
||||||
panels = map (
|
panels = lib.imap0 (
|
||||||
|
index:
|
||||||
{ name, service }:
|
{ name, service }:
|
||||||
{
|
{
|
||||||
|
title = name;
|
||||||
|
type = "stat";
|
||||||
|
gridPos = rec {
|
||||||
|
h = 3;
|
||||||
|
w = 4;
|
||||||
|
x = index * w;
|
||||||
|
y = index * h;
|
||||||
|
};
|
||||||
datasource = {
|
datasource = {
|
||||||
type = "prometheus";
|
type = "prometheus";
|
||||||
uid = "prometheus";
|
uid = "prometheus";
|
||||||
};
|
};
|
||||||
fieldConfig = {
|
fieldConfig = {
|
||||||
defaults = {
|
defaults = {
|
||||||
color = {
|
color.mode = "thresholds";
|
||||||
mode = "thresholds";
|
|
||||||
};
|
|
||||||
mappings = [
|
mappings = [
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
"0" = {
|
"0".text = "Failed";
|
||||||
color = "red";
|
"1".text = "Running";
|
||||||
index = 1;
|
|
||||||
text = "Failed";
|
|
||||||
};
|
|
||||||
"1" = {
|
|
||||||
color = "green";
|
|
||||||
index = 0;
|
|
||||||
text = "Running";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
type = "value";
|
type = "value";
|
||||||
}
|
}
|
||||||
|
|
@ -52,8 +51,6 @@ pkgs.writers.writeJSON "status.json" {
|
||||||
expr = "node_systemd_unit_state{name=\"${service}\",state=\"active\"}";
|
expr = "node_systemd_unit_state{name=\"${service}\",state=\"active\"}";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
title = name;
|
|
||||||
type = "stat";
|
|
||||||
}
|
}
|
||||||
) services;
|
) services;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue