uwatch
monitors the state of a systemd unit and outputs messages based on its status.
Run the following commands:
git clone https://github.com/e-tho/uwatch
cd uwatch
cargo build --release
An executable file will be generated at target/release/uwatch
, which you can then copy to a directory in your $PATH
.
Add the flake as an input:
uwatch.url = "github:e-tho/uwatch";
Install the package:
environment.systemPackages = [ inputs.uwatch.packages.${pkgs.system}.default ];
Specify the systemd unit to watch, along with the output for active and inactive states:
uwatch --unit myservice.service --active-output "<active_output>" --inactive-output "<inactive_output>"
Flag | Description | Supported Values | Default Value |
---|---|---|---|
--unit |
The systemd unit to monitor. | Any valid systemd unit | None |
--active-output |
Output when the unit is active. | Any string | None |
--inactive-output |
Output when the unit is inactive. | Any string | None |
--streaming |
Enable continuous monitoring (default). | None | enabled |
--oneshot |
Disable continuous monitoring (single check). | None | disabled |
GPLv3