libssh
LibSSH implementation in Crystal Lang to execute Cisco commands
Installation
RedHat
sudo yum install libssh-devel
Debian / Ubuntu
sudo apt install libssh-dev
MAC OS
brew install libssh
- Add the dependency to your
shard.yml
:
dependencies:
libssh:
github: xtokio/libssh
- Run
shards install
Usage
require "libssh"
ssh = LibSSH.new("example.com","user","password")
# Execute command
response = ssh.execute_command("show running-config interface gi1/0/1")
puts response
# Execute command in config mode
response ssh.execute_config_command(["do show running-config interface gi1/0/1"])
puts response
# Create VLAN
ssh.execute_config_command(["vlan 10","name vlan10"])
# Remove VLAN
ssh.execute_config_command(["no vlan 10"])
Contributing
- Fork it (https://github.com/xtokio/libssh/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Luis Gomez - creator and maintainer