improving prometheus
This commit is contained in:
parent
d78761f434
commit
3a7dcaea0f
2 changed files with 16 additions and 1 deletions
|
@ -40,6 +40,21 @@
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
name = "home-assistant";
|
||||||
|
rules = [
|
||||||
|
{
|
||||||
|
record = "home_open_window_sum";
|
||||||
|
expr = ''sum( homeassistant_binary_sensor_state{entity=~"binary_sensor\\.window_02_contact|binary_sensor\\.window_03_contact|binary_sensor\\.window_04_contact|binary_sensor\\.window_05_contact|binary_sensor\\.window_06_contact|binary_sensor\\.window_07_contact"} )'';
|
||||||
|
}
|
||||||
|
] ++ (map
|
||||||
|
(number:
|
||||||
|
{
|
||||||
|
record = "home_at_least_n_windows_open";
|
||||||
|
expr = ''home_open_window_sum >= bool ${toString number}'';
|
||||||
|
labels.n = number;
|
||||||
|
}) [ 1 2 3 ]);
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}))
|
}))
|
||||||
];
|
];
|
||||||
|
|
|
@ -31,7 +31,7 @@ in
|
||||||
systemd_units = { };
|
systemd_units = { };
|
||||||
internet_speed.interval = "50m";
|
internet_speed.interval = "50m";
|
||||||
nginx.urls = [ "http://localhost/nginx_status" ];
|
nginx.urls = [ "http://localhost/nginx_status" ];
|
||||||
ping = [{ urls = [ "10.100.0.1" ]; }];
|
ping = [{ urls = [ "10.100.0.1" ]; }]; # actually important to make pepe visible over wireguard
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue