Simple Python script to diagnose Cisco IOS devices by using SSH-based command execution. Collects data with raw text output and converts it into a Markdown report with analysis and recommended actions.
- ✅ Automated Data Collection: Executes 30+ diagnostic commands automatically
- 📊 Detailed Analysis: Includes descriptions and interpretations for all collected items
- 📝 Markdown Report: (Still work in progress) Generates a readable diagnostic report
- 🔴 Issue Detection: Automatically classifies issues as Critical/Warning
- 💡 Recommended Actions: Provides specific solutions for each issue
uv syncsource .venv/bin/activate- Copy the
.env.examplefile to.envand enter the connection information - Specify the cisco console command information in
command_info.json python main.py
cisco_ios_report_tool/
├── main.py # Main diagnostic script
├── .env # Connection credentials (not in git)
├── .env.example # Template for .env
├── .gitignore # Git ignore rules
├── pyproject.toml # Python dependencies
├── uv.lock # UV lock file
├── README.md # This file
├── cisco_diagnostic/ # Diagnostic module
│ ├── collector.py # Data collection logic
│ └── analyzer.py # (Still work in progress) Data analysis and report generation
└── log/ # Output directory
├── cisco_collected_*.txt # Raw command outputs
└── cisco_diagnostic_report_*.md # Analysis reportsAfter execution, the following files are generated in the log/ directory:
cisco_collected_YYYYMMDD_HHMMSS.txt- Stores the raw output of all commands
- Can be used for re-analysis or TAC submission
cisco_diagnostic_report_YYYYMMDD_HHMMSS.md- Contains analysis results and recommended actions
- Easy to read in Markdown format
show version- Basic System Informationshow inventory- Model, Serial Number
show processes cpu sorted- CPU Usageshow processes memory sorted- Memory Usageshow platform resources- DRAM/Flash Usage
show environment all- Temperature, Fan, Power Statusshow logging onboard switch 1 temperature- Temperature Historyshow logging onboard switch 1 voltage- Voltage History
show ip route summary- Routing Tableshow arp summary- ARP Tableshow mac address-table count- MAC Address Tableshow interfaces status- Port Statusshow interfaces counters errors- Interface Errors
show logging- System Logsshow logging onboard switch 1 uptime detail- OBFL Reboot Historyshow logging onboard switch 1 message- OBFL Hardware Errorsshow core- Core Dumpsdir crashinfo:- Crash Files
show redundancy- Redundancy Statusshow switch- Stack Configurationshow switch detail- Stack Details
The generated Markdown report is structured as follows:
- Overall Status (Normal/Warning/Critical)
- Issue Count Statistics
| Category | Issue | Impact | Recommended Action |
|---|---|---|---|
| ... | ... | ... | ... |
| Category | Issue | Impact | Recommended Action |
|---|---|---|---|
| ... | ... | ... | ... |
Each item includes the following information:
| Item | Current Value | Description | Status |
|---|---|---|---|
| IOS Version | 16.12.04 | Cisco IOS XE operating system version | |
| Uptime | 1 hour | Time since last reboot | |
| CPU Usage | 5% | Average CPU usage over the last 5 minutes (Normal if below 30%) | ✅ |
All items include descriptions - Understandable even without network expertise
- Prioritized action plan (Urgent/Important)
- Cisco TAC contact and reference materials
- Abnormal Reboot (PowerOn, Watchdog, Crash)
- Hardware Error (Temperature Sensor, FEP, Fan)
- Overheating (Inlet > 46°C, Hotspot > 105°C)
- CPU/Memory Overload (>80%)
- TCAM Resource Exhaustion (>90%)
- Err-disabled Ports
- Core Dump/Crash Files Detected
- Outdated IOS Version
- Recent Reboot Detected
- No Power Redundancy
- Incomplete ARP Table
- Interface Errors Detected
- Frequent Reboot History
Currently supports the following Cisco devices:
- Catalyst 9300X