How hakimizz-tech/diakoptis works
Diakoptis is an interactive, multi-vendor switch troubleshooting CLI. An operator selects switches by name, list, or inventory tags/groups, connects over SSH, then runs friendly commands that map to native commands. Results are parsed, optionally diagnosed, aggregated across switches, and rendered for comparison. The graph follows the README’s documented workflow and sampled module responsibilities; command-handler wiring not shown in excerpts is represented only where the README documents it.
Main entry points: check.py Check Command · shell.py Interactive Shell · show.py Show Command · pool.py Concurrent Session Pool
Components 23
CLI and Targeting
- Interactive Shell
src/diakoptis/cli/shell.py - Connect Command
src/diakoptis/cli/commands/connect.py - Show Command
src/diakoptis/cli/commands/show.py - Check Command
src/diakoptis/cli/commands/check.py - Target Parser
src/diakoptis/targeting/target_parser.py
Inventory and Commands
- Switch Inventory
src/diakoptis/config/inventory.py - Credential Resolver
src/diakoptis/config/credentials.py - Vendor Command Maps
src/diakoptis/config/command_map.py - Command Resolver
src/diakoptis/resolver/resolver.py
SSH Execution
- Concurrent Session Pool
src/diakoptis/connection/pool.py - Driver Factory
src/diakoptis/drivers/factory.py - Driver Interface
src/diakoptis/drivers/base.py - Asterfusion Driver
src/diakoptis/drivers/asterfusion.py - Huawei Driver
src/diakoptis/drivers/huawei.py
Results and Diagnostics
- Output Parser
src/diakoptis/parsing/parser.py - Local TextFSM Templates
src/diakoptis/parsing/templates - Diagnostics Engine
src/diakoptis/diagnostics/engine.py - Diagnostic Playbooks
src/diakoptis/diagnostics/playbooks - Result Aggregator
src/diakoptis/aggregation/aggregator.py - Terminal Renderer
src/diakoptis/rendering/renderer.py
External Systems
- Network Switches
- ntc-templates
Other components
- Network Operator
Connections 33
- Network Operator → Interactive Shell: enters commands
- Interactive Shell → Connect Command: dispatches connect
- Interactive Shell → Show Command: dispatches show
- Interactive Shell → Check Command: dispatches check
- Interactive Shell → Switch Inventory: loads inventory
- Interactive Shell → Vendor Command Maps: loads mappings
- Connect Command → Target Parser: parses targets
- Target Parser → Switch Inventory: matches hosts
- Connect Command → Concurrent Session Pool: opens sessions
- Concurrent Session Pool → Credential Resolver: resolves credentials
- Concurrent Session Pool → Driver Factory: requests driver
- Driver Factory → Asterfusion Driver: creates driver
- Driver Factory → Huawei Driver: creates driver
- Asterfusion Driver → Driver Interface: implements interface
- Huawei Driver → Driver Interface: implements interface
- Asterfusion Driver → Network Switches: connects via SSH
- Huawei Driver → Network Switches: connects via SSH
- Show Command → Command Resolver: resolves command
- Check Command → Command Resolver: resolves command
- Command Resolver → Vendor Command Maps: looks up mapping
- Show Command → Concurrent Session Pool: runs commands
- Check Command → Concurrent Session Pool: runs commands
- Concurrent Session Pool → Network Switches: sends native commands
- Show Command → Output Parser: parses output
- Check Command → Output Parser: parses output
- Output Parser → Local TextFSM Templates: tries local template
- Output Parser → ntc-templates: falls back to community templates
- Check Command → Diagnostics Engine: analyzes results
- Diagnostics Engine → Diagnostic Playbooks: dispatches playbook
- Show Command → Result Aggregator: aggregates results
- Check Command → Result Aggregator: aggregates results
- Show Command → Terminal Renderer: renders output
- Check Command → Terminal Renderer: renders findings