Quota Notification Utility
notifier is a command line utility for emailing users when their storage usage on a
monitored file system crosses a configured threshold.
Requirements
The df command line utility must be installed on the host system.
Installation
Install the package with pip (or pipx):
pip install quota-notifier
Quick Start
Application settings are read from /etc/notifier/settings.json. If the file does not
exist, the application runs using default settings. The example below is a minimal
configuration that covers most deployments:
{
"log_path": "/home/notifier.log",
"log_level": "INFO",
"db_url": "sqlite:///home/notifier_data.db",
"uid_blacklist": [
0
],
"gid_blacklist": [
0
],
"file_systems": [
{
"name": "Example File System",
"path": "/example",
"type": "generic",
"thresholds": [
50,
75
]
}
],
"email_from": "no-reply@domain.com",
"email_domain": "@domain.com",
"admin_emails": [
"admin.user@domain.com"
]
}
Validate the settings file without sending any email:
notifier --validate
Send any pending notifications:
notifier
Notifications are normally automated with a cron job. Running at least once per day is recommended:
0 9 * * 0-6 notifier
Usage
| Command | Description |
|---|---|
notifier |
Send any pending email notifications. |
notifier --validate |
Validate the settings file and exit. Exits silently when settings are valid, otherwise prints the invalid settings. |
notifier --debug |
Run without committing to the database or sending email. |
notifier --debug -vv |
Dry run with verbose output, useful for checking which users would have been notified. |
Run notifier --help for the full argument list.
Configuration
Core Settings
| Setting | Default | Description |
|---|---|---|
file_systems |
[] |
List of file systems to examine. See File System Settings. |
uid_blacklist |
[0] |
Do not notify users with these UID values. |
gid_blacklist |
[0] |
Do not notify groups with these GID values. |
disk_timeout |
30 |
Give up on checking a file system after this many seconds. |
log_level |
INFO |
Application logging level. One of DEBUG, INFO, WARNING, or ERROR. |
log_path |
Optionally log application events to a file. | |
smtp_host |
System default | Name of the SMTP host server. |
smtp_port |
System default | Port for the SMTP server. |
db_url |
sqlite:///notifier_data.db |
URL for the application database. By default a SQLite database is created in the working directory. |
email_from |
no-reply@domain.com |
From address for automatically generated emails. |
email_subject |
CRC Disk Usage Alert |
Subject line for automatically generated emails. |
email_domain |
@domain.com |
Appended to usernames when generating email addresses. The leading @ is optional. |
admin_emails |
[] |
Admin users to contact when the application hits a critical issue. |
debug |
False |
Disable database commits and email notifications. Useful for development and testing. |
File System Settings
Each entry in the file_systems list requires the following fields:
| Setting | Description |
|---|---|
name |
Human-readable name for the file system. |
path |
Absolute path to the mounted file system. |
type |
File system type. One of ihome, generic, beegfs, or vast. |
thresholds |
Usage percentages to issue notifications for. |
Adding a new file system type also requires updating QuotaType in
quota_notifier.disk_utils.QuotaFactory.
Blacklisting Users and Groups
The uid_blacklist and gid_blacklist options accept individual ID values and
inclusive ID ranges. To ignore the root user in addition to users 100 through 199:
{
"uid_blacklist": [
0,
[
100,
199
]
]
}
The default value for both options is [0], which excludes the root user and group.
Email Template
The email sent to users is rendered from an HTML template at
/etc/notifier/template.html, which is intended to be customized. Formatted fields are
indicated with curly braces:
| Template Field | Description |
|---|---|
usage_summary |
A plain text table summarizing the user's current storage usage. |
Supported File Systems
Most file systems are supported by default, with dedicated support for the types below.
Generic — Any file system where usage and available space can be determined with
os.statvfs. Generic file systems must be organized so that each subdirectory is
named after a user group. For a file system mounted at /mnt, the directory for group
group1 must be /mnt/group1. Directories not named after a user group are ignored,
and a directory does not have to exist for every group.
BeeGFS — Quota information is read directly from the beegfs-ctl utility, so there
are no requirements on how the file system is organized.
ihome — Usage is determined with os.statvfs against the user's home directory.
Since VAST reports the quota limit as the size of the underlying file system when no
quota is configured, a user is skipped if their reported size is within 1% of the
enclosing mount point's size.
vast — Usage is determined the same way as ihome, but against a group directory on VAST-hosted storage (organized the same way as generic file systems).
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quota_notifier-0.6.7.tar.gz.
File metadata
- Download URL: quota_notifier-0.6.7.tar.gz
- Upload date:
- Size: 29.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
263096aeb1ef83f10ac1dae83e3769d9a1006f6e87f85f789f0f399566923f95
|
|
| MD5 |
22f464694df28490a4fc1cbc9ffc0a13
|
|
| BLAKE2b-256 |
6ed57fdf6e575934e19a8c72f1347f730e0e97f93ef66ad00d09f49978e2592a
|
File details
Details for the file quota_notifier-0.6.7-py3-none-any.whl.
File metadata
- Download URL: quota_notifier-0.6.7-py3-none-any.whl
- Upload date:
- Size: 32.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5dbce806c208b5a62db5ec200e0d206689d6ef04dbc3c7c92f89372676d0dc30
|
|
| MD5 |
a37120fc238ff3dc525b3867040cd409
|
|
| BLAKE2b-256 |
719481a689fc6ff4c16ac0e7d7211f2e66fd0e34ab4f7fe6a3c7f328d4221333
|