Skip to main content

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.
vast_host Hostname of the VAST management server (VMS). Required for ihome file systems.
vast_user Username for the VAST API. Read-only permissions are sufficient.
vast_password Password for the VAST API.
vast_token VAST API token. Use instead of vast_user/vast_password.
vast_ca_cert CA bundle used to verify the VAST management server certificate. Not verified if unset.

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.

VAST API Credentials

Quotas for ihome file systems are read directly from the VAST management API using vastpy, so the vast_host setting and exactly one of vast_token or vast_user/vast_password are required whenever an ihome file system is configured. The credentials only need read-only access to quota information:

{
  "vast_host": "vms.domain.com",
  "vast_user": "readonly-user",
  "vast_password": "********"
}

Since the settings file now contains credentials, restrict its permissions so only the account running the notifier can read it (e.g., chmod 600 /etc/notifier/settings.json).

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 and limits are read from the VAST management API by matching each user's home directory (as reported by the system password database) against the path of quotas configured in VAST. The notifier does not need read access to user home directories. Users without a quota, or whose quota has no hard or soft limit, are skipped. See VAST API Credentials.

vast — Usage is determined with os.statvfs against a group directory on VAST-hosted storage (organized the same way as generic file systems). Since VAST reports the quota limit as the size of the underlying file system when no quota is configured, a group is skipped if its reported size is within 1% of the enclosing mount point's size.

Metadata

Release files for quota-notifier 0.6.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quota-notifier 0.6.8
File Size Uploaded Provenance
quota_notifier-0.6.8.tar.gz 32.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for quota-notifier 0.6.8
File Interpreter ABI Platform
quota_notifier-0.6.8-py3-none-any.whl Python 3 none any Details

Total release size: 66.7 kB

Release files / quota_notifier-0.6.8.tar.gz

Download URL quota_notifier-0.6.8.tar.gz
Size 32.1 kB
Tags Source
SHA-256 checksum
How to use checksums
058e672db550fc23c221c533db580f3845334ed67911fcfdaf8648dc6593682c
BLAKE2b-256 checksum
How to use checksums
0307787582001eb29aa71d7e7caad807649115d4900486e1d3602aabef5f7955
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / quota_notifier-0.6.8-py3-none-any.whl

Download URL quota_notifier-0.6.8-py3-none-any.whl
Size 34.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29829a9827196473eebc27d2c6a78fd508afde23a99bd9ecdd0567949074ed0e
BLAKE2b-256 checksum
How to use checksums
50194f3172077f50d74b334b5270d236f27b9090a2b9025bade4a56a67473d1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for quota-notifier 0.6.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page