add script for writing to the pipe

This commit is contained in:
Alex Tau 2025-12-19 18:26:11 +03:00
parent 10e79d6827
commit 191839d30f
12 changed files with 223 additions and 158 deletions

View file

@ -79,6 +79,7 @@ package:
ups = with cfg.checks.ups; {
ups_to_check = upsToCheck;
upsmon_group = upsmonGroup;
};
};
};
@ -97,5 +98,8 @@ package:
StartLimitBurst = 3;
};
};
power.ups.upsmon.settings = lib.mkIf (builtins.elem "ups" cfg.enabledCheckSets) {
NOTIFYCMD = "${package}/bin/write-ups-status";
};
};
}

View file

@ -1,5 +1,6 @@
{
lib,
config,
...
}:
@ -179,6 +180,11 @@ in
default = null;
description = "List of UPS's to monitor, in `upsc`-compatible format. If null, all UPS's connected to localhost are checked.";
};
upsmonGroup = lib.mkOption {
type = lib.types.str;
default = config.power.ups.upsmon.user;
description = "Group to allow to send UPS status updates. This should usually include the user upsmon runs as.";
};
};
};
};