From Observium
Contents |
Description
The Apache application monitor uses a Python script to extend the SNMP server on the host to be monitored. All stats are polled via SNMP and no further ports need to be opened.
Example Graphs
Instructions
First you need mod_status enabled. You need to allow connections from localhost so that the SNMP server can query it for data. It will differ based on your configuration, but something like this :
ExtendedStatus On
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from 127.0.0.1 ::1
</Location>
Don't forget the ExtendedStatus line (it's not there on a default Debian installation in /etc/apache2/mods-enabled/status.conf) if you want the first three graphs to work, otherwise you only get the Switchboard graph.
Copy the apache-stats script from scripts/ in your observium install to the server you wish to monitor
Then add the script to /etc/snmp/snmpd.conf be adding the following line
extend apache /opt/observium/scripts/apache-stats
To add this application to Observium, Choose the Settings tab of the device, then Applications.
Instructions - FreeBSD
- Run the perl script to make sure it works. Should output something like:
$ ./apache-stats 5539 97289216 43.0739 483 11.4679 201427 17564.4 20 31 31 0 1 3 8 0 8 0 0 0 49
- If you receive an error you may need to install www/py-urlgrabber which should get any dependencies required.
portmaster www/py-urlgrabber
- Uncomment this line in /usr/local/etc/apache22/httpd.conf:
Include etc/apache22/extra/httpd-info.conf
- Add 127.0.0.1 and ::1 (if using IPv6) to the Allow from portion of the Location sections of:
/usr/local/etc/apache22/extra/httpd-info.conf
- Add this line to /usr/local/etc/snmp/snmpd.conf pointing to where you put the local script:
extend apache /opt/observium/scripts/apache-stats
- Restart Apache and Net-SNMP:
/usr/local/etc/rc.d/apache22 restart /usr/local/etc/rc.d/snmpd restart