Diskhoundd is a Linux daemon designed to monitor disk space usage and provide alerts when the disk space falls below a certain threshold. It can be configured via a configuration file and can watch multiple mount paths for disk space utilization.
-
Clone the repository:
git clone https://github.com/adnanhashmi09/diskhoundd
-
Compile the source code:
cd diskhoundd make
-
Install the binary and configuration file:
sudo make install
-
Enable diskhoundd daemon:
sudo systemctl enable diskhoundd.service sudo systemctl start diskhoundd.service
To run Diskhoundd, use the following command:
./build/diskhoundd -c /path/to/diskhoundd.cfg /path/to/mount/point1 /path/to/mount/point2 ...
or copy ./build/diskhoundd
executable to /usr/bin/
to simple use diskhoundd
command
The configuration file (default name: diskhoundd.cfg
) can specify the following options:
log_file_path
: Path to the log file (default:/var/log/diskhoundd.log
)icon_path
: Path to the icon file for alerts (default:./assets/diskhound-small.png
)critical_disk_perc
: Critical disk percentage threshold (default:20
)
log_file_path = /var/log/diskhoundd.log
icon_path = ./assets/diskhound-small.png
critical_disk_perc = 20
Diskhoundd can be run as a systemd service using the provided diskhoundd.service
file.
-
Copy
diskhoundd.service
to systemd service directory:sudo cp diskhoundd.service /etc/systemd/system/
Content of the diskhoundd.service file is as follows:
[Unit] Description=Diskhound Daemon [Service] Type=Simple ExecStart=/usr/bin/diskhoundd -c /etc/diskhoundd/diskhoundd.cfg / Restart=always User=root Group=root Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus [Install] WantedBy=multi-user.target
-
Copy
session-local.conf
to/etc/dbus-1
if you want to run this daemon as root.<busconfig> <policy context="mandatory"> <allow user="root"/> </policy> </busconfig>
-
Reload systemd to load the new service:
sudo systemctl daemon-reload
-
Enable and start the service:
sudo systemctl enable diskhoundd sudo systemctl start diskhoundd