All Projects → yahoo → Vssh

yahoo / Vssh

Licence: apache-2.0
Go Library to Execute Commands Over SSH at Scale

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Vssh

Exscript
A Python module making Telnet and SSH easy
Stars: ✭ 337 (-52.33%)
Mutual labels:  automation, network, ssh
Sshkey Audit
Automate SSH key management
Stars: ✭ 55 (-92.22%)
Mutual labels:  automation, network, ssh
Node Minecraft Protocol
Parse and serialize minecraft packets, plus authentication and encryption.
Stars: ✭ 697 (-1.41%)
Mutual labels:  server, network
Stelace
Open-source marketplace backend in Node.js, empowering Web platforms with Search API, Automation, Auth, Headless CMS… ⚡ 💻
Stars: ✭ 144 (-79.63%)
Mutual labels:  automation, server
Pipeline
Node-based automation server
Stars: ✭ 212 (-70.01%)
Mutual labels:  automation, server
Penta
Open source all-in-one CLI tool to semi-automate pentesting.
Stars: ✭ 130 (-81.61%)
Mutual labels:  automation, network
Td4a
Template designer for automation
Stars: ✭ 139 (-80.34%)
Mutual labels:  automation, network
Assh
💻 make your ssh client smarter
Stars: ✭ 2,340 (+230.98%)
Mutual labels:  automation, ssh
Vkbot
Простой разговорный бот на PHP
Stars: ✭ 88 (-87.55%)
Mutual labels:  automation, network
Nock Nock
🚪 Monitor and validate your websites to maintain maximum uptime.
Stars: ✭ 339 (-52.05%)
Mutual labels:  server, network
Ssh Chat
Chat over SSH.
Stars: ✭ 4,512 (+538.19%)
Mutual labels:  server, ssh
Napalm Salt
Modules for event-driven network automation and orchestration using Salt
Stars: ✭ 116 (-83.59%)
Mutual labels:  automation, network
Sshkit.ex
An Elixir toolkit for performing tasks on one or more servers, built on top of Erlang’s SSH application.
Stars: ✭ 108 (-84.72%)
Mutual labels:  automation, ssh
Wordmove
Multi-stage command line deploy/mirroring and task runner for Wordpress
Stars: ✭ 1,791 (+153.32%)
Mutual labels:  automation, ssh
Netshot
Network Configuration and Compliance Management
Stars: ✭ 91 (-87.13%)
Mutual labels:  automation, network
Netdev
Asynchronous multi-vendor library for interacting with network devices
Stars: ✭ 172 (-75.67%)
Mutual labels:  automation, network
Goexpect
Expect for Go
Stars: ✭ 538 (-23.9%)
Mutual labels:  automation, ssh
Pynms
A vendor-agnostic NMS for carrier-grade network simulation and automation
Stars: ✭ 73 (-89.67%)
Mutual labels:  automation, network
Ansible For Network Engineers
Репозиторий книги "Ansible для сетевых инженеров". Книга в процессе переноса на readthedocs и обновления содержания на Ansible 2.9!
Stars: ✭ 74 (-89.53%)
Mutual labels:  automation, network
Deployr
A simple golang application to automate the deployment of software releases.
Stars: ✭ 282 (-60.11%)
Mutual labels:  automation, ssh

vSSH

Go library to handle tens of thousands SSH connections and execute the command(s) with higher-level API for building network device / server automation. Documentation and examples are available via godoc.

Test Status Go Report Card Coverage Status GoDoc PkgGoDev

Alt text

Features

  • Connect to multiple remote machines concurrently
  • Persistent SSH connection
  • DSL query based on the labels
  • Manage number of sessions per SSH connection
  • Limit amount of stdout and stderr data in bytes
  • Higher-level API for building automation

Sample query with label

labels := map[string]string {
  "POP" : "LAX",
  "OS" : "JUNOS",
}
// sets labels to a client
vs.AddClient(addr, config, vssh.SetLabels(labels))
// query with label
vs.RunWithLabel(ctx, cmd, timeout, "(POP == LAX || POP == DCA) && OS == JUNOS")

Basic example

vs := vssh.New().Start()
config := vssh.GetConfigUserPass("vssh", "vssh")
for _, addr := range []string{"54.193.17.197:22", "192.168.2.19:22"} {
  vs.AddClient(addr, config, vssh.SetMaxSessions(4))
}
vs.Wait()

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

cmd:= "ping -c 4 192.168.55.10"
timeout, _ := time.ParseDuration("6s")
respChan := vs.Run(ctx, cmd, timeout)

for resp := range respChan {
  if err := resp.Err(); err != nil {
    log.Println(err)
      continue
    }

  outTxt, errTxt, _ := resp.GetText(vs)
  fmt.Println(outTxt, errTxt, resp.ExitStatus())
}

Stream example

vs := vssh.New().Start()
config, _ := vssh.GetConfigPEM("vssh", "mypem.pem")
vs.AddClient("54.193.17.197:22", config, vssh.SetMaxSessions(4))
vs.Wait()

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

cmd:= "ping -c 4 192.168.55.10"
timeout, _ := time.ParseDuration("6s")
respChan := vs.Run(ctx, cmd, timeout)

resp := <- respChan
if err := resp.Err(); err != nil {
  log.Fatal(err)
}

stream := resp.GetStream()
defer stream.Close()

for stream.ScanStdout() {
  txt := stream.TextStdout()
  fmt.Println(txt)
}

Supported platform

  • Linux
  • Windows
  • Darwin
  • BSD
  • Solaris

License

Code is licensed under the Apache License, Version 2.0 (the "License"). Content is licensed under the CC BY 4.0 license. Terms available at https://creativecommons.org/licenses/by/4.0/.

Contribute

Welcomes any kind of contribution, please follow the next steps:

  • Fork the project on github.com.
  • Create a new branch.
  • Commit changes to the new branch.
  • Send a pull request.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].