psi-alerts/CONFIGURE.md

52 lines
1.6 KiB
Markdown

# CONFIGURE
Included in this project are a number of systemd units:
* psi-monitor.service
* uses psi-monitor executable (in /usr/bin/)
* psi-alerts@.service (system template service)
* uses psi-alerts.sh script
The `psi-alerts.sh` is essentially a daemon (a systemd simple service), and for
now the systemd template needs to be instantiated with the username that will
execute `psi-alerts.sh`. Also, a systemd unit override should be created, like
so:
```
sudo systemctl edit psi-alerts@<user>.service
```
This will open an editor, and in later versions of systemd the comment code will be included, clearly showing where the override should be entered:
```
### Editing /etc/systemd/system/psi-alerts@trey.service.d/override.conf
### Anything between here and the comment below will become the contents of the drop-in file
[Service]
Environment=EMAIL_TO="email@domain.tld"
Environment=SMS_DST="phone_number@sms.domain.tld"
Environment=NOTIFICATION_CMD="dunstify"
Environment=NOTIFICATION_OPTS="--timeout=0 --printid --urgency=critical --icon=/usr/share/icons/breeze-dark/emblems/16/emblem-warning.svg"
Environment=NOTIFICATION_IDX=15
Environment=SSH_USER="username"
Environment=SSH_HOST="localhost"
Environment=SSH_PORT=5999
Environment=SSH_ID_PATH="~user/.ssh/psi-alerts"
Environment=CLEAR_THRESHOLD="5.0"
### Edits below this comment will be discarded
### /etc/systemd/system/psi-alerts@.service
# [Unit]
# Description=Pressure Stall Information (PSI) alerts
# PartOf=multi-user.target
# After=psi-monitor.service
#
# [Service]
# User=%i
# Type=simple
# ExecStart=psi-alerts.sh
#
# [Install]
# WantedBy=multi-user.target
```