# r3tr0r0c4/ciscologger architecture

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

- Interactive diagram: https://gitdiagram.com/r3tr0r0c4/ciscologger
- Repository: https://github.com/r3tr0r0c4/ciscologger

## Overview

ciscoLogger collects multi-site Cisco switch state into MariaDB/MySQL, then serves authenticated dashboards, searches, history, and statistics through Flask. A separate Python utility backs up switch configurations to local or CIFS archives; history cleanup is another database-maintenance task. The collector excerpts show switch access, parsing, and persistence responsibilities, while the README documents the web capabilities. Some internal calls and template routing are not shown, so those relationships are omitted rather than inferred.

Main entry points: [`frontend/app.py`](https://github.com/r3tr0r0c4/ciscologger/blob/main/frontend/app.py) (Flask Application), [`Python/ciscoLogger.py`](https://github.com/r3tr0r0c4/ciscologger/blob/main/Python/ciscoLogger.py) (Switch Collector), [`Python/ciscoBackup.py`](https://github.com/r3tr0r0c4/ciscologger/blob/main/Python/ciscoBackup.py) (Switch Backup), [`SQL/creates.sql`](https://github.com/r3tr0r0c4/ciscologger/blob/main/SQL/creates.sql) (MariaDB / MySQL)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Data Collection"]
  node_collector["Switch Collector<br/>[ciscoLogger.py]"]
  node_parsing["Data Parsing<br/>[ciscoLogger.py]"]
  node_live_data["Live Interface Data<br/>[ciscoLogger.py]"]
  node_arp_data["ARP Tracking<br/>[ciscoLogger.py]"]
  node_port_security["Port Security<br/>[ciscoLogger.py]"]
end

subgraph group_web["Web Application"]
  node_flask_app["Flask Application<br/>[app.py]"]
  node_authentication["Login and Sessions<br/>[app.py]"]
  node_dashboard["Dashboard<br/>[index.html]"]
  node_mac_search["MAC Search<br/>[mac_search.html]"]
  node_description_search["Description Search"]
  node_history_view["Interface History"]
  node_statistics["Statistics<br/>[stats.html]"]
end

subgraph group_backup["Config Backup"]
  node_backup_script["Switch Backup<br/>[ciscoBackup.py]"]
  node_tftp["TFTP Transfer"]
  node_archive[("Backup Archive")]
end

subgraph group_maintenance["Data Maintenance"]
  node_cleanup["History Cleanup<br/>[history_cleanup.py]"]
end

node_operator(("Network Operator"))
node_switches{{"Cisco Switches"}}
node_database[("MariaDB / MySQL<br/>[creates.sql]")]
node_cifs[("CIFS Share")]

node_collector -->|"collects from"| node_switches
node_collector -->|"parses output"| node_parsing
node_collector -->|"writes records"| node_database
node_collector -->|"upserts entries"| node_arp_data
node_collector -->|"stores stats"| node_live_data
node_collector -->|"extracts settings"| node_port_security
node_operator -->|"uses"| node_flask_app
node_flask_app -->|"queries"| node_database
node_flask_app -->|"authenticates"| node_authentication
node_flask_app -->|"renders"| node_dashboard
node_flask_app -->|"supports search"| node_mac_search
node_flask_app -->|"supports search"| node_description_search
node_flask_app -->|"shows history"| node_history_view
node_flask_app -->|"shows statistics"| node_statistics
node_backup_script -->|"backs up"| node_switches
node_backup_script -->|"transfers config"| node_tftp
node_backup_script -->|"stores archives"| node_archive
node_backup_script -->|"mounts share"| node_cifs
node_cleanup -->|"purges history"| node_database

click node_collector "https://github.com/r3tr0r0c4/ciscologger/blob/main/Python/ciscoLogger.py"
click node_parsing "https://github.com/r3tr0r0c4/ciscologger/blob/main/Python/ciscoLogger.py"
click node_live_data "https://github.com/r3tr0r0c4/ciscologger/blob/main/Python/ciscoLogger.py"
click node_arp_data "https://github.com/r3tr0r0c4/ciscologger/blob/main/Python/ciscoLogger.py"
click node_port_security "https://github.com/r3tr0r0c4/ciscologger/blob/main/Python/ciscoLogger.py"
click node_database "https://github.com/r3tr0r0c4/ciscologger/blob/main/SQL/creates.sql"
click node_flask_app "https://github.com/r3tr0r0c4/ciscologger/blob/main/frontend/app.py"
click node_authentication "https://github.com/r3tr0r0c4/ciscologger/blob/main/frontend/app.py"
click node_dashboard "https://github.com/r3tr0r0c4/ciscologger/blob/main/frontend/templates/index.html"
click node_mac_search "https://github.com/r3tr0r0c4/ciscologger/blob/main/frontend/templates/mac_search.html"
click node_description_search "https://github.com/r3tr0r0c4/ciscologger/blob/main/frontend/templates/description_search.html"
click node_history_view "https://github.com/r3tr0r0c4/ciscologger/blob/main/frontend/templates/interface_history.html"
click node_statistics "https://github.com/r3tr0r0c4/ciscologger/blob/main/frontend/templates/stats.html"
click node_backup_script "https://github.com/r3tr0r0c4/ciscologger/blob/main/Python/ciscoBackup.py"
click node_cleanup "https://github.com/r3tr0r0c4/ciscologger/blob/main/Python/history_cleanup.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_collector,node_parsing,node_live_data,node_arp_data,node_port_security toneBlue
class node_flask_app,node_authentication,node_dashboard,node_mac_search,node_description_search,node_history_view,node_statistics,node_database,node_cifs toneAmber
class node_backup_script,node_tftp,node_archive toneMint
class node_cleanup toneRose
class node_operator,node_switches toneIndigo
```

## Components

### Data Collection

- [Switch Collector](https://github.com/r3tr0r0c4/ciscologger/blob/main/Python/ciscoLogger.py): `Python/ciscoLogger.py`
- [Data Parsing](https://github.com/r3tr0r0c4/ciscologger/blob/main/Python/ciscoLogger.py): `Python/ciscoLogger.py`
- [Live Interface Data](https://github.com/r3tr0r0c4/ciscologger/blob/main/Python/ciscoLogger.py): `Python/ciscoLogger.py`
- [ARP Tracking](https://github.com/r3tr0r0c4/ciscologger/blob/main/Python/ciscoLogger.py): `Python/ciscoLogger.py`
- [Port Security](https://github.com/r3tr0r0c4/ciscologger/blob/main/Python/ciscoLogger.py): `Python/ciscoLogger.py`

### Web Application

- [Flask Application](https://github.com/r3tr0r0c4/ciscologger/blob/main/frontend/app.py): `frontend/app.py`
- [Login and Sessions](https://github.com/r3tr0r0c4/ciscologger/blob/main/frontend/app.py): `frontend/app.py`
- [Dashboard](https://github.com/r3tr0r0c4/ciscologger/blob/main/frontend/templates/index.html): `frontend/templates/index.html`
- [MAC Search](https://github.com/r3tr0r0c4/ciscologger/blob/main/frontend/templates/mac_search.html): `frontend/templates/mac_search.html`
- [Description Search](https://github.com/r3tr0r0c4/ciscologger/blob/main/frontend/templates/description_search.html): `frontend/templates/description_search.html`
- [Interface History](https://github.com/r3tr0r0c4/ciscologger/blob/main/frontend/templates/interface_history.html): `frontend/templates/interface_history.html`
- [Statistics](https://github.com/r3tr0r0c4/ciscologger/blob/main/frontend/templates/stats.html): `frontend/templates/stats.html`

### Config Backup

- [Switch Backup](https://github.com/r3tr0r0c4/ciscologger/blob/main/Python/ciscoBackup.py): `Python/ciscoBackup.py`
- **TFTP Transfer**
- **Backup Archive**

### Data Maintenance

- [History Cleanup](https://github.com/r3tr0r0c4/ciscologger/blob/main/Python/history_cleanup.py): `Python/history_cleanup.py`

### Other components

- **Network Operator**
- **Cisco Switches**
- [MariaDB / MySQL](https://github.com/r3tr0r0c4/ciscologger/blob/main/SQL/creates.sql): `SQL/creates.sql`
- **CIFS Share**

## Connections

- Switch Collector → Cisco Switches: collects from (evidence: `Python/ciscoLogger.py`)
- Switch Collector → Data Parsing: parses output (evidence: `Python/ciscoLogger.py`)
- Switch Collector → MariaDB / MySQL: writes records (evidence: `Python/ciscoLogger.py`)
- Switch Collector → ARP Tracking: upserts entries (evidence: `Python/ciscoLogger.py`)
- Switch Collector → Live Interface Data: stores stats (evidence: `Python/ciscoLogger.py`)
- Switch Collector → Port Security: extracts settings (evidence: `Python/ciscoLogger.py`)
- Network Operator → Flask Application: uses (evidence: `readme.md`)
- Flask Application → MariaDB / MySQL: queries (evidence: `frontend/app.py`)
- Flask Application → Login and Sessions: authenticates (evidence: `frontend/app.py`)
- Flask Application → Dashboard: renders (evidence: `frontend/app.py`)
- Flask Application → MAC Search: supports search (evidence: `readme.md`)
- Flask Application → Description Search: supports search (evidence: `readme.md`)
- Flask Application → Interface History: shows history (evidence: `readme.md`)
- Flask Application → Statistics: shows statistics (evidence: `readme.md`)
- Switch Backup → Cisco Switches: backs up (evidence: `Python/ciscoBackup.py`)
- Switch Backup → TFTP Transfer: transfers config (evidence: `Python/ciscoBackup.py`)
- Switch Backup → Backup Archive: stores archives (evidence: `Python/ciscoBackup.py`)
- Switch Backup → CIFS Share: mounts share (evidence: `Python/ciscoBackup.py`)
- History Cleanup → MariaDB / MySQL: purges history (evidence: `Python/history_cleanup.py`)
