Skip to content

Uses python, redis, and zeromq to quickly execute commands on remote machines and return the results

Notifications You must be signed in to change notification settings

pete0emerson/commander

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A CoreOS / Docker version of commander is now available at pete0emerson/docker-commander

This set of scripts uses Redis as its storage engine and in particular uses Redis's blocking pop off of lists to avoid polling the database for command status. It also uses zeromq for all interprocess transportation.

AppNexus Tech Talk video: http://www.youtube.com/watch?v=Z-4EqEZbfBM

Diagram about how the data flows: http://www.asciiflow.com/#868081871833843538

Install zeromq from source: http://www.zeromq.org/intro:get-the-software

Install redis from source: http://redis.io/download

Fire up:

./transmitter.py &
./processor.py &
./receiver.py &

Run the commander:

./commander.py --host=localhost --receiver=tcp://localhost:9999 --command=date
$ ./commander.py --help
usage: commander.py [-h] --host HOST --receiver RECEIVER [--verbose]
                    (--command COMMAND | --code CODE)

Execute a command asynchronously on multiple hosts

optional arguments:
  -h, --help           show this help message and exit
  --host HOST          The target host(s) (multiple --host flags may be
                       specified)
  --receiver RECEIVER  The receiver to send results to
  --verbose            Turn on verbose mode
  --command COMMAND    The command to be run
  --code CODE          File to be injected and run

You can even inject and run code:

$ ./commander.py --host=localhost --receiver=tcp://localhost:9999 --code=./inject.py
localhost => Darwin

About

Uses python, redis, and zeromq to quickly execute commands on remote machines and return the results

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages