cssh.py - v0.1, concurrent SSH command execution and file/dir copying onto remote hosts. Requires Paramiko Python extension.
Usage: cssh [options] IP1 hostname2 IP3 hostname4 ...
(IPs/hostnames on the commandline are actually optional, they can be specified in the file, see below.)
-h, --help show this help message and exit
-c CMD, --cmd=CMD Command to run. Mutually exclusive with -s.
-s SCRIPT, --script=SCRIPT
Script file to run remotely. Mutually exclusive with
-c. Script can have its own arguments, specify them in
doublequotes, like "script -arg arg".
-y COPY, --copy=COPY Distribute the local file / directory to remote hosts
(concurrently of course). Directory will be copied
-g REMOTEDIR, --remote-dir=REMOTEDIR
The directory where file or dir will be copied /
script will be copied and executed. Defaults to /tmp
for executed scripts (note that some system
administrators set noexec attribute on /tmp's
filesystem, which would prevent execution of the
-a, --cleanup Delete the script on remote hosts after executing it.
-f FILE, --file=FILE File with hosts to use, one host per line.
Concatenated with list of hosts/IP addresses specified
at the end of the commandline. Optionally, in a line
of the file you can specify sequence:
"Address/Hostname Username Password SSH_Port"
separated by spaces (additional parameters can be
specified on a subset of lines; where not specified,
relevant parameters take default values).
-i IPSET, --ipset=IPSET
A named set of IPs/Hostnames to use, configured in the
resource file (~/.cssh.rc by default).
-d DIR, --dir=DIR Directory for storing standard output and standard
error of command. If specified, directory will be
created, with subdirs named IPs/hostnames and relevant
files stored in those subdirs.
-u USERNAME, --username=USERNAME
Username to specify for SSH. Defaults to 'root'.
-p PASSWORD, --password=PASSWORD
Password. Password is used first; if connection fails
using password, cssh uses SSH key (default or
-o PORT, --port=PORT Default SSH port.
-k KEY, --key=KEY SSH Key file. Defaults to /root/.ssh/id_dsa.
-n, --nokey Turns off using SSH key.
-t TIMEOUT, --timeout=TIMEOUT
SSH connection timeout. Defaults to 20 seconds.
-x MAXTHREADS, --maxthreads=MAXTHREADS
Maximum number of threads working concurrently.
Default is 100. Exceeding 200 is generally not
recommended due to potential exhaustion of address
space (each thread can use 10 MB of address space and
32-bit systems have a maximum address space of 4GB).
-r RESOURCEFILE, --resource-file=RESOURCEFILE
Resource file to use. Defaults to ~/.cssh.rc. Mutually
exclusive with -e.
-e NORESOURCEFILE, --no-resource-file=NORESOURCEFILE
Don't use any resource file. Mutually exclusive with
-m, --monochromatic Do not use colors while printing output.
-w WAIT, --wait=WAIT Each thread that has sucessfully opened SSH connection
waits for specified number of seconds after command or
script has been executed. This is intended to let the
long-running command complete, for example
reboot/shutdown commands on some operating systems do
not like immediate termination of SSH connection after
the command has been issued.
-q, --quiet Quiet. Do not print out summaries like IPs for which
communication succeeded or failed, etc.
mailgraph.py - v0.2, analyzes Exim logs and outputs mail traffic graphs (incoming + outgoing)
Example graph: mailgraph_2007-11-16_all_logs.png
More examples: http://python.domeny.com/mailgraph.html
mailgraph.py - generate mail traffic graphs using Exim logs.
(just run it with no options)
Defaults (set them by editing the program file):
graphlen = 1024
graphheight = 768
logdir = /var/log/exim
mail_regexp = virtual_localdelivery|local_delivery|remote_smtp
outputdir = /var/www/html
fname = mailgraph
labelnum = 11
gnuplot = ['/usr/bin/gnuplot', '/usr/local/bin/gnuplot']
This page is hosted by Domeny.PL.