[Mimedefang] Sendmail's {load_avg} Macro

Cormack, Ken Ken.Cormack at Roadway.com
Tue Jul 10 08:45:22 EDT 2007


As far as I know, there's no macro that would provide that info.  However,
in the contrib directory of the sendmail source tree, there's a great little
tool called smcontrol.pl.

I use it all the time, with it's "status" parameter, to look at sendmail's
current load, and current number of child processes.  I use it's "restart"
parameter to make sendmail re-read the sendmail.cf on the fly without having
to actually shut id down and restart is, as I incorporate updates to the cf
file, etc.  A very handy tool.

Smcontrol.pl works by parsing the sendmail.cf to determine the socket that
sendmail is using.  Through that socket, the tool then communicates directly
with sendmail and presents the results.

Since it's in perl, it shouldn't take too much to look in that code to see
how it queries sendmail for the current number of child sendmail processes.

Normally, the tool's output looks like this:

	$ smcontrol.pl status

	Daemon Status: (process 723) Queue runner

	Current number of children: 27 (maximum 60)
	QueueDir free disk space (in blocks): 1718268
	Load average: 2
	Child Process 15519 Status: accepting connections
	Child Process 32674 Status: Queue runner
	Child Process 5221 Status: Queue runner
	Child Process 4704 Status: Queue runner
	Child Process 7213 Status: SMTP server child for 172.29.248.15
	Child Process 6673 Status: Queue runner
	Child Process 7695 Status: SMTP server child for 205.203.128.166
	Child Process 7702 Status: console socket child
	::snip::

...And so on.  It should be possible to incorporate the logic from
smcontrol.pl that shows "Current number of children", into
mimedefang-filter.

Ken

> etc ... :) Interesting would also be the number of sendmail processes. I
guess 
> that could be sent too ...



More information about the MIMEDefang mailing list