Pcornel
Automation · Cisco Automation

SSH / CLI

Cheat sheet · https://pcornel.dk/topic.php?topic=5640

Back to the Topic

Answer

SSH/CLI automation sends normal CLI commands over SSH with libraries like Netmiko, Paramiko or Scrapli and parses the text output, working on almost any device but sensitive to prompts and output formats.

Remember

  • Works on almost any device.
  • Parsing text is fragile.
  • Handle prompts and timeouts.

First checks

  • ansible <dev> -m cisco.ios.ios_command -a "commands='show run | i hostname'" — CLI via Ansible
  • python3 -c 'import netmiko' — Netmiko
  • privilege level 15 or enable via become — access

Verify in this order

SSH → exec/enable → commands

Where it usually breaks

Commit/input → runner/job → build/test artifact → deployment request → target rollout/reconcile → effective version/config → health/readiness → workload.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5640

Confirmation

Confirm action

Continue?