85 lines
2.3 KiB
Markdown
85 lines
2.3 KiB
Markdown
# Series 3 Watcher v1.3
|
|
|
|
A lightweight Python script that monitors Instantel **Series 3 (Minimate)** call-in activity on a Blastware server.
|
|
|
|
It scans the event folder, reads `.MLG` headers to identify unit IDs, and prints a live status table showing:
|
|
|
|
- Last event received
|
|
- Age since last call-in
|
|
- OK / Pending / Missing states
|
|
- Detected units (no roster required)
|
|
- Optional API heartbeat to Seismograph Fleet Manager backend
|
|
|
|
This script is part of the larger **Seismograph Fleet Manager** project.
|
|
|
|
---
|
|
|
|
## Requirements
|
|
|
|
- Python 3.8 (Windows 7 compatible)
|
|
- Blastware 10 event folder available locally
|
|
- `config.ini` in the same directory as the script
|
|
|
|
Install dependencies with:
|
|
|
|
`pip install -r requirements.txt`
|
|
|
|
---
|
|
|
|
## Usage
|
|
|
|
Run the agent from the folder containing the script:
|
|
|
|
`python series3_watcher.py`
|
|
|
|
The script will:
|
|
|
|
1. Scan the Blastware event folder for `.MLG` files (within a max age window).
|
|
2. Sniff each file header for the unit ID.
|
|
3. Print a status line for each detected unit (OK / Pending / Missing).
|
|
4. Optionally POST a heartbeat payload on an interval when `API_ENABLED=true`.
|
|
5. Write logs into the `agent_logs/` folder and auto-clean old logs.
|
|
|
|
---
|
|
|
|
## Config
|
|
|
|
All settings are stored in `config.ini`.
|
|
|
|
Key fields:
|
|
|
|
- `SERIES3_PATH` — folder containing `.MLG` files
|
|
- `SCAN_INTERVAL_SECONDS` — how often to scan
|
|
- `OK_HOURS` / `MISSING_HOURS` — thresholds for status
|
|
- `MLG_HEADER_BYTES` — how many bytes to sniff from each `.MLG` header
|
|
- `RECENT_WARN_DAYS` — log unsniffable files newer than this window
|
|
- `MAX_EVENT_AGE_DAYS` — ignore events older than this many days
|
|
- `API_ENABLED` — enable/disable heartbeat POST
|
|
- `API_URL` — heartbeat endpoint
|
|
- `API_INTERVAL_SECONDS` — heartbeat frequency
|
|
- `SOURCE_ID` / `SOURCE_TYPE` — identifiers included in the API payload
|
|
- `LOG_RETENTION_DAYS` — auto-delete logs older than this many days
|
|
- `COLORIZE` — ANSI color output (off by default for Win7)
|
|
|
|
---
|
|
|
|
## Logs
|
|
|
|
Logs are stored under `agent_logs/`.
|
|
Git ignores all log files but keeps the folder itself.
|
|
|
|
---
|
|
|
|
## Versioning
|
|
|
|
This repo follows **Semantic Versioning (SemVer)**.
|
|
|
|
Current release: **v1.3.0** — renamed to series3-watcher.
|
|
See `CHANGELOG.md` for details.
|
|
|
|
---
|
|
|
|
## License
|
|
|
|
Private / internal project.
|