Go to file
2024-12-21 15:03:39 +02:00
.gitignore Initial commit 2024-12-21 15:03:39 +02:00
config.py Initial commit 2024-12-21 15:03:39 +02:00
disk_monitor.py Initial commit 2024-12-21 15:03:39 +02:00
disk_monitor.service Initial commit 2024-12-21 15:03:39 +02:00
lib.py Initial commit 2024-12-21 15:03:39 +02:00
mem_monitor.py Initial commit 2024-12-21 15:03:39 +02:00
mem_monitor.service Initial commit 2024-12-21 15:03:39 +02:00
README.md Initial commit 2024-12-21 15:03:39 +02:00

Monitor Memory and Disk usage

The scripts in this repo monitors for high memory usage and low disk space available.

It sends a notification using notify-send to the user.

For memory, when the condition is met, a signal is sent (e.g. SIGSTOP, SIGKILL).

Configure

In config.py you could configure how often to monitor for memory usage and disk usage and what are the limits for each.

You could also configure whether to send the STOP signal or KILL signal (or something else). If you send the STOP signal, the process can be continued using SIGCONT signal.

You can also configure the icon used by notify-send.

Install

Change the WorkingDirectory param in the two service files.

Copy the mem_monitor.service and disk_monitor.service files into /etc/systemd/system.

Then run:

systemctl daemon-reload
systemctl enable mem_monitor.service
systemctl enable disk_monitor.service
systemctl start mem_monitor.service
systemctl start disk_monitor.service

Check if there might be any errors using journalctl -fu mem_monitor.service or journalctl -fu disk_monitor.service.