mirror of
https://forgejo.altau.su/lego/lego-monitoring.git
synced 2026-03-10 04:41:10 +00:00
prepare config for healthchecks integration
This commit is contained in:
parent
4558cf9e6f
commit
c01ab8303c
8 changed files with 89 additions and 34 deletions
|
|
@ -31,9 +31,15 @@ package:
|
|||
serviceConfigFile = json.generate "config.json" {
|
||||
enabled_check_sets = cfg.enabledCheckSets;
|
||||
log_level = cfg.logLevel;
|
||||
telegram = with cfg.telegram; {
|
||||
creds_secret_path = credsSecretPath;
|
||||
room_id = roomId;
|
||||
alert_channels = {
|
||||
telegram = with cfg.alertChannels.telegram; if enable then
|
||||
{
|
||||
creds_secret_path = credsSecretPath;
|
||||
room_id = roomId;
|
||||
} else null;
|
||||
healthchecks = with cfg.alertChannels.healthchecks; if enable then {
|
||||
pinging_keys_secret_path = pingingKeysSecretPath;
|
||||
} else null;
|
||||
};
|
||||
checks = {
|
||||
temp.sensors = lib.mapAttrs (_: sensorCfg: {
|
||||
|
|
|
|||
|
|
@ -50,14 +50,32 @@ in
|
|||
* vulnix -- periodically scans system for known CVEs, alerts if any are found (NixOS only)'';
|
||||
};
|
||||
|
||||
telegram = {
|
||||
credsSecretPath = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Path to a file containing Telegram api_id, api_hash, and bot token, separated by the `,` character.";
|
||||
alertChannels = {
|
||||
telegram = {
|
||||
enable = lib.mkEnableOption "Telegram notification channel";
|
||||
credsSecretPath = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
description = "Path to a file containing Telegram api_id, api_hash, and bot token, separated by the `,` character.";
|
||||
};
|
||||
roomId = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = 0;
|
||||
description = "ID of chat where to send alerts.";
|
||||
};
|
||||
};
|
||||
roomId = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
description = "ID of chat where to send alerts.";
|
||||
healthchecks = {
|
||||
enable = lib.mkEnableOption "[Healthchecks](https://healthchecks.io) notification channel";
|
||||
pingingKeysSecretPath = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
description = ''
|
||||
Path to a file containing the pinging keys in a `slug:key` format, one on each line (ex: `lego-cpu:aaaaaaaaaaaaaaaaaaaaaa`).
|
||||
Specify `default` as the slug to use this key for check types that don't have a key explicitly assigned to them.
|
||||
|
||||
If you are unsure of the exact slug a check will generate, it is recommended to try it out with the default key first, before
|
||||
assigning a specific one.'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue