# anishkmr0071/networkautomation architecture

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

- Interactive diagram: https://gitdiagram.com/anishkmr0071/networkautomation
- Repository: https://github.com/anishkmr0071/networkautomation

## Overview

This repository is a collection of standalone Python examples for automating Cisco network devices with Netmiko, not a coordinated application. The demonstrated workflow is operator-supplied device credentials, SSH connection, command-based inspection or configuration, and optional local backup or file transfer. Scripts cover multi-device access, privilege escalation, backups, conditional configuration, interface recovery, OSPF maintenance, and SCP transfer. Scripts 1–3 are present in the tree but their contents are not excerpted, so their specific behavior and connections are omitted.

Main entry points: [`Script5.py`](https://github.com/anishkmr0071/networkautomation/blob/main/Script5.py) (File-based credentials), [`Script7.py`](https://github.com/anishkmr0071/networkautomation/blob/main/Script7.py) (Running-config backup), [`Script8.py`](https://github.com/anishkmr0071/networkautomation/blob/main/Script8.py) (Command backups), [`Script9.py`](https://github.com/anishkmr0071/networkautomation/blob/main/Script9.py) (Pre/post backups)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Device access"]
  node_script1["SSH connection example"]
  node_script2["Script 2 example<br/>[Script2.py]"]
  node_script3["Script 3 example<br/>[Script3.py]"]
  node_script4["Multi-device commands<br/>[Script4.py]"]
  node_script5["File-based credentials<br/>[Script5.py]"]
  node_script15["Authentication retries<br/>[Script_15.py]"]
  node_script6["Privilege escalation<br/>[Script6.py]"]
end

subgraph group_observe["Inspection and backups"]
  node_script7["Running-config backup<br/>[Script7.py]"]
  node_script8["Command backups<br/>[Script8.py]"]
  node_script9["Pre/post backups<br/>[Script9.py]"]
end

subgraph group_configure["Configuration and maintenance"]
  node_script10["Logging-host config<br/>[Script_10.py]"]
  node_script11["Interface recovery<br/>[Script_11.py]"]
  node_script12["Interface status checks<br/>[Script_12.py]"]
  node_script17["OSPF maintenance<br/>[Script_17.py]"]
end

subgraph group_transfer["File transfer"]
  node_script16["Device file transfer<br/>[Script_16.py]"]
end

node_operator(("Operator"))
node_cisco{{"Cisco devices"}}
node_localfiles[("Local files")]

node_operator -->|"provides credentials"| node_script4
node_script4 -->|"runs commands"| node_cisco
node_operator -->|"provides credentials"| node_script5
node_script5 -->|"reads credentials and device list"| node_localfiles
node_script5 -->|"runs commands"| node_cisco
node_operator -->|"provides credentials"| node_script15
node_script15 -->|"retries SSH login"| node_cisco
node_script6 -->|"escalates privilege and runs commands"| node_cisco
node_operator -->|"provides credentials"| node_script7
node_script7 -->|"reads running config"| node_cisco
node_script7 -->|"writes backup"| node_localfiles
node_operator -->|"provides credentials"| node_script8
node_script8 -->|"runs show commands"| node_cisco
node_script8 -->|"writes command backups"| node_localfiles
node_operator -->|"provides credentials and config"| node_script9
node_script9 -->|"backs up and configures"| node_cisco
node_script9 -->|"writes pre/post backups"| node_localfiles
node_operator -->|"starts automation"| node_script10
node_script10 -->|"checks and configures logging"| node_cisco
node_script10 -->|"reads config file"| node_localfiles
node_script11 -->|"checks and enables interfaces"| node_cisco
node_operator -->|"provides credentials"| node_script12
node_script12 -->|"checks and enables interfaces"| node_cisco
node_script12 -->|"writes and reads interface list"| node_localfiles
node_operator -->|"confirms reset"| node_script17
node_script17 -->|"checks and resets OSPF"| node_cisco
node_operator -->|"starts transfer"| node_script16
node_script16 -->|"transfers file and checks"| node_cisco
node_script16 -->|"creates transfer source"| node_localfiles

click node_script1 "https://github.com/anishkmr0071/networkautomation/blob/main/1_ssh_connection.py"
click node_script2 "https://github.com/anishkmr0071/networkautomation/blob/main/Script2.py"
click node_script3 "https://github.com/anishkmr0071/networkautomation/blob/main/Script3.py"
click node_script4 "https://github.com/anishkmr0071/networkautomation/blob/main/Script4.py"
click node_script5 "https://github.com/anishkmr0071/networkautomation/blob/main/Script5.py"
click node_script15 "https://github.com/anishkmr0071/networkautomation/blob/main/Script_15.py"
click node_script6 "https://github.com/anishkmr0071/networkautomation/blob/main/Script6.py"
click node_script7 "https://github.com/anishkmr0071/networkautomation/blob/main/Script7.py"
click node_script8 "https://github.com/anishkmr0071/networkautomation/blob/main/Script8.py"
click node_script9 "https://github.com/anishkmr0071/networkautomation/blob/main/Script9.py"
click node_script10 "https://github.com/anishkmr0071/networkautomation/blob/main/Script_10.py"
click node_script11 "https://github.com/anishkmr0071/networkautomation/blob/main/Script_11.py"
click node_script12 "https://github.com/anishkmr0071/networkautomation/blob/main/Script_12.py"
click node_script17 "https://github.com/anishkmr0071/networkautomation/blob/main/Script_17.py"
click node_script16 "https://github.com/anishkmr0071/networkautomation/blob/main/Script_16.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_script1,node_script2,node_script3,node_script4,node_script5,node_script15,node_script6 toneBlue
class node_script7,node_script8,node_script9,node_localfiles toneAmber
class node_script10,node_script11,node_script12,node_script17 toneMint
class node_script16 toneRose
class node_operator,node_cisco toneIndigo
```

## Components

### Device access

- [SSH connection example](https://github.com/anishkmr0071/networkautomation/blob/main/1_ssh_connection.py): `1_ssh_connection.py`
- [Script 2 example](https://github.com/anishkmr0071/networkautomation/blob/main/Script2.py): `Script2.py`
- [Script 3 example](https://github.com/anishkmr0071/networkautomation/blob/main/Script3.py): `Script3.py`
- [Multi-device commands](https://github.com/anishkmr0071/networkautomation/blob/main/Script4.py): `Script4.py`
- [File-based credentials](https://github.com/anishkmr0071/networkautomation/blob/main/Script5.py): `Script5.py`
- [Authentication retries](https://github.com/anishkmr0071/networkautomation/blob/main/Script_15.py): `Script_15.py`
- [Privilege escalation](https://github.com/anishkmr0071/networkautomation/blob/main/Script6.py): `Script6.py`

### Inspection and backups

- [Running-config backup](https://github.com/anishkmr0071/networkautomation/blob/main/Script7.py): `Script7.py`
- [Command backups](https://github.com/anishkmr0071/networkautomation/blob/main/Script8.py): `Script8.py`
- [Pre/post backups](https://github.com/anishkmr0071/networkautomation/blob/main/Script9.py): `Script9.py`

### Configuration and maintenance

- [Logging-host config](https://github.com/anishkmr0071/networkautomation/blob/main/Script_10.py): `Script_10.py`
- [Interface recovery](https://github.com/anishkmr0071/networkautomation/blob/main/Script_11.py): `Script_11.py`
- [Interface status checks](https://github.com/anishkmr0071/networkautomation/blob/main/Script_12.py): `Script_12.py`
- [OSPF maintenance](https://github.com/anishkmr0071/networkautomation/blob/main/Script_17.py): `Script_17.py`

### File transfer

- [Device file transfer](https://github.com/anishkmr0071/networkautomation/blob/main/Script_16.py): `Script_16.py`

### Other components

- **Operator**
- **Cisco devices**
- **Local files**

## Connections

- Operator → Multi-device commands: provides credentials (evidence: `Script4.py`)
- Multi-device commands → Cisco devices: runs commands (evidence: `Script4.py`)
- Operator → File-based credentials: provides credentials (evidence: `Script5.py`)
- File-based credentials → Local files: reads credentials and device list (evidence: `Script5.py`)
- File-based credentials → Cisco devices: runs commands (evidence: `Script5.py`)
- Operator → Authentication retries: provides credentials (evidence: `Script_15.py`)
- Authentication retries → Cisco devices: retries SSH login (evidence: `Script_15.py`)
- Privilege escalation → Cisco devices: escalates privilege and runs commands (evidence: `Script6.py`)
- Operator → Running-config backup: provides credentials (evidence: `Script7.py`)
- Running-config backup → Cisco devices: reads running config (evidence: `Script7.py`)
- Running-config backup → Local files: writes backup (evidence: `Script7.py`)
- Operator → Command backups: provides credentials (evidence: `Script8.py`)
- Command backups → Cisco devices: runs show commands (evidence: `Script8.py`)
- Command backups → Local files: writes command backups (evidence: `Script8.py`)
- Operator → Pre/post backups: provides credentials and config (evidence: `Script9.py`)
- Pre/post backups → Cisco devices: backs up and configures (evidence: `Script9.py`)
- Pre/post backups → Local files: writes pre/post backups (evidence: `Script9.py`)
- Operator → Logging-host config: starts automation (evidence: `Script_10.py`)
- Logging-host config → Cisco devices: checks and configures logging (evidence: `Script_10.py`)
- Logging-host config → Local files: reads config file (evidence: `Script_10.py`)
- Interface recovery → Cisco devices: checks and enables interfaces (evidence: `Script_11.py`)
- Operator → Interface status checks: provides credentials (evidence: `Script_12.py`)
- Interface status checks → Cisco devices: checks and enables interfaces (evidence: `Script_12.py`)
- Interface status checks → Local files: writes and reads interface list (evidence: `Script_12.py`)
- Operator → OSPF maintenance: confirms reset (evidence: `Script_17.py`)
- OSPF maintenance → Cisco devices: checks and resets OSPF (evidence: `Script_17.py`)
- Operator → Device file transfer: starts transfer (evidence: `Script_16.py`)
- Device file transfer → Cisco devices: transfers file and checks (evidence: `Script_16.py`)
- Device file transfer → Local files: creates transfer source (evidence: `Script_16.py`)
