A utility for monitoring and logging block device stats to a JSON file at a regular time interval.
git clone https://github.com/The-Good-Penguin/tgp-krill-kounter.git
cmake -S . -B build
KrillKounter
executable within the build/
subdirectory. cmake --build build
build/
subdirectory, run the command sudo cmake --build . --target install
. This will install the executable to /usr/bin/KrillKounter
, and the systemd service file to /lib/systemd/system/KrillKounter.service
.Enviroment
values within /lib/systemd/system/KrillKounter.service
;KK_CONFIG_PATH - Path to the JSON file to be used for configuring the daemon in JSON instead of configuring via the variables below
KK_STATS_PATH - Path to the JSON file to be used for logging of block device stats and info.
KK_DEVICE_PATH - Path to the target block device to be monitored by KrillKounter [e.g. /dev/sda]
KK_DEVICE_NAME - Name of the target block device to be monitored by KrillKounter [e.g. sda]
KK_UPDATE_RATE - Time interval to wait between JSON file updates, in seconds.
systemctl enable --now KrillKounter.service
. The state of the KrillKounter service can be monitored using the command systemctl status KrillKounter
.{
"devices": [
"/dev/sda",
"/dev/mmcblk0"
],
"updateRate": 3600,
"statsFilePath": "/usr/share/KrillKounter/stats.json"
}
devices is an array of device paths you wish to monitor
Issue a PR and follow the guidelines outlined in the CodingStyle.md