/
tomahawk.1
187 lines (185 loc) · 4.78 KB
/
tomahawk.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
.\" Man page generated from reStructuredText.
.
.TH "TOMAHAWK" "1" "April 17, 2014" "0.7.0" "tomahawk"
.SH NAME
tomahawk \- enables to execute a command to many hosts
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.SH SYNOPSIS
.sp
\fBtomahawk\fP [\fIoptions\fP] command
.SH DESCRIPTION
.sp
\fBtomahawk\fP is a program that enables to execute a command into many hosts.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ tomahawk \-h host1,host2,host3 uptime
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\-\-\-> \(aquptime\(aq command will be executed in host1, host2, and host3 with following output.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
oinume@host1 % uptime
22:41:27 up 10 days, 3:26, 1 users, load average: 1.11, 1.13, 1.11
oinume@host2 % uptime
22:41:28 up 20 days, 4:26, 2 users, load average: 2.11, 2.13, 2.11
oinume@host3 % uptime
22:41:29 up 30 days, 5:26, 3 users, load average: 3.11, 3.13, 3.11
.ft P
.fi
.UNINDENT
.UNINDENT
.SS ssh
.sp
tomahawk executes a command via \(aqssh\(aq. You can specify options for ssh with \-o/\-\-ssh\-options and can configure ssh behavior with $HOME/.ssh/config.
.SS hosts file
.sp
\-h option enables you to specify hosts, another option \(aq\-f\(aq, which is specifying hosts files.
hosts file is listing host names like this
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
host1
host2
host3
#host4
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Starting with "#" means commenting the host out.
.SS shell operators
.sp
tomahawk executes commands via shell(/bin/sh), so you can use \(aq|\(aq (pipe), \(aq&&\(aq, \(aq||\(aq operators and so on.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ tomahawk \-h host1,host2 \(aqps auxww | grep python\(aq
.ft P
.fi
.UNINDENT
.UNINDENT
.SH OPTIONS
.sp
These programs follow the usual GNU command line syntax, with long options starting with two dashes (\(aq\-\-\(aq).
A summary of options is included below.
For a complete description, see the Info files.
.SS \-H, \-\-hosts
.sp
Specifies host names for sending commands. You can specify multiple hosts with \(aq,\(aq.
.SS \-f, \-\-hosts\-files
.sp
Specifies hosts files which listed host names for sending commands.
You can specify multiple hosts files with \(aq,\(aq.
.sp
Format of hosts file is below.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
web01
web02
#web03
web04
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
A line of starting with \(aq#\(aq disables a host.
.SS \-l, \-\-prompt\-login\-password
.sp
Prompts a password for ssh authentication at first. If the password is all the same between target hosts, you\(aqll input a password just once.
.SS \-\-login\-password\-stdin
.sp
Read a SSH password from stdin instead of prompting.
.SS \-s, \-\-prompt\-sudo\-password
.sp
Prompts a password for sudo.
.SS \-c, \-\-continue\-on\-error
.sp
Continues to send commands even if any errors.
The default behavior is fail\-safe, means that tomahawk will stop if any errors.
.SS \-p, \-\-parallel
.sp
Specifies a number of processes for parallel command execution. (default: 1)
If your machine has multiple cpu cores, \-\-parallel 2 .. N might be faster.
.SS \-t, \-\-timeout
.sp
Specifies timeout seconds for a command.
.SS \-u, \-\-ssh\-user
.sp
Specifies ssh user. The default is a current logged in user.
.SS \-o, \-\-ssh\-options
.sp
Specifies ssh options.
.SS \-F, \-\-output\-format
.sp
Specifies command output format.
The default is \fB\(aq${user}@${host} % ${command}\en${output}\en\(aq\fP
.SS \-V, \-\-verify\-output
.sp
Verify command output of all hosts.
For additional information, see \fIchecking\-files\-on\-remote\-hosts\fP
.SS \-C, \-\-conf
.sp
Specifies configuration file path. For additional information, see \fIomit\-command\-line\-options\fP
.SH ENVIRONMENT VARIABLES
.sp
tomahawk\(aqs behavior is affected by the following environment variables.
.SS TOMAHAWK_ENV
.sp
This variable specifies an environment of \(aqproduction\(aq, \(aqtesting\(aq or \(aqdevelopment\(aq. If TOMAHAWK_ENV=production specified, \fItomahawk\fP or \fItomahawk\-rsync\fP prompt as "command "%s" will be executed %s hosts. Are you sure? [yes/NO]: ". The environment variable exists for mis\-execution of a command.
.SH SEE ALSO
.INDENT 0.0
.IP \(bu 2
\fItomahawk\-rsync(1)\fP
.IP \(bu 2
\fIssh(1)\fP
.UNINDENT
.SH AUTHOR
Kazuhiro Oinuma, Kohei Maeda
.SH COPYRIGHT
2011-2014, Kazuhiro Oinuma
.\" Generated by docutils manpage writer.
.