Monitor fmd-server SQLite database locations with NTFY notifications.
Find a file
2026-01-27 17:15:06 +01:00
.gitignore Initial commit 2026-01-27 15:48:20 +01:00
fmd_alive.py feat: switch to tracking last location ID 2026-01-27 17:06:09 +01:00
LICENSE feat: initial implementation of fmd-alive monitoring script 2026-01-27 16:29:49 +01:00
pyproject.toml feat: initial implementation of fmd-alive monitoring script 2026-01-27 16:29:49 +01:00
README.md docs: fix README and update cron examples 2026-01-27 17:15:06 +01:00
uv.lock feat: initial implementation of fmd-alive monitoring script 2026-01-27 16:29:49 +01:00

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.
  • uv for 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)

  1. Edit your crontab:

    crontab -e
    
  2. 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.