tentakel - distributed command execution
tentakel [ -lhv ] [ -c file ] [ -g group ] [ command ]
tentakel is a program for executing the same command on many hosts in parallel using various remote methods.
It can make use of several sets of hosts that are defined in a configuration file as groups.
The command is executed in parallel on all hosts in this group. By default, every result is printed to stdout. The output format can be defined for each group.
If no command is specified tentakel goes into interactive mode which can be used for repeated commands.
The requirements on the remote hosts depend on the selected remote method. The ssh method, for example, needs a running sshd on the remote side. tentakel itself only needs to be installed on the controlling host.
-c file |
Use file as the configuration file if specified, otherwise try $HOME/.tentakel/tentakel.conf and finally /etc/tentakel.conf. |
|
-g groupname |
Select the group groupname The group must be defined in the configuration file. If not speci- fied tentakel implicitely assumes the ``default'' group. |
|
-l -h -v command |
Display a list of possible group choices. Display a brief help message. Display version information. The command that is to be executed on all hosts in the current group. If command is |
|
Everything appearing after a # character will be ignored to the next newline. Leading whitespace will be ignored. Host and List objects become members of the last named group declaration. Forward declarations are allowed.
In the first section you may set global variables like:
set var="value"
value must be enclosed in double quotes even if it does not contain spaces. To write the double quote characters itself in the value, you have to write two successive double quote characters, e. g. var="foo(""bar"")".
var must be one of the following:
ssh_path method user |
The path where the ssh(1) binary is located. Currently the only choice is "ssh" (which is also the default). The user that is used to login to the remote host. If no user is specified, the effective uid of the tentakel process is used. |
|
format |
The format controls how the output of the remote command is formatted. Most of the char- acters in format are output verbatim while some character sequences are treated special: \\ prints a literal \ character. \n prints a newline character. \t prints a tab character. %c Denotes a formatting expression that is expanded dynamically. For- % a literal % character. d expanded to the name of the destination (ip or o expanded to the output of the remote com- s expanded to the exit status of the remote The default format is "### %d(%s):\n%o\n". |
Group Definition
Definitions of groups make up the second section of the configuration file. A new group is |
group name ( [ param1 [, param2 ... ] ] ) members
name must consist only of alphanumeric characters.
Inside the parentheses you can specify variables that follow the same rules as the variables in the first section of the configuration file. Those parameters overrule the global parameters for this specific group. Parameters of sub-groups are ignored.
Group Members |
|||
A group definition ends with a whitespace-separated list of its members. Each item takes [ + | @ ] name |
name must consist of alphanumeric characters but is additionally allowed to contain dots. Each name is prepended by a type designator which specifies the members type. Possible types are:
+name |
Host inclusion. name is included and can be an ip address or a host- name. |
||
@name |
Group inclusion. All members of group name are included. Forward |
||
Configuration File Example |
set ssh_path="/usr/bin/ssh" For more examples please see the example configuration file. |
The interactive mode has several advantages:
- it's easier if more than one command needs to be executed
- you can leave out some quoting for the command
- the current configuration can be changed interactively
The following commands are available in interactive sessions:
help command listgroups use groupname hosts exec command conf |
Display a brief help message on command. Display a list of available groups. Set the current group to groupname. Display a list of affected hosts. Execute command on all affected hosts. Change the current configuration interactively. The default editor command is /usr/bin/vi but can be overridden by setting either of the VISUAL or EDITOR environment variables. Using the conf command does only affect the configuration of the running interactive ten- takel process. It does not change any configuration file. |
|
quit |
Exit tentakel. The same can be done by pressing ctrl-d. |
If the readline(3) library is installed on the system you can use the tab key for automatic completion of partially entered command names.
$ tentakel -g myGroup uptime
This command executes the uptime(1) command on all hosts defined in group myGroup. The whole output (even stderr) of each host is printed according to the format string.
/etc/tentakel.conf Site-wide configuration file. The user-specific configuration file takes precedence over the site-wide one. |
tentakel uses threads. This restricts the usage to platforms that have a working threads implementation supported by Python.
Currently, ssh(1) is the only supported remote method.
Please visit http://tentakel.biskalar.de/. There you will find up-to-date information about how to report bugs.
Written by Sebastian Stark and Marlon Berlin.
ssh(1), http://tentakel.biskalar.de/