A collection of Python utilities for monitoring Trunk-Recorder and ThinLine Radio instances, designed for deployment on a Debian VPS.
-
Usage Monitor: Tracks AssemblyAI transcription costs and hours against a customizable billing cycle (default: 20th of the month).
-
Activity Monitor: Queries PostgreSQL to detect new Talkgroups and Patches on the system that haven't been active in the last 48 hours.
-
Orchestrator: A master script that manages all timing logic, error handling, and Discord notifications for the suite.
-
Configure: Copy tlr_config.example.json to tlr_config.json.
-
Credentials: Update tlr_config.json with your PostgreSQL details, Discord Webhook URL, and n8n webhook paths.
-
Dependencies:
pip3 install requests psycopg2-binary
Instead of managing multiple cron jobs, add this single entry to your crontab -e to let the Orchestrator handle the schedule:
*/5 * * * * /usr/bin/python3 /home/brent/helper-scripts/talkgroup-monitor/tlr_orchestrator.py >> /home/brent/helper-scripts/talkgroup-monitor/orchestrator.log 2>&1
##Suite Components
-
tlr_usage_monitor.py: Handles transcription billing logic.
-
tlr_tg_monitor.py: Monitors for new/rare Talkgroups.
-
tlr_patch_monitor.py: Monitors for new multi-TG patches.
-
tlr_orchestrator.py: The master scheduler and error reporter.