# ahmadsajjad-logix/wisi-gt34-monitor architecture

> Architecture diagram of the GitHub repository ahmadsajjad-logix/wisi-gt34-monitor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ahmadsajjad-logix/wisi-gt34-monitor
- Repository: https://github.com/ahmadsajjad-logix/wisi-gt34-monitor

## Overview

WISI GT34 Monitor acquires carrier, transport-stream, service and PID evidence from configured chassis inputs, persists observations in SQLite, evaluates Python-owned alarm/recovery state, and presents monitoring data through PRTG. The tree contains both root-level monitoring/alarm modules and a `gt34_monitor` package with a separate SNMP-oriented collector and PRTG formatter. README documents durable alert delivery and inventory-based identity resolution; sampled excerpts do not establish every runtime call between those subsystems, so uncertain links are omitted.

Main entry points: [`monitor.py`](https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/monitor.py) (Monitor Runtime), [`gt34_monitor/collector.py`](https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/gt34_monitor/collector.py) (SNMP Poller), [`tv43_alarm_policy_final.py`](https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/tv43_alarm_policy_final.py) (TV43 Alarm Policy), [`collector.py`](https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/collector.py) (Legacy Collector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_acquisition["Acquisition"]
  node_monitor["Monitor Runtime<br/>[monitor.py]"]
  node_rootcollector["Legacy Collector<br/>[collector.py]"]
  node_wisi["WISI Client<br/>[wisi_client.py]"]
  node_parsers["Data Parsers<br/>[parsers.py]"]
  node_webstatus["Identity Resolution<br/>[webstatus.py]"]
  node_snmppoller["SNMP Poller<br/>[collector.py]"]
  node_snmp["SNMP Client<br/>[snmp.py]"]
  node_walkparser["Walk Parser<br/>[walk_parser.py]"]
end

subgraph group_evidence["Monitoring Evidence"]
  node_sqlite[("Monitoring Database<br/>[database.py]")]
  node_packagedb[("Package Database<br/>[database.py]")]
  node_history[("TV43 History<br/>[tv43_history.py]")]
end

subgraph group_alarms["Alarm Processing"]
  node_alarmengine["Alarm Evaluation<br/>[alarm_engine.py]"]
  node_policy["TV43 Alarm Policy"]
  node_alarmstate[("Alarm Persistence")]
end

subgraph group_delivery["Presentation &amp; Delivery"]
  node_prtg["PRTG Formatter<br/>[prtg.py]"]
  node_emailer["Email Renderer"]
  node_notifier["Email Notifier<br/>[email_notifier.py]"]
  node_outbox[("Delivery Outbox")]
end

node_chassis(("GT34 Chassis"))
node_prtgactor(("PRTG"))
node_smtp(("SMTP Service"))

node_monitor -->|"polls inputs"| node_rootcollector
node_rootcollector -->|"requests resources"| node_wisi
node_wisi -->|"fetches telemetry"| node_chassis
node_rootcollector -->|"parses observations"| node_parsers
node_snmppoller -->|"queries OIDs"| node_snmp
node_snmp -->|"reads telemetry"| node_chassis
node_snmppoller -->|"parses walks"| node_walkparser
node_monitor -->|"resolves inputs"| node_webstatus
node_monitor -->|"stores observations"| node_sqlite
node_snmppoller -->|"stores samples"| node_packagedb
node_alarmengine -->|"reads samples"| node_sqlite
node_policy -->|"evaluates evidence"| node_sqlite
node_policy -->|"persists episodes"| node_alarmstate
node_policy -->|"records history"| node_history
node_prtgactor -->|"requests sensor data"| node_prtg
node_prtg -->|"returns channels"| node_prtgactor
node_emailer -->|"provides rendered alert"| node_notifier
node_notifier -->|"queues delivery"| node_outbox
node_notifier -->|"sends email"| node_smtp

click node_monitor "https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/monitor.py"
click node_rootcollector "https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/collector.py"
click node_wisi "https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/wisi_client.py"
click node_parsers "https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/parsers.py"
click node_webstatus "https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/gt34_monitor/webstatus.py"
click node_snmppoller "https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/gt34_monitor/collector.py"
click node_snmp "https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/gt34_monitor/snmp.py"
click node_walkparser "https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/gt34_monitor/walk_parser.py"
click node_sqlite "https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/database.py"
click node_packagedb "https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/gt34_monitor/database.py"
click node_alarmengine "https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/alarm_engine.py"
click node_policy "https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/tv43_alarm_policy_final.py"
click node_alarmstate "https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/alarm_persistence.py"
click node_history "https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/tv43_history.py"
click node_prtg "https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/gt34_monitor/prtg.py"
click node_emailer "https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/tv43_whatsapp_nologo_email.py"
click node_notifier "https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/email_notifier.py"
click node_outbox "https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/alarm_persistence.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_monitor,node_rootcollector,node_wisi,node_parsers,node_webstatus,node_snmppoller,node_snmp,node_walkparser toneBlue
class node_sqlite,node_packagedb,node_history toneAmber
class node_alarmengine,node_policy,node_alarmstate toneMint
class node_prtg,node_emailer,node_notifier,node_outbox toneRose
class node_chassis,node_prtgactor,node_smtp toneIndigo
```

## Components

### Acquisition

- [Monitor Runtime](https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/monitor.py): `monitor.py`
- [Legacy Collector](https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/collector.py): `collector.py`
- [WISI Client](https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/wisi_client.py): `wisi_client.py`
- [Data Parsers](https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/parsers.py): `parsers.py`
- [Identity Resolution](https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/gt34_monitor/webstatus.py): `gt34_monitor/webstatus.py`
- [SNMP Poller](https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/gt34_monitor/collector.py): `gt34_monitor/collector.py`
- [SNMP Client](https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/gt34_monitor/snmp.py): `gt34_monitor/snmp.py`
- [Walk Parser](https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/gt34_monitor/walk_parser.py): `gt34_monitor/walk_parser.py`

### Monitoring Evidence

- [Monitoring Database](https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/database.py): `database.py`
- [Package Database](https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/gt34_monitor/database.py): `gt34_monitor/database.py`
- [TV43 History](https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/tv43_history.py): `tv43_history.py`

### Alarm Processing

- [Alarm Evaluation](https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/alarm_engine.py): `alarm_engine.py`
- [TV43 Alarm Policy](https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/tv43_alarm_policy_final.py): `tv43_alarm_policy_final.py`
- [Alarm Persistence](https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/alarm_persistence.py): `alarm_persistence.py`

### Presentation & Delivery

- [PRTG Formatter](https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/gt34_monitor/prtg.py): `gt34_monitor/prtg.py`
- [Email Renderer](https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/tv43_whatsapp_nologo_email.py): `tv43_whatsapp_nologo_email.py`
- [Email Notifier](https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/email_notifier.py): `email_notifier.py`
- [Delivery Outbox](https://github.com/ahmadsajjad-logix/wisi-gt34-monitor/blob/main/alarm_persistence.py): `alarm_persistence.py`

### Other components

- **GT34 Chassis**
- **PRTG**
- **SMTP Service**

## Connections

- Monitor Runtime → Legacy Collector: polls inputs
- Legacy Collector → WISI Client: requests resources
- WISI Client → GT34 Chassis: fetches telemetry
- Legacy Collector → Data Parsers: parses observations
- SNMP Poller → SNMP Client: queries OIDs
- SNMP Client → GT34 Chassis: reads telemetry
- SNMP Poller → Walk Parser: parses walks
- Monitor Runtime → Identity Resolution: resolves inputs
- Monitor Runtime → Monitoring Database: stores observations
- SNMP Poller → Package Database: stores samples
- Alarm Evaluation → Monitoring Database: reads samples
- TV43 Alarm Policy → Monitoring Database: evaluates evidence
- TV43 Alarm Policy → Alarm Persistence: persists episodes
- TV43 Alarm Policy → TV43 History: records history
- PRTG → PRTG Formatter: requests sensor data
- PRTG Formatter → PRTG: returns channels
- Email Renderer → Email Notifier: provides rendered alert
- Email Notifier → Delivery Outbox: queues delivery
- Email Notifier → SMTP Service: sends email
