Lightning-fast parallel ssh
Herd is a massively parallel ssh client that will replace all your
hacky for loops, pssh, xargs and gnu parallel oneliners with something
that is faster, more flexible and simply more awesome! Here is an
example of herd in action, querying openssl package versions
installed on all example.com servers.
While the hostnames in this example are obviously modified, the example
itself is real. It queried almost 1500 servers in less than 20 seconds,
over a relatively slow intercontinental VPN, intentionally limited to
100 simultaneous connections due to this connectivity. Just imagine
what you can do when running this inside your production environment!
Find all your hosts
Instead of telling herd all your hosts, it can find them for you in inventory data or cloud provider API's for
- SSH known_hosts
- PuTTY
- Inventory files
- HTTP api's
- Consul
- Prometheus
- Puppet
- AWS
- Azure
- Google Cloud
- TransIP
- Tailscale
And custom sources are easy to add using a powerful plugin system.
Run at your speed
You can make herd run as fast as you want. From setting global and
per-host timeouts to limiting parallelism and making herd pause between
hosts, herd will run at the speed you want and tell keep you informed
of its progress. You can even change the speed on the fly!
Output what you want
By default, herd shows you all output when it finished running a
command everywhere. If you can't wait that long, it can output full results
for each host as they come in. And if you like logs scrolling by, herd
can output each line as it comes in. Color coding helps you spot errors
quickly and when there's too much output, it automatically gets sent to a
pager.
Interactive shell
Herd can also be run interactively, letting you quickly add/remove
hosts from your active set and run commands on them. You can even use the
results of commands as filters for your hostset.
Reusable scripts
The commands you use in the interactive shell can also be used as simple
scripts for repeating tasks. Though if you find yourself writing such
things, you may instead want to invest in proper configuration management
and orchestration
Save your history
Even when herd works at lightning speed, it's nice not to have to run
commands multiple times. For this reason, herd stores all your history,
including the output of commands. So if you just want to analyse this
output a bit further, you can use tools like
jq.
jless and
gron to work with your history
instead of running commands over and over again.