Monitor fmd-server SQLite database locations with NTFY notifications.
- Python 100%
| .gitignore | ||
| fmd_alive.py | ||
| LICENSE | ||
| pyproject.toml | ||
| README.md | ||
| uv.lock | ||
fmd-alive
Monitor fmd-server SQLite database locations with NTFY notifications.
This script monitors new locations in a SQLite table for a given user and sends a notification via NTFY if no changes are detected. It is designed to be run periodically via cron.
Features
- Monitor entries in fmd-server SQLite table (
locations). - Compare with a previous state stored in a file.
- Send notifications via NTFY when no changes occur.
Prerequisites
- Python 3.8 or higher.
- Access to a SQLite database.
- A NTFY topic for notifications.
uvfor dependency management (optional, but recommended).
Installation
1. Clone the repository
git clone https://git.mtrlc.xyz/remi/fmd-alive.git
cd fmd-alive
2. Install dependencies
With uv (recommended):
uv sync
Or with pip:
pip install requests
Usage
Manual execution
python3 fmd_alive.py "username" "/path/to/db.sqlite" "/state/dir" "https://ntfy.sh/your_topic"
Or with uv:
uv run fmd_alive.py "username" "/path/to/db.sqlite" "/state/dir" "https://ntfy.sh/your_topic"
Cron execution
(for installation with uv, using uv's virtualenv)
-
Edit your crontab:
crontab -e -
Add a line to run the script every 2 hours:
0 */2 * * * /path/to/fmd-alive/.venv/bin/python /path/to/fmd-alive/fmd_alive.py "username" "/path/to/db.sqlite" "path/to/state/dir" "https://ntfy.sh/your_topic"
Dependencies
requests: To send notifications via NTFY.sqlite3: To interact with the SQLite database.