Mod-Apache-Snmp
- Documentation |
|||||||||||||
Instalation | |||||||||||||
Configuration | |||||||||||||
MIB´s | |||||||||||||
Examples | |||||||||||||
MRTG graphs for Apache values | |||||||||||||
FAQ's | |||||||||||||
Apache
2.0.x Compatible. |
|||||||||||||
Requirements:
1) Install Apache Web Server with DSO support enabled. ./configure
--enable-so [..otras opciones..] 2) Unzip NET-SNMP sources. 3) Unzip Mod-APACHE-SNMP sources. 4) Copy files into Net-SNMP directory to support Apache's MIB: - Copy net-snmp-module\
-->PATH-SOURCES-NET-SNMP\agent\mibgroup\apache2\ (create apache2\) 5) Install Net-SNMP ./configure
--with-mib-modules = ap2_snmp 6) Compile and install SNMP module for Apache. - Edit install.sh
and modify the variables with the correct path of Apache and Net-SNMP
libraries.
|
|||||||||||||
There are two principal things that you have to do in the configuration stage: a) Configure the SNMP agent setting the communities and grants that you willl use for the managed objects. b) Load SNMP module in Apache (with LoadModule) and set which agent it´s going to use. For point a), you should configure snmpd.conf (NET-SNMP agent configuration file) as you do normally. (See http://www.net-snmp.org/man/snmpd.conf.html). For point b), there are some configuration directives detailed below: Inside httpd.conf you should set the following directives: Load and Activate SNMP module, using the following: - LoadModule ap2_snmp_module modules/mod_ap2_snmp.so Then you must specify a Location named "ap2_snmp" (See example) and use the following directives to configure the module.
- Enable mod_status module Enable ExtendedStatus directive (ExtendedStatus On) |
|||||||||||||
httpd.conf example (using the module's directives) LoadModule
ap2_snmp_module modules/mod_ap2_snmp.so ExtendedStatus On <Location /ap2_snmp>
</Location> … |
|||||||||||||
This module use it´s own MIB for the managed objects. SeeAPACHE2-MIB
|
|||||||||||||
|
|||||||||||||
Using MOD-APACHE-SNMP and MRTG you can graph any of the APACHE2-MIB objects. For example, it´s possible to get graphs for KBytes / Secs (APACHE2-MIB::serverKBytesPerSec.0), the number of busy Workers (APACHE2-MIB::busyWorkers.0) or any other mib object that you want to graph. Download docs, examples and some scripts to use MRTG with MOD-APACHE-SNMP Here
|
|||||||||||||
Using Net-SNMP (http://www.net-snmp.org) applications (snmpget in this example) you can get the information of the objects defined in the mib (APACHE2-MIB.txt).
|
|||||||||||||
Getting
total traffic (in kb) of Apache: |
|||||||||||||
Getting
Server Status: snmpget -v1 -c public localhost APACHE2-MIB::serverStatus.0 |
|||||||||||||
Getting
Server Uptime: snmpget -v1 -c public localhost APACHE2-MIB::serverUptime.0 |
|||||||||||||
Getting
HTTP 404 errors count: snmpget -v1 -c public localhost APACHE2-MIB::httpError404.0 |