Crates.io | killjoy-notifier-logfile |
lib.rs | killjoy-notifier-logfile |
version | 0.2.0 |
source | src |
created_at | 2019-09-02 20:05:29.179739 |
updated_at | 2019-11-03 20:19:52.780718 |
description | Log unit state changes on behalf of killjoy. |
homepage | |
repository | https://github.com/Ichimonji10/killjoy-notifier-logfile |
max_upload_size | |
id | 161650 |
size | 61,790 |
Log unit state changes on behalf of killjoy.
killjoy is a systemd unit monitoring application. It discovers systemd units and tracks their states. When a unit changes to a state of interest, killjoy contacts notifiers. This application is a notifier which, upon being contacted by killjoy, will write to a CSV log file on its behalf.
First, read the concepts section in the killjoy documentation.
This application is short-lived, so as to reduce RAM usage. When properly installed, this application will be auto-started whenever a D-Bus message is sent to it. When started, this application will consume all messages (presumably from killjoy) in its message queue, and then idle. If no messages arrive for more than a few seconds, this application quits.
Arch Linux users may use the killjoy-notifier-logfile-git AUR package. A stable package will be created when this application further matures.
Rust developers may install this app from source. Note that libdbus must be
installed. (On Ubuntu, this is provided by the libdbus-1-dev
package.)
git clone https://github.com/Ichimonji10/killjoy-notifier-logfile.git
cd killjoy-notifier-logfile
scripts/install.sh
No configuration is necessary or possible.
Define a notifier in killjoy's configuration file:
"logfile": {
"bus_type": "session",
"bus_name": "name.jerebear.KilljoyNotifierLogfile1"
}
Then, list it in a rule's list of notifiers
.
When this application receives a message, it will write to
$XDG_DATA_HOME/killjoy-notifier-logfile/log.csv
, ($XDG_DATA_HOME
is most
commonly ~/.local/share
) with three or more columns, where the final columns
list the states that the unit has entered from newest to oldest. For example,
the following lines might be logged if syncthing.service
restarts:
2019-08-24T14:32:35.272529-04:00,syncthing.service,deactivating,active
2019-08-24T14:32:35.697160-04:00,syncthing.service,inactive,deactivating
2019-08-24T14:32:35.700217-04:00,syncthing.service,active,inactive
The timestamps are in RFC 3339 format.
See annotated git tags.
This application is licensed under the GPLv3 or any later version.