1MD-MX-CTRL(8)               System Manager's Manual              MD-MX-CTRL(8)
2
3
4

NAME

6       md-mx-ctrl - Control mimedefang-multiplexor
7

SYNOPSIS

9       md-mx-ctrl [options] command
10
11

DESCRIPTION

13       md-mx-ctrl  is  a  command-line tool for communicating with mimedefang-
14       multiplexor(8).
15
16

OPTIONS

18       -h     Displays usage information.
19
20
21       -s path
22              Specifies the path to the mimedefang-multiplexor socket.  If not
23              specified,  defaults  to /var/spool/MIMEDefang/mimedefang-multi‐
24              plexor.sock.
25
26
27       -i     This flag causes md-mx-ctrl to sit in a loop,  reading  commands
28              on  standard  input and printing results to standard output.  It
29              is intended for use by  a  monitoring  program  such  as  watch-
30              mimedefang.
31
32

COMMANDS

34       The following commands are available:
35
36
37       status Prints the status of all worker Perl processes in human-readable
38              format.
39
40
41       rawstatus
42              Prints the status of all worker Perl processes in a format  easy
43              to  parse  by  computer.   The  result is a single line with six
44              words on it.  The words are separated by a single space  charac‐
45              ter.
46
47              Each character in the first word corresponds to a worker, and is
48              "I" for an idle worker, "B" for a busy worker, "S" for a  worker
49              which  is  not  running,  and  "K"  for  a worker which has been
50              killed, but has not yet exited.  A worker is "idle" if there  is
51              a  running  Perl  process  waiting to do work.  "Busy" means the
52              Perl process is currently filtering a message.  "S" means  there
53              is  no  associated  Perl process with the worker, but one can be
54              started if the load warrants.  Finally,  "K"  means  the  worker
55              Perl process has been killed, but has yet to terminate.
56
57              The  second word is the total number of messages processed since
58              the multiplexor started up.  The third word is the total  number
59              of  workers  which  have  been  activated  since the multiplexor
60              started up.  (That is, it's a count of the number of  times  the
61              multiplexor has forked and exec'd the Perl filter.)
62
63              The  fourth  word  is the size of the queue for request queuing,
64              and the fifth word is the  actual  number  of  requests  in  the
65              queue.   The  sixth  word is the number of seconds elapsed since
66              the multiplexor was started.
67
68
69       barstatus
70              Prints the status of busy workers and queued requests in a  nice
71              "bar  chart" format.  This lets you keep an eye on things with a
72              script like this:
73
74                   while true ; do
75                        md-mx-ctrl barstatus
76                        sleep 1
77                   done
78
79
80       histo  Prints a histogram showing the number of workers that were  busy
81              each time a request was processed.  A single line is printed for
82              the numbers from 1 up to the maximum number  of  workers.   Each
83              line  contains the count of busy workers (1, 2, 3 up to MX_MAXI‐
84              MUM), a space, and the number of times that  many  workers  were
85              busy when a request was processed.
86
87
88       load   Prints  a table showing "load averages" for the last 10 seconds,
89              1 minute, 5 minutes and 10 minutes.
90
91              Each row in the table corresponds to a time interval,  displayed
92              in the first column.  The remaining columns in the table are:
93
94              Msgs:  The  number  of  messages  scanned  within the row's time
95              interval.
96
97              Msgs/Sec: The average number  of  messages  scanned  per  second
98              within the row's time interval.
99
100              Avg  Busy Workers: The average number of busy workers whenever a
101              message was scanned.  (If you are processing any  mail  at  all,
102              this  number  will be at least 1, because there is always 1 busy
103              worker when a message is scanned.)
104
105              If you have the watch(1) command on your system, you can keep an
106              eye on the load with this command:
107
108                   watch -n 10 md-mx-ctrl load
109
110              If  you  do not have watch, the following shell script is a less
111              fancy equivalent:
112
113                   #!/bin/sh
114                   while true; do
115                        clear
116                        date
117                        md-mx-ctrl load
118                        sleep 10
119                   done
120
121
122       rawload
123
124              Prints the load averages in computer-readable format.  The  for‐
125              mat consists of twenty-nine space-separated numbers:
126
127              The  first four are integers representing the number of messages
128              scanned in the last 10 seconds, 1 minute, 5 minutes and 10  min‐
129              utes.
130
131              The  second  four  are  floating-point  numbers representing the
132              average number of busy workers in the last 10 seconds, 1 minute,
133              5 minutes and 10 minutes.
134
135              The third four are floating-point numbers representing the aver‐
136              age time per scan in milliseconds over the last  10  seconds,  1
137              minute, 5 minutes and 10 minutes.
138
139              The  fourth four are the number of worker activations (new work‐
140              ers started) over the last 10 seconds, 1 minute, 5  minutes  and
141              10 minutes.
142
143              The  fifth  four  are the number of workers reaped (workers that
144              have exited) over the last 10 seconds, 1 minute, 5  minutes  and
145              10 minutes.
146
147              The  sixth four are the number of busy, idle, stopped and killed
148              workers.
149
150              The seventh four are the number of messages processed, the  num‐
151              ber  of  worker  activations, the size of the request queue, and
152              the number of requests actually on the queue.
153
154              The final number is the number of seconds since the  multiplexor
155              was started.
156
157
158       load-relayok
159              Similar to load, but shows timings for filter_relay calls.
160
161
162       load-senderok
163              Similar to load, but shows timings for filter_sender calls.
164
165
166       load-recipok
167              Similar to load, but shows timings for filter_recipient calls.
168
169
170       rawload-relayok
171              Similar  to  rawload,  but shows timings for filter_relay calls.
172              Note that the worker activation and reap statistics are present,
173              but always 0.  They are only valid in a rawload command.
174
175
176       rawload-senderok
177              Similar  to  rawload, but shows timings for filter_sender calls.
178              Note that the worker activation and reap statistics are present,
179              but always 0.  They are only valid in a rawload command.
180
181
182       rawload-recipok
183              Similar  to  rawload,  but  shows  timings  for filter_recipient
184              calls.  Note that the worker activation and reap statistics  are
185              present,  but  always  0.  They are only valid in a rawload com‐
186              mand.
187
188
189       load1 nsecs
190              The load1 command displays the load for  various  commands  over
191              the  last  nsecs  seconds,  where nsecs is an integer from 10 to
192              600.  The load1 command  combines  the  output  of  load,  load-
193              relayok, load-senderokf and load-recipok into one display.
194
195              You might use the command like this:
196
197                   watch -n 10 md-mx-ctrl load1 60
198
199
200       rawload1 nsecs
201              Returns  the load1 data in human-readable format.  The result is
202              a line containing twenty-six space-separated numbers:
203
204              The first three numbers are the number of scans performed in the
205              last  nsecs  seconds,  the average number of busy workers when a
206              scan was initiated and the average number  of  milliseconds  per
207              scan.
208
209              The  second  three  are  the  same measurements for filter_relay
210              calls.
211
212              The third three are  the  same  measurements  for  filter_sender
213              calls.
214
215              The  fourth  three  are  the  same measurements for filter_relay
216              calls.
217
218              The thirteenth through sixteenth numbers are the number of busy,
219              idle, stopped and killed workers, respectively.
220
221              The  seventeenth number is the number of scans since mimedefang-
222              multiplexor was started.
223
224              The eighteenth number is the number of times a  new  worker  has
225              been activated since program startup.
226
227              The  nineteenth  number is the size of the request queue and the
228              twentieth number is the actual number of queued requests.
229
230              The twenty-first number is the time since  program  startup  and
231              the twenty-second number is a copy of nsecs for convenience.
232
233              The  twenty-third through twenty-sixth numbers are the number of
234              workers  currently  executing  a  scan,  relayok,  senderok  and
235              recipok command respectively.
236
237
238       workers
239              Displays  a list of workers and their process IDs.  Each line of
240              output consists of a worker number, a status (I, B,  K,  or  S),
241              and for idle or busy workers, the process-ID of the worker.  For
242              busy workers, the line may contain additional information  about
243              what  the  worker  is doing.  The command slaves is a deprecated
244              synonym for this command.
245
246
247       busyworkers
248              Similar to workers, but  only  outputs  a  line  for  each  busy
249              worker.  The command busyslaves is a deprecated synonym for this
250              command.
251
252
253       workerinfo n
254              Displays information about worker number n.  The command  slave‐
255              info is a deprecated synonym for this command.
256
257
258       reread Forces mimedefang-multiplexor to kill all idle workers, and ter‐
259              minate and restart busy workers when  they  become  idle.   This
260              forces a reread of filter rules.
261
262
263       msgs   Prints  the  total  number  of messages scanned since the multi‐
264              plexor started.
265
266

ADDITIONAL COMMANDS

268       You can supply any other command and arguments to md-mx-ctrl.  It  per‐
269       cent-encodes  each  command-line  argument, glues the encoded arguments
270       together with a single space between each, and sends the result to  the
271       multiplexor  as  a command.  This allows you to send arbitrary commands
272       to your Perl  workers.   See  the  section  "EXTENDING  MIMEDEFANG"  in
273       mimedefang-filter(5) for additional details.
274
275

PERMISSIONS

277       md-mx-ctrl  uses the multiplexor's socket; therefore, it probably needs
278       to be run as root or the same user as mimedefang-multiplexor.
279
280

AUTHOR

282       md-mx-ctrl was written by Dianne Skoll  <dfs@roaringpenguin.com>.   The
283       mimedefang home page is http://www.mimedefang.org/.
284
285

SEE ALSO

287       mimedefang.pl(8),  mimedefang-filter(5), mimedefang(8), mimedefang-pro‐
288       tocol(7), watch-mimedefang(8)
289
290
291
2924th Berkeley Distribution       8 February 2005                  MD-MX-CTRL(8)
Impressum