system-helpers/_man/src/systemd_check.1.md

34 lines
1.4 KiB
Markdown
Raw Normal View History

% systemd_check(1) systemd_check
% Alexander Schäferdiek
% January 2023
# NAME
systemd_check - Checks a set of systemd services, targets, mounts of timers, and notifies if their state is not up and running. Configuration is done in environment files.\
It's part of **system-helpers**.
# SYNOPSIS
**systemd_check**
# DESCRIPTION
**systemd_check** checks a set of systemd services, targets, mounts of timers, and notifies if their state is not up and running. It comes with systemd services.
By default, **systemd_check** tries to read from *$HOME/.systemd_check.conf* and */etc/systemd_check.conf* for configuration. It will exit with a non-zero exit code if it cannot find a proper configuration file.
The following are at least required for the script to work:\
- **SYSTEMD_CHECK_LIST_FILE="$HOME/.systemd_check.list"** which lists to be checked systemd services, timers or targets separated by lines.\
- **SYSTEMD_CHECK_MAIL_ENABLED=false** enables or disables sending mail notifications.
- **SYSTEMD_CHECK_MAIL_ADDRESS=""** which requires *mail.rc* to be configured and '*mailx*' command has be available.\
You can copy this script to */usr/local/bin* and use create a custom **CONFIG_FILE** as user.
# EXAMPLE
Create a *$HOME/.systemd_check.conf* and add *SYSTEMD_CHECK_MAIL_ADDRESS="alias@domain.tld"*. Notifications will be delivered to alias@domain.tld. Examples can be found in */usr/share/doc/systemd_check*.
# EXIT VALUES
**0**
: Success
**1**
: Error