monitord
monitord ... know how happy your systemd is! 😊
We offer the following run modes:
- systemd-timer (legacy cron would work too)
- Refer to monitord.timer and monitord.service unit files
- Ensure no
daemon:mode options are set inmonitord.conf
- daemon mode
- Enable daemon mode in configuration file
- Stats will be written to stdout every
daemon_stats_refresh_secs
Open to more formats / run methods ... Open an issue to discuss. Depends on the dependencies basically.
monitord is a config driven binary. We plan to keep CLI arguments to a minimum.
INFO level logging is enabled to stderr by default. Use -v to increase (DEBUG) and -q to reduce logging.
Install
Install via cargo or use as a dependency in your Cargo.toml.
cargo install monitord- Create (copy from repo) a
monitord.conf- Defaults to looking for it at /etc/monitord.conf
monitord --help
crl-linux:monitord cooper$ monitord --help
monitord 0.2.0
Cooper Ry Lees <me@cooperlees.com>
monitord: Know how happy your systemd is! 😊
USAGE:
monitord [OPTIONS]
OPTIONS:
-c, --config <CONFIG>
Location of your monitord config
[default: /etc/monitord.conf]
-h, --help
Print help information
-q, --quiet
Less output per occurrence
-v, --verbose
More output per occurrence
-V, --version
Print version information
Config
monitord can have the different components monitored. To enable / disabled set the following in our monitord.conf. This file is ini format to match systemd unit files.
# Pure ini - no yes/no for bools
[monitord]
# Set a custom dbus address to connect to
# OPTIONAL: If not set, we default to the Unix socket below
dbus_address = unix:path=/run/dbus/system_bus_socket
# Get debug output
debug = false
# Run as a daemon or 1 time
daemon = false
# Time to refresh systemd stats in seconds
# Daemon mode only
daemon_stats_refresh_secs = 60
# cron/systemd timer output format
# Supported: json, json-flat, json-pretty
output_format = json
# TODO: implement
[journald]
enabled = false
# Grab networkd stats from files + networkctl
[networkd]
enabled = true
link_state_dir = /run/systemd/netif/links
# Grab unit status counts via dbus
[units]
enabled = true
Output Formats
json
Normal serde_json non pretty JSON. All on one line. Most compact format.
json-flat
Move all key value pairs to the top level and . notate compononets + sub values. Is semi pretty too + custom. All unittested ...
json-pretty
Normal serde_json pretty representations of each componoents structs.
Development
To do test runs (requires systemd and systemd-networkd installed)
-
Pending what you have enabled in your config ...
-
cargo run -- -c monitord.conf -v
Ensure the following pass before submitting a PR (CI checks):
cargo testcargo clippycargo fmt