Switch from sscanf() to ovs_scan() throughout the tree.
[sliver-openvswitch.git] / utilities / ovs-appctl.8.in
1 .\" -*- nroff -*-
2 .de IQ
3 .  br
4 .  ns
5 .  IP "\\$1"
6 ..
7 .TH ovs\-appctl 8 "@VERSION@" "Open vSwitch" "Open vSwitch Manual"
8 .ds PN ovs\-appctl
9 .
10 .SH NAME
11 ovs\-appctl \- utility for configuring running Open vSwitch daemons
12 .
13 .SH SYNOPSIS
14 \fBovs\-appctl\fR [\fB\-\-target=\fItarget\fR | \fB\-t\fR \fItarget\fR]
15 \fIcommand \fR[\fIarg\fR...]
16 .br
17 \fBovs\-appctl\fR \-\-help
18 .br
19 \fBovs\-appctl\fR \-\-version
20 .SH DESCRIPTION
21 Open vSwitch daemons accept certain commands at runtime to control their
22 behavior and query their settings.  Every daemon accepts a common set of
23 commands documented under \fBCOMMON COMMANDS\fR below.  Some daemons
24 support additional commands documented in their own manpages.
25 \fBovs\-vswitchd\fR in particular accepts a number of additional
26 commands documented in \fBovs\-vswitchd\fR(8).
27 .PP
28 The \fBovs\-appctl\fR program provides a simple way to invoke these
29 commands.  The command to be sent is specified on \fBovs\-appctl\fR's
30 command line as non-option arguments.  \fBovs\-appctl\fR sends the
31 command and prints the daemon's response on standard output.
32 .PP
33 In normal use only a single option is accepted:
34 .IP "\fB\-t \fItarget\fR"
35 .IQ "\fB\-\-target=\fItarget\fR"
36 Tells \fBovs\-appctl\fR which daemon to contact.
37 .IP
38 If \fItarget\fR begins with \fB/\fR it must name a Unix domain socket
39 on which an Open vSwitch daemon is listening for control channel
40 connections.  By default, each daemon listens on a Unix domain socket
41 named \fB@RUNDIR@/\fIprogram\fB.\fIpid\fB.ctl\fR, where \fIprogram\fR
42 is the program's name and \fIpid\fR is its process ID.  For example,
43 if \fBovs\-vswitchd\fR has PID 123, it would listen on
44 \fB@RUNDIR@/ovs\-vswitchd.123.ctl\fR.
45 .IP
46 Otherwise, \fBovs\-appctl\fR looks for a pidfile, that is, a file
47 whose contents are the process ID of a running process as a decimal
48 number, named \fB@RUNDIR@/\fItarget\fB.pid\fR.  (The \fB\-\-pidfile\fR
49 option makes an Open vSwitch daemon create a pidfile.)
50 \fBovs\-appctl\fR reads the pidfile, then looks for a Unix socket
51 named \fB@RUNDIR@/\fItarget\fB.\fIpid\fB.ctl\fR, where \fIpid\fR is
52 replaced by the process ID read from the pidfile, and uses that file
53 as if it had been specified directly as the target.
54 .IP
55 The default target is \fBovs\-vswitchd\fR.
56 .
57 .SH COMMON COMMANDS
58 Every Open vSwitch daemon supports a common set of commands, which are
59 documented in this section.
60 .
61 .SS GENERAL COMMANDS
62 These commands display daemon-specific commands and the running version.
63 Note that these commands are different from the \fB\-\-help\fR and
64 \fB\-\-version\fR options that return information about the
65 \fBovs\-appctl\fR utility itself.
66 .
67 .IP "\fBhelp\fR"
68 Lists the commands supported by the target.
69 .
70 .IP "\fBversion\fR"
71 Displays the version and compilation date of the target.
72 .
73 .SS LOGGING COMMANDS
74 Open vSwitch has several log levels.  The highest-severity log level is:
75 .
76 .IP "\fBoff\fR"
77 No message is ever logged at this level, so setting a logging
78 facility's log level to \fBoff\fR disables logging to that facility.
79 .
80 .PP
81 The following log levels, in order of descending severity, are
82 available:
83 .
84 .IP "\fBemer\fR"
85 A major failure forced a process to abort.
86 .IP "\fBerr\fR"
87 A high-level operation or a subsystem failed.  Attention is
88 warranted.
89 .IP "\fBwarn\fR"
90 A low-level operation failed, but higher-level subsystems may be able
91 to recover.
92 .IP "\fBinfo\fR"
93 Information that may be useful in retrospect when investigating
94 a problem.
95 .IP "\fBdbg\fR"
96 Information useful only to someone with intricate knowledge of the
97 system, or that would commonly cause too-voluminous log output.  Log
98 messages at this level are not logged by default.
99 .
100 .PP
101 Every Open vSwitch daemon supports the following commands for examining
102 and adjusting log levels.
103 .IP "\fBvlog/list\fR"
104 Lists the known logging modules and their current levels.
105 .
106 .IP "\fBvlog/set\fR [\fIspec\fR]"
107 Sets logging levels.  Without any \fIspec\fR, sets the log level for
108 every module and facility to \fBdbg\fR.  Otherwise, \fIspec\fR is a
109 list of words separated by spaces or commas or colons, up to one from
110 each category below:
111 .
112 .RS
113 .IP \(bu
114 A valid module name, as displayed by the \fBvlog/list\fR command on
115 \fBovs\-appctl\fR(8), limits the log level change to the specified
116 module.
117 .
118 .IP \(bu
119 \fBsyslog\fR, \fBconsole\fR, or \fBfile\fR, to limit the log level
120 change to only to the system log, to the console, or to a file,
121 respectively.
122 .
123 .IP \(bu 
124 \fBoff\fR, \fBemer\fR, \fBerr\fR, \fBwarn\fR, \fBinfo\fR, or
125 \fBdbg\fR, to control the log level.  Messages of the given severity
126 or higher will be logged, and messages of lower severity will be
127 filtered out.  \fBoff\fR filters out all messages.
128 .RE
129 .
130 .IP
131 Case is not significant within \fIspec\fR.
132 .IP
133 Regardless of the log levels set for \fBfile\fR, logging to a file
134 will not take place unless the target application was invoked with the
135 \fB\-\-log\-file\fR option.
136 .IP
137 For compatibility with older versions of OVS, \fBany\fR is accepted as
138 a word but has no effect.
139 .
140 .IP "\fBvlog/set PATTERN:\fIfacility\fB:\fIpattern\fR"
141 Sets the log pattern for \fIfacility\fR to \fIpattern\fR.  Each time a
142 message is logged to \fIfacility\fR, \fIpattern\fR determines the
143 message's formatting.  Most characters in \fIpattern\fR are copied
144 literally to the log, but special escapes beginning with \fB%\fR are
145 expanded as follows:
146 .
147 .RS
148 .IP \fB%A\fR
149 The name of the application logging the message, e.g. \fBovs\-vswitchd\fR.
150 .
151 .IP \fB%c\fR
152 The name of the module (as shown by \fBovs\-appctl \-\-list\fR) logging
153 the message.
154 .
155 .IP \fB%d\fR
156 The current date and time in ISO 8601 format (YYYY\-MM\-DD HH:MM:SS).
157 .
158 .IP \fB%d{\fIformat\fB}\fR
159 The current date and time in the specified \fIformat\fR, which takes
160 the same format as the \fItemplate\fR argument to \fBstrftime\fR(3).
161 As an extension, any \fB#\fR characters in \fIformat\fR will be
162 replaced by fractional seconds, e.g. use \fB%H:%M:%S.###\fR for the
163 time to the nearest millisecond.  Sub-second times are only
164 approximate and currently decimal places after the third will always
165 be reported as zero.
166 .
167 .IP \fB%D\fR
168 The current UTC date and time in ISO 8601 format (YYYY\-MM\-DD HH:MM:SS).
169 .
170 .IP \fB%D{\fIformat\fB}\fR
171 The current UTC date and time in the specified \fIformat\fR, which
172 takes the same format as the \fItemplate\fR argument to
173 \fBstrftime\fR(3).  Supports the same extension for sub-second
174 resolution as \fB%d{\fR...\fB}\fR.
175 .
176 .IP \fB%m\fR
177 The message being logged.
178 .
179 .IP \fB%N\fR
180 A serial number for this message within this run of the program, as a
181 decimal number.  The first message a program logs has serial number 1,
182 the second one has serial number 2, and so on.
183 .
184 .IP \fB%n\fR
185 A new-line.
186 .
187 .IP \fB%p\fR
188 The level at which the message is logged, e.g. \fBDBG\fR.
189 .
190 .IP \fB%P\fR
191 The program's process ID (pid), as a decimal number.
192 .
193 .IP \fB%r\fR
194 The number of milliseconds elapsed from the start of the application
195 to the time the message was logged.
196 .
197 .IP \fB%t\fR
198 The subprogram name, that is, an identifying name for the process or
199 thread that emitted the log message, such as \fBmonitor\fR for the
200 process used for \fB\-\-monitor\fR or \fBmain\fR for the primary
201 process or thread in a program.
202 .
203 .IP \fB%T\fR
204 The subprogram name enclosed in parentheses, e.g. \fB(monitor)\fR, or
205 the empty string for the primary process or thread in a program.
206 .
207 .IP \fB%%\fR
208 A literal \fB%\fR.
209 .RE
210 .
211 .IP
212 A few options may appear between the \fB%\fR and the format specifier
213 character, in this order:
214 .
215 .RS
216 .IP \fB\-\fR
217 Left justify the escape's expansion within its field width.  Right
218 justification is the default.
219 .
220 .IP \fB0\fR
221 Pad the field to the field width with \fB0\fRs.  Padding with spaces
222 is the default.
223 .
224 .IP \fIwidth\fR
225 A number specifies the minimum field width.  If the escape expands to
226 fewer characters than \fIwidth\fR then it is padded to fill the field
227 width.  (A field wider than \fIwidth\fR is not truncated to fit.)
228 .RE
229 .
230 .IP
231 The default pattern for console and file output is \fB%D{%Y-%m-%dT
232 %H:%M:%SZ}|%05N|%c|%p|%m\fR; for syslog output, \fB%05N|%c|%p|%m\fR.
233 .
234 .IP
235 Daemons written in Python (e.g. \fBovs\-xapi\-sync\fR,
236 \fBovs\-monitor\-ipsec) do not allow control over the log pattern.
237 .
238 .IP "\fBvlog/reopen\fR"
239 Causes the daemon to close and reopen its log file.  (This
240 is useful after rotating log files, to cause a new log file to be
241 used.)
242 .IP
243 This has no effect if the target application was not invoked with the
244 \fB\-\-log\-file\fR option.
245 .
246 .SH OPTIONS
247 .
248 .so lib/common.man
249 .
250 .SH "SEE ALSO"
251 .
252 \fBovs\-appctl\fR can control all Open vSwitch daemons, including:
253 .BR ovs\-vswitchd (8),
254 and
255 .BR ovsdb\-server (8).