ProFTPD module mod_snmp



The mod_snmp module implements SNMPv1 and SNMPv2, for monitoring of proftpd statistics via SNMP.

The mod_snmp does not currently support:

The mod_snmp module is contained in the mod_snmp/ directory, is intended for ProFTPD 1.3.4rc3 and later, and is not compiled by default. Installation instructions are discussed here.

The most current version of mod_snmp 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


SNMPAgent

Syntax: SFTPAgent master|agentx ip-address port
Default: None
Context: "server config" Module: mod_snmp
Compatibility: 1.3.4rc3 and later

The SNMPAgent directive configures the mod_snmp module to act as a "master" SNMP agent/entity, or as an AgentX sub-agent. (Note that the AgentX capability is not currently implemented.)

The ip-address and port parameters configure the address/port on which mod_snmp will listen for UDP SNMP packets.

Note that the SNMPAgent diretive is required.


SNMPCommunity

Syntax: SNMPCommunity community
Default: None
Context: "server config" Module: mod_snmp
Compatibility: 1.3.4rc3 and later

The SNMPCommunity directive configures the community string (effectively a passphrase) used for authenticating SNMPv1 and SNMPv2 messages.

Note that the SNMPCommunity diretive is required.


SNMPEngine

Syntax: SNMPEngine on|off
Default: off
Context: "server config" Module: mod_snmp
Compatibility: 1.3.4rc3 and later

The SNMPEngine directive controls whether the mod_snmp will run as an SNMP agent, and handle SNMP messages.


SNMPLog

Syntax: SNMPLog file|"none"
Default: None
Context: "server config" Module: mod_snmp
Compatibility: 1.3.4rc3 and later

The SNMPLog directive is used to specify a log file for mod_sNMp's reporting. The file parameter given must be the full path to the file to use for logging.

Note that this path must not be to a world-writable directory and, unless AllowLogSymlinks is explicitly set to on (generally a bad idea), the path must not be a symbolic link.


SNMPTables

Syntax: SNMPTables path
Default: None
Context: "server config" Module: mod_snmp
Compatibility: 1.3.4rc3 and later

The SNMPTables directive is used to specify a directory that mod_snmp will use for storing its database files; these files are used for tracking the various statistics reported via SNMP.


Installation

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


Usage

Access Controls for SNMP Messages

Example:

  <Limit SNMP>
    Allow from 10.
    DenyAll
  </Limit>

Example Configuration
When using mod_snmp to handle SNMP requests Uses a UDP socket, and thus does not require a separate section (or interfere with normal FTP operations)

  <IfModule mod_snmp.c>
    SNMPEngine on
    SNMPLog /etc/proftpd/snmp/snmp.log

    # Configure the agent to listen on 1.2.3.4, port 161
    SNMPAgent master 1.2.3.4 161

    # Configure the SNMP community string
    SNMPCommunity MySnmpCommunity

    # Configure the directory that mod_snmp will use for its database files
    SFTPTables /var/proftpd/snmp
  </IfModule>

Logging
The mod_snmp module supports different forms of logging. The main module logging is done via the SNMPLog directive. For debugging purposes, the module also uses trace logging, via the module-specific "snmp" and "snmp-db" log channels. Thus for trace logging, to aid in debugging, you would use the following in your proftpd.conf:

  TraceLog /path/to/snmp-trace.log
  Trace snmp:20
This trace logging can generate large files; it is intended for debugging use only, and should be removed from any production configuration.

SNMP MIB
The MIB provided for proftpd is distributed with the mod_snmp module source code, and will be installed by default. It is contained in the "PROFTPD-MIB.txt" file, and uses SMIv2.

Suggested Future Features
The following lists the features I hope to add to mod_snmp, according to need, demand, inclination, and time:



Author: $Author: tj $
Last Updated: $Date: 2011/10/19 17:03:16 $


© Copyright 2011 TJ Saunders
All Rights Reserved