1MD-MX-CTRL(8) System Manager's Manual MD-MX-CTRL(8)
2
3
4
6 md-mx-ctrl - Control mimedefang-multiplexor
7
9 md-mx-ctrl [options] command
10
11
13 md-mx-ctrl is a command-line tool for communicating with mimedefang-
14 multiplexor(8).
15
16
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
34 The following commands are available:
35
36
37 status Prints the status of all slave Perl processes in human-readable
38 format.
39
40
41 rawstatus
42 Prints the status of all slave 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 slave, and is
48 "I" for an idle slave, "B" for a busy slave, "S" for a slave
49 which is not running, and "K" for a slave which has been killed,
50 but has not yet exited. A slave is "idle" if there is a running
51 Perl process waiting to do work. "Busy" means the Perl process
52 is currently filtering a message. "S" means there is no associ‐
53 ated Perl process with the slave, but one can be started if the
54 load warrants. Finally, "K" means the slave Perl process has
55 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 slaves 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 slaves 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 slaves 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 slaves. Each
83 line contains the count of busy slaves (1, 2, 3 up to MX_MAXI‐
84 MUM), a space, and the number of times that many slaves 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 Slaves: The average number of busy slaves 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 slave 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 slaves 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 slave activations (new slaves
140 started) over the last 10 seconds, 1 minute, 5 minutes and 10
141 minutes.
142
143 The fifth four are the number of slaves reaped (slaves that have
144 exited) over the last 10 seconds, 1 minute, 5 minutes and 10
145 minutes.
146
147 The sixth four are the number of busy, idle, stopped and killed
148 slaves.
149
150 The seventh four are the number of messages processed, the num‐
151 ber of slave activations, the size of the request queue, and the
152 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 slave 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 slave 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 slave activation and reap statistics are
185 present, but always 0. They are only valid in a rawload com‐
186 mand.
187
188
189 slaves Displays a list of slaves and their process IDs. Each line of
190 output consists of a slave number, a status (I, B, K, or S), and
191 for idle or busy slaves, the process-ID of the slave. For busy
192 slaves, the line may contain additional information about what
193 the slave is doing.
194
195
196 busyslaves
197 Similar to slaves, but only outputs a line for each busy slave.
198
199
200 slaveinfo n
201 Displays information about slave number n.
202
203
204 reread Forces mimedefang-multiplexor to kill all idle slaves, and ter‐
205 minate and restart busy slaves when they become idle. This
206 forces a reread of filter rules.
207
208
209 msgs Prints the total number of messages scanned since the multi‐
210 plexor started.
211
212
214 You can supply any other command and arguments to md-mx-ctrl. It per‐
215 cent-encodes each command-line argument, glues the encoded arguments
216 together with a single space between each, and sends the result to the
217 multiplexor as a command. This allows you to send arbitrary commands
218 to your Perl slaves. See the section "EXTENDING MIMEDEFANG" in mimede‐
219 fang-filter(5) for additional details.
220
221
223 md-mx-ctrl uses the multiplexor's socket; therefore, it probably needs
224 to be run as root or the same user as mimedefang-multiplexor.
225
226
228 md-mx-ctrl was written by David F. Skoll <dfs@roaringpenguin.com>. The
229 mimedefang home page is http://www.mimedefang.org/.
230
231
233 mimedefang.pl(8), mimedefang-filter(5), mimedefang(8), mimedefang-pro‐
234 tocol(7), watch-mimedefang(8)
235
236
237
2384th Berkeley Distribution 8 February 2005 MD-MX-CTRL(8)