renamed program to ingest from 'emitter' #1

Merged
serversdown merged 1 commits from agent into main 2026-02-06 17:27:50 -05:00
3 changed files with 24 additions and 24 deletions

View File

@@ -20,7 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [0.1.0] - 2025-12-04
### Added
- Initial release of Series 4 Emitter
- Initial release of Series 4 Ingest Agent
- Micromate (Series 4) heartbeat monitoring for Seismo Fleet Manager
- THORDATA folder scanner for MLG files
- Automatic detection of newest MLG file per unit by timestamp

View File

@@ -1,12 +1,12 @@
# Series 4 Emitter
# Series 4 Ingest Agent
**Version:** 0.1.2
Micromate (Series 4) heartbeat emitter for Seismo Fleet Manager (SFM).
Micromate (Series 4) ingest agent for Seismo Fleet Manager (SFM).
## Overview
Series 4 Emitter is a Python-based monitoring tool that scans for Micromate unit activity logs and reports their status. It monitors MLG (Micromate Log) files in the THORDATA directory structure, determines unit health based on last activity, and optionally transmits heartbeat data to a Seismo Fleet Manager backend.
Series 4 Ingest Agent is a Python-based monitoring tool that scans for Micromate unit activity logs and reports their status. It monitors MLG (Micromate Log) files in the THORDATA directory structure, determines unit health based on last activity, and optionally transmits heartbeat data to a Seismo Fleet Manager backend.
## Features
@@ -30,10 +30,10 @@ Series 4 Emitter is a Python-based monitoring tool that scans for Micromate unit
1. Clone or copy this repository to your THOR PC/VM
2. Ensure Python 3.6+ is installed
3. Configure `config.json` (see Configuration section)
4. Run the emitter:
4. Run the agent:
```bash
python series4_emitter.py
python series4_ingest.py
```
## Configuration
@@ -68,23 +68,23 @@ All configuration is managed through `config.json` in the same directory as the
### Fallback Behavior
If `config.json` is missing or malformed, the emitter will:
If `config.json` is missing or malformed, the agent will:
- Display a warning message
- Use built-in default values
- Continue running normally
## Usage
### Start the Emitter
### Start the Agent
```bash
python series4_emitter.py
python series4_ingest.py
```
### Console Output Example
```
Series 4 Emitter — Micromate Heartbeat (v0.1.2)
Series 4 Ingest Agent — Micromate Heartbeat (v0.1.2)
THORDATA root: C:\THORDATA
Now: 2025-12-08 14:30:00
--------------------------------------------------------------------------------
@@ -96,9 +96,9 @@ Total units: 3
Next scan in 60 seconds...
```
### Stop the Emitter
### Stop the Agent
Press `Ctrl+C` to gracefully stop the emitter.
Press `Ctrl+C` to gracefully stop the agent.
## Status Classification
@@ -110,13 +110,13 @@ Units are classified based on the age of their last MLG file:
## SFM Backend Integration
When `sfm_endpoint` is configured, the emitter sends JSON payloads to the Seismo Fleet Manager:
When `sfm_endpoint` is configured, the agent sends JSON payloads to the Seismo Fleet Manager:
### Payload Structure
```json
{
"source": "series4_emitter",
"source": "series4_ingest",
"generated_at": "2025-12-08T14:30:00",
"units": [
{
@@ -145,7 +145,7 @@ Set `sfm_endpoint` to an empty string in `config.json`:
## MLG File Format
The emitter expects MLG files to follow this naming convention:
The agent expects MLG files to follow this naming convention:
```
UM<unit_number>_YYYYMMDDHHMMSS.MLG
@@ -178,7 +178,7 @@ C:\THORDATA\
## Troubleshooting
### Config file not found
If you see `[WARN] Config file not found`, create `config.json` in the same directory as `series4_emitter.py`.
If you see `[WARN] Config file not found`, create `config.json` in the same directory as `series4_ingest.py`.
### THORDATA path doesn't exist
Verify the `thordata_path` in `config.json` points to the correct directory.

View File

@@ -1,7 +1,7 @@
"""
Series 4 Emitter v0.1.2
Series 4 Ingest Agent v0.1.2
Micromate (Series 4) heartbeat emitter for Seismo Fleet Manager (SFM).
Micromate (Series 4) ingest agent for Seismo Fleet Manager (SFM).
Behavior:
- Scans C:\THORDATA\<Project>\<UM####>\*.MLG
@@ -265,7 +265,7 @@ def print_heartbeat(unit_map: Dict[str, Dict[str, Any]]) -> None:
now = datetime.now()
clear_console()
print("Series 4 Emitter — Micromate Heartbeat (v0.1.2)")
print("Series 4 Ingest Agent — Micromate Heartbeat (v0.1.2)")
print(f"THORDATA root: {THORDATA_PATH}")
print(f"Now: {now.strftime('%Y-%m-%d %H:%M:%S')}")
print("-" * 80)
@@ -305,7 +305,7 @@ def build_sfm_payload(unit_map: Dict[str, Dict[str, Any]]) -> Dict[str, Any]:
Structure (example):
{
"source": "series4_emitter",
"source": "series4_ingest",
"generated_at": "2025-12-04T20:01:00Z",
"units": [
{
@@ -353,7 +353,7 @@ def build_sfm_payload(unit_map: Dict[str, Dict[str, Any]]) -> Dict[str, Any]:
)
payload = {
"source": "series4_emitter",
"source": "series4_ingest",
"generated_at": now_utc.strftime("%Y-%m-%dT%H:%M:%SZ"),
"units": payload_units,
}
@@ -366,7 +366,7 @@ def emit_sfm_payload(unit_map: Dict[str, Dict[str, Any]]) -> None:
This is intentionally conservative:
- If SFM_ENDPOINT is empty -> do nothing
- If any error occurs -> print to stderr, but do not crash the emitter
- If any error occurs -> print to stderr, but do not crash the agent
"""
if not SFM_ENDPOINT:
return
@@ -400,7 +400,7 @@ def emit_sfm_payload(unit_map: Dict[str, Dict[str, Any]]) -> None:
def main() -> None:
print("Starting Series 4 Emitter (Micromate) v0.1.2")
print("Starting Series 4 Ingest Agent (Micromate) v0.1.2")
print(f"THORDATA_PATH = {THORDATA_PATH}")
print(f"SCAN_INTERVAL = {SCAN_INTERVAL} seconds")
print(f"LATE_DAYS = {LATE_DAYS}, STALE_DAYS = {STALE_DAYS}")
@@ -431,7 +431,7 @@ def main() -> None:
print("[LOOP] Woke up for next scan", flush=True)
except KeyboardInterrupt:
print("\nSeries 4 Emitter stopped by user.")
print("\nSeries 4 Ingest Agent stopped by user.")