Skip to content
/ cpush Public

Ssh client for cisco routers, enabling password caching and confliglet pushing

Notifications You must be signed in to change notification settings

cdevr/cpush

Repository files navigation

CPUSH

A go language tool to work with SSH to cisco devices.

It allows to collect the output of commands directly, without logging in. It can cache passwords.

To install

go install github.com/cdevr/cpush/cmd/cpush@latest

Example execution

cpush --device ip-rtr-ch-1 --cmd 'show version'

You can also pass parameters just directly if just specifying device and command:

cpush ip-rtr-ch-1 show version

It also supports just giving you an interactive session on this router:

cpush --device ip-rtr-ch-1 -i

Or the shortcut:

cpush ip-rtr-ch-1

In this case, cpush will interpret the first argument as the router name, and subsequent arguments will be used to send a command.

Run commands on many devices

List a bunch of devices in a file called "devices_shver". For example router1 and router2

# cat devices_shver
router1
router2
# cpush --device file:devices_shver --cmd "show version" --output "shver_%s"
# ls
devices_shver
shver_router1
shver_router2
#

This will create the files "shver_router1" and "shver_router2" that contain the output of the listed devices.

Configure devices

Cpush has special logic to get close to atomic application of configuration pushes.

cpush --device ip-rtr-1 --push 'int lo 99; ip addr 1.0.0.1 255.255.255.0'

Developing on this repository

This repository uses git hooks. Please configure the git repository to actually use them.

git config core.hooksPath .githooks

About

Ssh client for cisco routers, enabling password caching and confliglet pushing

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages