# erwxn/local-network-monitoring-tool architecture

> Architecture diagram of the GitHub repository erwxn/local-network-monitoring-tool, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/erwxn/local-network-monitoring-tool
- Repository: https://github.com/erwxn/local-network-monitoring-tool

## Overview

LocalNet Monitor is a terminal network-monitoring CLI. It loads and expands configured targets, continuously resolves and pings each host concurrently, computes availability and latency metrics, then renders them in a live Rich dashboard. The single source file implements these distinct stages and the result-state layer. The README documents URL, CIDR, and range support; the excerpt shows CIDR/range expansion and URL-prefix cleanup. This is a compact runtime, so the graph stays focused on its actual workflow.

Main entry points: [`networkmonitoring.py`](https://github.com/erwxn/local-network-monitoring-tool/blob/main/networkmonitoring.py) (NetworkMonitor), [`hosts.txt`](https://github.com/erwxn/local-network-monitoring-tool/blob/main/hosts.txt) (Host list)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_target_setup["Target Setup"]
  node_hosts_file["Host list<br/>[hosts.txt]"]
  node_monitor["NetworkMonitor"]
  node_host_expansion["Host expansion"]
end

subgraph group_monitoring["Host Monitoring"]
  node_host_result["Host results"]
  node_ping_workers["Ping workers"]
  node_ping3["ICMP ping"]
  node_dns["Reverse DNS"]
  node_metrics["Metrics calculation"]
end

subgraph group_dashboard["Live Dashboard"]
  node_rich_dashboard["Rich dashboard"]
end

node_admin(("Administrator"))
node_terminal(("Terminal"))

node_admin -->|"configures targets"| node_hosts_file
node_monitor -->|"loads targets"| node_hosts_file
node_monitor -->|"expands targets"| node_host_expansion
node_host_expansion -->|"creates results"| node_host_result
node_monitor -->|"starts workers"| node_ping_workers
node_ping_workers -->|"updates"| node_host_result
node_ping_workers -->|"sends ICMP"| node_ping3
node_ping_workers -->|"resolves names"| node_dns
node_host_result -->|"calculates metrics"| node_metrics
node_monitor -->|"refreshes view"| node_rich_dashboard
node_rich_dashboard -->|"reads status"| node_host_result
node_rich_dashboard -->|"renders dashboard"| node_terminal
node_admin -->|"runs CLI"| node_monitor

click node_hosts_file "https://github.com/erwxn/local-network-monitoring-tool/blob/main/hosts.txt"
click node_monitor "https://github.com/erwxn/local-network-monitoring-tool/blob/main/networkmonitoring.py"
click node_host_expansion "https://github.com/erwxn/local-network-monitoring-tool/blob/main/networkmonitoring.py"
click node_host_result "https://github.com/erwxn/local-network-monitoring-tool/blob/main/networkmonitoring.py"
click node_ping_workers "https://github.com/erwxn/local-network-monitoring-tool/blob/main/networkmonitoring.py"
click node_metrics "https://github.com/erwxn/local-network-monitoring-tool/blob/main/networkmonitoring.py"
click node_rich_dashboard "https://github.com/erwxn/local-network-monitoring-tool/blob/main/networkmonitoring.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_hosts_file,node_monitor,node_host_expansion toneBlue
class node_host_result,node_ping_workers,node_ping3,node_dns,node_metrics toneAmber
class node_rich_dashboard toneMint
class node_admin,node_terminal toneIndigo
```

## Components

### Target Setup

- [Host list](https://github.com/erwxn/local-network-monitoring-tool/blob/main/hosts.txt): `hosts.txt`
- [NetworkMonitor](https://github.com/erwxn/local-network-monitoring-tool/blob/main/networkmonitoring.py): `networkmonitoring.py`
- [Host expansion](https://github.com/erwxn/local-network-monitoring-tool/blob/main/networkmonitoring.py): `networkmonitoring.py`

### Host Monitoring

- [Host results](https://github.com/erwxn/local-network-monitoring-tool/blob/main/networkmonitoring.py): `networkmonitoring.py`
- [Ping workers](https://github.com/erwxn/local-network-monitoring-tool/blob/main/networkmonitoring.py): `networkmonitoring.py`
- **ICMP ping**
- **Reverse DNS**
- [Metrics calculation](https://github.com/erwxn/local-network-monitoring-tool/blob/main/networkmonitoring.py): `networkmonitoring.py`

### Live Dashboard

- [Rich dashboard](https://github.com/erwxn/local-network-monitoring-tool/blob/main/networkmonitoring.py): `networkmonitoring.py`

### Other components

- **Administrator**
- **Terminal**

## Connections

- Administrator → Host list: configures targets (evidence: `README.md`)
- NetworkMonitor → Host list: loads targets (evidence: `networkmonitoring.py`)
- NetworkMonitor → Host expansion: expands targets (evidence: `networkmonitoring.py`)
- Host expansion → Host results: creates results (evidence: `networkmonitoring.py`)
- NetworkMonitor → Ping workers: starts workers (evidence: `networkmonitoring.py`)
- Ping workers → Host results: updates (evidence: `networkmonitoring.py`)
- Ping workers → ICMP ping: sends ICMP (evidence: `networkmonitoring.py`)
- Ping workers → Reverse DNS: resolves names (evidence: `networkmonitoring.py`)
- Host results → Metrics calculation: calculates metrics (evidence: `networkmonitoring.py`)
- NetworkMonitor → Rich dashboard: refreshes view (evidence: `networkmonitoring.py`)
- Rich dashboard → Host results: reads status (evidence: `networkmonitoring.py`)
- Rich dashboard → Terminal: renders dashboard (evidence: `networkmonitoring.py`)
- Administrator → NetworkMonitor: runs CLI (evidence: `networkmonitoring.py`)
