# jaydux67/netwatch-guide architecture

> Architecture diagram of the GitHub repository jaydux67/netwatch-guide, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jaydux67/netwatch-guide
- Repository: https://github.com/jaydux67/netwatch-guide

## Overview

NetWatch monitors inventoried TCP services, compares current availability with prior state, and produces summaries and reports. Its main workflow is inventory validation → sequential/concurrent probes → state and status reporting. The shell entry point also provides the integrated Part A history/reporting and alert workflow; a separate status service exposes the latest Part B snapshot. The shell implementation is described in the README but was not sampled, so those edges cite that documentation.

Main entry points: [`shell/netwatch.sh`](https://github.com/jaydux67/netwatch-guide/blob/main/shell/netwatch.sh) (NetWatch CLI), [`python/netwatch.py`](https://github.com/jaydux67/netwatch-guide/blob/main/python/netwatch.py) (Probe Modes), [`python/status_client.py`](https://github.com/jaydux67/netwatch-guide/blob/main/python/status_client.py) (Status Client), [`python/status_server.py`](https://github.com/jaydux67/netwatch-guide/blob/main/python/status_server.py) (HTTP Status Server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Shell Monitoring"]
  node_netwatch_cli["NetWatch CLI<br/>[netwatch.sh]"]
  node_common["Shared Helpers<br/>[common.sh]"]
end

subgraph group_probe["TCP Monitoring"]
  node_inventory["Target Inventory<br/>[inventory.csv]"]
  node_validate["Validate Targets<br/>[netwatch.py]"]
  node_probe_tcp["TCP Probing<br/>[netwatch.py]"]
  node_execution["Probe Modes<br/>[netwatch.py]"]
  node_diff["State Comparison<br/>[netwatch.py]"]
  node_summary["Status Summary<br/>[netwatch.py]"]
end

subgraph group_status["Status Service"]
  node_status_server["HTTP Status Server<br/>[status_server.py]"]
  node_status_client["Status Client<br/>[status_client.py]"]
  node_saved_status["Saved Status<br/>[latest_status.txt]"]
end

subgraph group_state["Results and Reports"]
  node_history[("Part A History<br/>[history.csv]")]
  node_results_json[("Latest Results<br/>[results.json]")]
  node_partb_csv["Latest CSV<br/>[latest_results.csv]"]
  node_integrated_reports["Integrated Reports"]
end

node_operator(("Operator"))
node_http_client(("HTTP Consumer"))
node_tcp_services(("Monitored Services"))

node_operator -->|"runs"| node_netwatch_cli
node_netwatch_cli -->|"uses helpers"| node_common
node_netwatch_cli -->|"processes"| node_inventory
node_netwatch_cli -->|"invokes Part B"| node_execution
node_netwatch_cli -->|"updates history"| node_history
node_netwatch_cli -->|"reads"| node_partb_csv
node_netwatch_cli -->|"writes reports"| node_integrated_reports
node_netwatch_cli -->|"requests alerts"| node_common
node_execution -->|"loads targets"| node_validate
node_validate -->|"reads"| node_inventory
node_execution -->|"runs probes"| node_probe_tcp
node_probe_tcp -->|"checks TCP"| node_tcp_services
node_execution -->|"compares results"| node_diff
node_execution -->|"summarizes"| node_summary
node_execution -->|"writes snapshot"| node_results_json
node_execution -->|"writes CSV"| node_partb_csv
node_diff -->|"reads prior state"| node_results_json
node_status_server -->|"reads snapshot"| node_results_json
node_http_client -.->|"requests status"| node_status_server
node_operator -->|"runs"| node_status_client
node_status_client -->|"fetches status"| node_status_server
node_status_client -->|"writes body"| node_saved_status

click node_netwatch_cli "https://github.com/jaydux67/netwatch-guide/blob/main/shell/netwatch.sh"
click node_common "https://github.com/jaydux67/netwatch-guide/blob/main/shell/lib/common.sh"
click node_inventory "https://github.com/jaydux67/netwatch-guide/blob/main/config/inventory.csv"
click node_validate "https://github.com/jaydux67/netwatch-guide/blob/main/python/netwatch.py"
click node_probe_tcp "https://github.com/jaydux67/netwatch-guide/blob/main/python/netwatch.py"
click node_execution "https://github.com/jaydux67/netwatch-guide/blob/main/python/netwatch.py"
click node_diff "https://github.com/jaydux67/netwatch-guide/blob/main/python/netwatch.py"
click node_summary "https://github.com/jaydux67/netwatch-guide/blob/main/python/netwatch.py"
click node_history "https://github.com/jaydux67/netwatch-guide/blob/main/data/history.csv"
click node_results_json "https://github.com/jaydux67/netwatch-guide/blob/main/python/data/results.json"
click node_partb_csv "https://github.com/jaydux67/netwatch-guide/blob/main/python/reports/latest_results.csv"
click node_integrated_reports "https://github.com/jaydux67/netwatch-guide/tree/main/reports"
click node_status_server "https://github.com/jaydux67/netwatch-guide/blob/main/python/status_server.py"
click node_status_client "https://github.com/jaydux67/netwatch-guide/blob/main/python/status_client.py"
click node_saved_status "https://github.com/jaydux67/netwatch-guide/blob/main/python/reports/latest_status.txt"

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_netwatch_cli,node_common toneBlue
class node_inventory,node_validate,node_probe_tcp,node_execution,node_diff,node_summary toneAmber
class node_status_server,node_status_client,node_saved_status toneMint
class node_history,node_results_json,node_partb_csv,node_integrated_reports toneRose
class node_operator,node_http_client,node_tcp_services toneIndigo
```

## Components

### Shell Monitoring

- [NetWatch CLI](https://github.com/jaydux67/netwatch-guide/blob/main/shell/netwatch.sh): `shell/netwatch.sh`
- [Shared Helpers](https://github.com/jaydux67/netwatch-guide/blob/main/shell/lib/common.sh): `shell/lib/common.sh`

### TCP Monitoring

- [Target Inventory](https://github.com/jaydux67/netwatch-guide/blob/main/config/inventory.csv): `config/inventory.csv`
- [Validate Targets](https://github.com/jaydux67/netwatch-guide/blob/main/python/netwatch.py): `python/netwatch.py`
- [TCP Probing](https://github.com/jaydux67/netwatch-guide/blob/main/python/netwatch.py): `python/netwatch.py`
- [Probe Modes](https://github.com/jaydux67/netwatch-guide/blob/main/python/netwatch.py): `python/netwatch.py`
- [State Comparison](https://github.com/jaydux67/netwatch-guide/blob/main/python/netwatch.py): `python/netwatch.py`
- [Status Summary](https://github.com/jaydux67/netwatch-guide/blob/main/python/netwatch.py): `python/netwatch.py`

### Status Service

- [HTTP Status Server](https://github.com/jaydux67/netwatch-guide/blob/main/python/status_server.py): `python/status_server.py`
- [Status Client](https://github.com/jaydux67/netwatch-guide/blob/main/python/status_client.py): `python/status_client.py`
- [Saved Status](https://github.com/jaydux67/netwatch-guide/blob/main/python/reports/latest_status.txt): `python/reports/latest_status.txt`

### Results and Reports

- [Part A History](https://github.com/jaydux67/netwatch-guide/blob/main/data/history.csv): `data/history.csv`
- [Latest Results](https://github.com/jaydux67/netwatch-guide/blob/main/python/data/results.json): `python/data/results.json`
- [Latest CSV](https://github.com/jaydux67/netwatch-guide/blob/main/python/reports/latest_results.csv): `python/reports/latest_results.csv`
- [Integrated Reports](https://github.com/jaydux67/netwatch-guide/tree/main/reports): `reports`

### Other components

- **Operator**
- **HTTP Consumer**
- **Monitored Services**

## Connections

- Operator → NetWatch CLI: runs (evidence: `README.md`)
- NetWatch CLI → Shared Helpers: uses helpers (evidence: `README.md`)
- NetWatch CLI → Target Inventory: processes (evidence: `README.md`)
- NetWatch CLI → Probe Modes: invokes Part B (evidence: `README.md`)
- NetWatch CLI → Part A History: updates history (evidence: `README.md`)
- NetWatch CLI → Latest CSV: reads (evidence: `README.md`)
- NetWatch CLI → Integrated Reports: writes reports (evidence: `README.md`)
- NetWatch CLI → Shared Helpers: requests alerts (evidence: `README.md`)
- Probe Modes → Validate Targets: loads targets (evidence: `python/netwatch.py`)
- Validate Targets → Target Inventory: reads (evidence: `python/netwatch.py`)
- Probe Modes → TCP Probing: runs probes (evidence: `README.md`)
- TCP Probing → Monitored Services: checks TCP (evidence: `README.md`)
- Probe Modes → State Comparison: compares results (evidence: `README.md`)
- Probe Modes → Status Summary: summarizes (evidence: `README.md`)
- Probe Modes → Latest Results: writes snapshot (evidence: `README.md`)
- Probe Modes → Latest CSV: writes CSV (evidence: `README.md`)
- State Comparison → Latest Results: reads prior state (evidence: `python/netwatch.py`)
- HTTP Status Server → Latest Results: reads snapshot (evidence: `python/status_server.py`)
- HTTP Consumer → HTTP Status Server: requests status
- Operator → Status Client: runs (evidence: `python/status_client.py`)
- Status Client → HTTP Status Server: fetches status (evidence: `python/status_client.py`)
- Status Client → Saved Status: writes body (evidence: `python/status_client.py`)
