SNMP and NMS
OpenNMS graphs for Apache HTTP Server
- Details
- Created: Sunday, 20 October 2013 06:02
- Last Updated: Sunday, 03 November 2013 10:27
- Written by Alf Høgemark
- Hits: 10540
Graphing Apache HTTP Server in OpenNMS
This page describes how you easily can get nice graphs in OpenNMS for Apache HTTP Server.
You can either let OpenNMS define the data collection and graphs from the SNMP MIB file, or you can use the datacollection and graph files that I have customized, to provide fewer graphs with more items per graph and to not collect all data.
Requirements
Is is assumed that you have already enabled the Apache module and the NetSNMP module for getting Apache HTTP Server statistics using SNMP, you can read about how you do that in Monitoring Apache HTTP Server in OpenNMS.
The graphs and data collection is used on a OpenNMS installation running version 1.12. It should most likely also work on older versions, but it has only been tested on 1.12.
The OpenNMS installation is running on Debian 7, so if you are running another distribution, you might have to place the files in other directories.
Data collection
You can download a customized data collection file for Apache HTTP Server, and after download you put it on your OpenNMS server at /etc/opennms/datacollection
You also have to edit your /etc/opennms/datacollection-config.xml, by adding a line
"<include-collection dataCollectionGroup="APACHE2-MIB"/>"
towards the end of the file.
My datacollection file has been customized in three ways.
Mainly, I added a section to tell OpenNMS that NetSNMP is providing the data for this data collection, by adding the following section at the end of the file
"
<systemDef name="Apache Web Server - Net-SNMP">
<sysoidMask>.1.3.6.1.4.1.8072.3.</sysoidMask>
<collect>
<includeGroup>apache2MIBInformation</includeGroup>
<includeGroup>apache2MIBStatus</includeGroup>
<includeGroup>apache2MIBNotifications</includeGroup>
<includeGroup>apache2MIBHttpErrors</includeGroup>
<includeGroup>apache2MIBvservers</includeGroup>
</collect>
</systemDef>
"
Secondly, I have modified the resource type for virtual server, so that the servername is used for storage and display. This should keep your data consistent even if you add or remove virtual hosts.
"
<resourceType name="apache2MIBvserverEntry"
label="Apache HTTP Server Virtual host"
resourceLabel="${vserverName}">
<persistenceSelectorStrategy
class="org.opennms.netmgt.collectd.PersistAllSelectorStrategy"/>
<storageStrategy
class="org.opennms.netmgt.dao.support.SiblingColumnStorageStrategy">
<parameter key="sibling-column-name" value="vserverName" />
</storageStrategy>
</resourceType>
"
To make that work, I also had to change the type for the vserverName attribute from octetstring to string , so it looks like this
"
<mibObj oid=".1.3.6.1.4.1.19786.1.1.10.1.1.2"
instance="apache2MIBvserverEntry"
alias="vserverName"
type="string"/>
"
Thirdly, I have removed collection of some data, for example server ports, because these do not change normally, and I do not find it interesting to record and graph.
Graph properties
You can download the graph properties file for Apache HTTP Server, and after download you put it on your OpenNMS server at /etc/opennms/snmp-graph.properties.d
This graph properties file differs a great deal from the one you can generate from the MIB directly. My file contains fewer graphs, but each graph has more items. For example, I have made one graph showing all Mime type response codes, instead of having 6 different graphs each showing one image type.
Examples
Here are some examples from a low traffic web site using these graphs to monitor Apache HTTP server.
HTTP requests
Bytes served and received
HTTP response codes
HTTP content-type text

HTTP content-type image