Trees | Indices | Help |
|
---|
|
Run an executable on a list of hosts.
Script to serially run an executable on a list of hosts via ssh with password auth as root. If the provided log dir does not yet exist, it will try to create it.
Implementation:
Security considerations:
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
REMOTE_PATH_BASE = "/tmp/listrunner"
|
|||
USAGE = "%prog -l logdir {-c command | -x /path/to/file} [-b b
|
Imports: errno, optparse, getpass, logging, os, random, select, socket, sys, time, traceback, paramiko
|
Return ISO8601 timestamp. Returns ISO8601 timestamp, optionally expects a time.localtime() tuple in timestamp, but will use the current time if this argument is not supplied. |
Simple ping implementation using TCP connect(2). Try to do a TCP connect(2) from an optional source IP to the specified target IP and the specified target port. If the optional parameter live_port_needed is set to true, requires the remote end to accept the connection. The timeout is specified in seconds and defaults to 10 seconds. If the source optional argument is not passed, the source address selection is left to the kernel, otherwise we try to connect using the passed address (failures to bind other than EADDRNOTAVAIL will be ignored). |
Return list of hosts from hostfile. Reads the hostslist file and returns a list of hosts. Expects the hostslist file to contain one hostname per line. |
Setup the ssh connection used for all later steps. This function sets up the ssh connection that will be used both for upload and remote command execution. On success, it will return paramiko.Transport object with an already logged in session. On failure, False will be returned. |
Uploads the specified files via sftp. Uploads the specified files to a random, freshly created directory with a temporary name under /tmp. All uploaded files are chmod 0400 after upload with the exception of executable, with is chmod 500. Upon success, returns the absolute path to the remote upload directory, but will return False upon failure. |
Per-host worker. This function does not return - it's the main code of the childs, which exit at the end of this function. The exit code 0 or 1 will be interpreted by the parent.
|
Launch the per-host worker. Arguments are the same as for HostWorker, except for child_pids, which is a dictionary holding the pid-to-hostname mapping. |
Parses the command line options. In case of command line errors, it will show the usage and exit the program.
|
|
USAGE
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Jul 24 16:51:20 2012 | http://epydoc.sourceforge.net |