Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Ali-aqrabawi/gomiko
multi-vendor networking SDK.
https://github.com/Ali-aqrabawi/gomiko
arista automation cisco golang juniper mikrotik netmiko network-au networking ssh
Last synced: 2 months ago
JSON representation
multi-vendor networking SDK.
- Host: GitHub
- URL: https://github.com/Ali-aqrabawi/gomiko
- Owner: Ali-aqrabawi
- License: mit
- Created: 2019-06-18T18:07:41.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-12T19:38:24.000Z (6 months ago)
- Last Synced: 2024-07-31T18:18:59.136Z (5 months ago)
- Topics: arista, automation, cisco, golang, juniper, mikrotik, netmiko, network-au, networking, ssh
- Language: Go
- Homepage:
- Size: 93.8 KB
- Stars: 70
- Watchers: 7
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Gomiko
[![Build Status](https://travis-ci.org/Ali-aqrabawi/gomiko.svg?branch=master)](https://travis-ci.org/Ali-aqrabawi/gomiko)
[![GolangCI](https://golangci.com/badges/github.com/Ali-aqrabawi/gomiko.svg)](https://golangci.com)
[![published](https://static.production.devnetcloud.com/codeexchange/assets/images/devnet-published.svg)](https://developer.cisco.com/codeexchange/github/repo/Ali-aqrabawi/gomiko)Gomiko is a `Go` implementation of [netmiko](https://github.com/ktbyers/netmiko). It serves as multi-vendor networking SDK that helps communicate and execute commands via an interactive `shell`
without needing to care about handling device prompts and terminal modes.
## Supports
* Cisco IOS
* Cisco IOS XR
* Cisco ASA
* Cisco NX-OS
* Mikrotik RouterOS
* Arista EOS
* Juniper JunOS
* Nokia SROS## Installation
get gomiko pkg: `go get -u github.com/Ali-aqrabawi/gomiko/pkg`.## Examples :
```go
import (
"fmt"
"log"
"github.com/Ali-aqrabawi/gomiko/pkg"
)func main() {
device, err := gomiko.NewDevice("192.168.1.1", "admin", "password", "cisco_ios", 22)
if err != nil {
log.Fatal(err)
}
//Connect to device
if err := device.Connect(); err != nil {
log.Fatal(err)
}
// send command
output1, _ := device.SendCommand("show vlan")
// send a set of config commands
commands := []string{"vlan 120", "name v120"}
output2, _ := device.SendConfigSet(commands)
device.Disconnect()
fmt.Println(output1)
fmt.Println(output2)
}
```## create device with enable password:
```go
import (
"fmt"
"log"
"github.com/Ali-aqrabawi/gomiko/pkg"
)func main() {
device, err := gomiko.NewDevice("192.168.1.1", "admin", "password", "cisco_ios", 22, gomiko.SecretOption("enablePass"))
if err != nil {
log.Fatal(err)
}}
```## create device with custom timeout:
```go
import (
"fmt"
"log"
"github.com/Ali-aqrabawi/gomiko/pkg"
)func main() {
device, err := gomiko.NewDevice("192.168.1.1", "admin", "password", "cisco_ios", 22, gomiko.SecretOption("enablePass"), gomiko.TimeoutOption(10))
if err != nil {
log.Fatal(err)
}}
```