renamed program to ingest from 'emitter'
This commit is contained in:
@@ -20,7 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
## [0.1.0] - 2025-12-04
|
## [0.1.0] - 2025-12-04
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- Initial release of Series 4 Emitter
|
- Initial release of Series 4 Ingest Agent
|
||||||
- Micromate (Series 4) heartbeat monitoring for Seismo Fleet Manager
|
- Micromate (Series 4) heartbeat monitoring for Seismo Fleet Manager
|
||||||
- THORDATA folder scanner for MLG files
|
- THORDATA folder scanner for MLG files
|
||||||
- Automatic detection of newest MLG file per unit by timestamp
|
- Automatic detection of newest MLG file per unit by timestamp
|
||||||
|
|||||||
30
README.md
30
README.md
@@ -1,12 +1,12 @@
|
|||||||
# Series 4 Emitter
|
# Series 4 Ingest Agent
|
||||||
|
|
||||||
**Version:** 0.1.2
|
**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
|
## 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
|
## 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
|
1. Clone or copy this repository to your THOR PC/VM
|
||||||
2. Ensure Python 3.6+ is installed
|
2. Ensure Python 3.6+ is installed
|
||||||
3. Configure `config.json` (see Configuration section)
|
3. Configure `config.json` (see Configuration section)
|
||||||
4. Run the emitter:
|
4. Run the agent:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python series4_emitter.py
|
python series4_ingest.py
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
@@ -68,23 +68,23 @@ All configuration is managed through `config.json` in the same directory as the
|
|||||||
|
|
||||||
### Fallback Behavior
|
### 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
|
- Display a warning message
|
||||||
- Use built-in default values
|
- Use built-in default values
|
||||||
- Continue running normally
|
- Continue running normally
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Start the Emitter
|
### Start the Agent
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python series4_emitter.py
|
python series4_ingest.py
|
||||||
```
|
```
|
||||||
|
|
||||||
### Console Output Example
|
### Console Output Example
|
||||||
|
|
||||||
```
|
```
|
||||||
Series 4 Emitter — Micromate Heartbeat (v0.1.2)
|
Series 4 Ingest Agent — Micromate Heartbeat (v0.1.2)
|
||||||
THORDATA root: C:\THORDATA
|
THORDATA root: C:\THORDATA
|
||||||
Now: 2025-12-08 14:30:00
|
Now: 2025-12-08 14:30:00
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
@@ -96,9 +96,9 @@ Total units: 3
|
|||||||
Next scan in 60 seconds...
|
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
|
## Status Classification
|
||||||
|
|
||||||
@@ -110,13 +110,13 @@ Units are classified based on the age of their last MLG file:
|
|||||||
|
|
||||||
## SFM Backend Integration
|
## 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
|
### Payload Structure
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"source": "series4_emitter",
|
"source": "series4_ingest",
|
||||||
"generated_at": "2025-12-08T14:30:00",
|
"generated_at": "2025-12-08T14:30:00",
|
||||||
"units": [
|
"units": [
|
||||||
{
|
{
|
||||||
@@ -145,7 +145,7 @@ Set `sfm_endpoint` to an empty string in `config.json`:
|
|||||||
|
|
||||||
## MLG File Format
|
## 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
|
UM<unit_number>_YYYYMMDDHHMMSS.MLG
|
||||||
@@ -178,7 +178,7 @@ C:\THORDATA\
|
|||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
### Config file not found
|
### 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
|
### THORDATA path doesn't exist
|
||||||
Verify the `thordata_path` in `config.json` points to the correct directory.
|
Verify the `thordata_path` in `config.json` points to the correct directory.
|
||||||
|
|||||||
@@ -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:
|
Behavior:
|
||||||
- Scans C:\THORDATA\<Project>\<UM####>\*.MLG
|
- Scans C:\THORDATA\<Project>\<UM####>\*.MLG
|
||||||
@@ -265,7 +265,7 @@ def print_heartbeat(unit_map: Dict[str, Dict[str, Any]]) -> None:
|
|||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
|
|
||||||
clear_console()
|
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"THORDATA root: {THORDATA_PATH}")
|
||||||
print(f"Now: {now.strftime('%Y-%m-%d %H:%M:%S')}")
|
print(f"Now: {now.strftime('%Y-%m-%d %H:%M:%S')}")
|
||||||
print("-" * 80)
|
print("-" * 80)
|
||||||
@@ -305,7 +305,7 @@ def build_sfm_payload(unit_map: Dict[str, Dict[str, Any]]) -> Dict[str, Any]:
|
|||||||
|
|
||||||
Structure (example):
|
Structure (example):
|
||||||
{
|
{
|
||||||
"source": "series4_emitter",
|
"source": "series4_ingest",
|
||||||
"generated_at": "2025-12-04T20:01:00Z",
|
"generated_at": "2025-12-04T20:01:00Z",
|
||||||
"units": [
|
"units": [
|
||||||
{
|
{
|
||||||
@@ -353,7 +353,7 @@ def build_sfm_payload(unit_map: Dict[str, Dict[str, Any]]) -> Dict[str, Any]:
|
|||||||
)
|
)
|
||||||
|
|
||||||
payload = {
|
payload = {
|
||||||
"source": "series4_emitter",
|
"source": "series4_ingest",
|
||||||
"generated_at": now_utc.strftime("%Y-%m-%dT%H:%M:%SZ"),
|
"generated_at": now_utc.strftime("%Y-%m-%dT%H:%M:%SZ"),
|
||||||
"units": payload_units,
|
"units": payload_units,
|
||||||
}
|
}
|
||||||
@@ -366,7 +366,7 @@ def emit_sfm_payload(unit_map: Dict[str, Dict[str, Any]]) -> None:
|
|||||||
|
|
||||||
This is intentionally conservative:
|
This is intentionally conservative:
|
||||||
- If SFM_ENDPOINT is empty -> do nothing
|
- 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:
|
if not SFM_ENDPOINT:
|
||||||
return
|
return
|
||||||
@@ -400,7 +400,7 @@ def emit_sfm_payload(unit_map: Dict[str, Dict[str, Any]]) -> None:
|
|||||||
|
|
||||||
|
|
||||||
def main() -> 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"THORDATA_PATH = {THORDATA_PATH}")
|
||||||
print(f"SCAN_INTERVAL = {SCAN_INTERVAL} seconds")
|
print(f"SCAN_INTERVAL = {SCAN_INTERVAL} seconds")
|
||||||
print(f"LATE_DAYS = {LATE_DAYS}, STALE_DAYS = {STALE_DAYS}")
|
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)
|
print("[LOOP] Woke up for next scan", flush=True)
|
||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print("\nSeries 4 Emitter stopped by user.")
|
print("\nSeries 4 Ingest Agent stopped by user.")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user