ProFTPD module mod_rusage



The mod_rusage module "monitors" system resource usage by a session process by periodically calling the getrusage(2) system call, and comparing the obtained values against configured thresholds. Installation instructions are discussed here.

The most current version of mod_rusage can be found at:

  http://www.castaglia.org/proftpd/

Author

Please contact TJ Saunders <tj at castaglia.org> with any questions, concerns, or suggestions regarding this module.

Directives


RUsageEngine

Syntax: RUsageEngine on|off
Default: off
Context: server config, <VirtualHost>, <Global>
Module: mod_rusage
Compatibility: 1.3.3d and later

The RUsageEngine directive enables or disables the mod_rusage module.


RUsageInterval

Syntax: RUsageInterval seconds
Default: 15
Context: server config, <VirtualHost>, <Global>
Module: mod_rusage
Compatibility: 1.3.3d and later

The RUsageInterval directives configures the interval at which mod_rusage will check the process resource usage and handle the configured RUsageThresholds. The seconds parameter must be a positive number.


RUsageLog

Syntax: RUsageLog file
Default: None
Context: server config, <VirtualHost>, <Global>
Module: mod_rusage
Compatibility: 1.3.3d and later

The RUsageLog directive configures a file used for logging by mod_rusage. The configured file must be an absolute path.


RUsageThreshold

Syntax: RUsageThreshold action threshold-type threshold-value ...
Default: None
Context: server config, <VirtualHost>, <Global>
Module: mod_rusage
Compatibility: 1.3.3d and later

The RUsageThreshold directive configures the thresholds of the different types of system resources to check, and the action to take when those thresholds are reached. Note that at least one RUsageThreshold needs to be configured for mod_rusage to perform any resource usage checks. Multiple RUsageThreshold directives can be configured, so that different resources have different limits.

The action parameter specifies the type of action to take when the threshold is reached. The supported actions are:

The currently supported threshold-types are:


Usage

Example mod_rusage configuration:

  <IfModule mod_rusage.c>
    RUsageEngine on
    RUsageLog /path/to/rusage.log
    RUsageInterval 10

    # If the session uses more than 15 seconds of "user time", log it
    # at the CRIT syslog level
    RUsageThreshold log:crit UserTime 15
  </IfModule>


Installation

To install mod_rusage, go to the third-party module area in the proftpd source code and unpack the mod_rusage source tarball:
  cd proftpd-dir/contrib/
  tar zxvf /path/to/mod_rusage-version.tar.gz
after unpacking the latest proftpd-1.3.x source code. For including mod_rusage as a staticly linked module:
  ./configure --with-modules=mod_rusage ...
Alternatively, mod_rusage can be built as a DSO module:
  ./configure --enable-dso --with-shared=mod_rusage ...
Then follow the usual steps:
  make
  make install



Author: $Author: tj $
Last Updated: $Date: 2011/04/06 03:16:05 $


© Copyright 2011 TJ Saunders
All Rights Reserved