Skip to content

Latest commit

 

History

History
57 lines (38 loc) · 1.64 KB

README.md

File metadata and controls

57 lines (38 loc) · 1.64 KB

uwatch

About

uwatch monitors the state of a systemd unit and outputs messages based on its status.

Installation

Build from source

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.

Nix

Add the flake as an input:

uwatch.url = "github:e-tho/uwatch";

Install the package:

environment.systemPackages = [ inputs.uwatch.packages.${pkgs.system}.default ];

Usage

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>"

Available Options

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

License

GPLv3