AfHttpCollector
Subscribe

From OpenNMS

Jump to: navigation, search

Contents

About

This is for documentation and understanding, not for learning, copying and implementing :-)

If you want a working example, look here: Monitoring_Apache_with_the_HTTP_collector.

From Revision 7150 on this is in code and working.

What

"Use the HttpCollector to write graphs from the apache/server-status page which is hidden behind basic auth and accessible over https"

capsd-configuration.xml

   <protocol-plugin protocol="SApacheStats" class-name="org.opennms.netmgt.capsd.plugins.HttpsPlugin"  scan="off" user-defined="false">
        <!-- put more specific(s) as needed -->
        <protocol-configuration scan="enable" user-defined="false">
                    <specific>1.2.3.4</specific>
        </protocol-configuration>
           <property key="timeout" value="3000"/>
            <property key="retry" value="1"/>
   </protocol-plugin>

collectd-configuration.xml

 <service interval="300000" name="SApacheStats" status="on" user-defined="false">
   <parameter key="http-collection" value="SApacheStats"/>
 </service>

http-datacollection-config.xml

<http-collection name="SApacheStats">
        <rrd step="300">
            <rra>RRA:AVERAGE:0.5:1:8928</rra>
            <rra>RRA:AVERAGE:0.5:12:8784</rra>
            <rra>RRA:MIN:0.5:12:8784</rra>
            <rra>RRA:MAX:0.5:12:8784</rra>
        </rrd>
        <uris>
            <uri>
                <url user-info="USERNAME:PASSWORD" host="${ipaddr}" http-version="1.1" matches="(?s).*BytesPerSec:\s([0-9]+).*BusyWorkers:\s([0-9]+).*IdleWorkers:\s([0-9]+).*" path="/monitoring/server-status/" port="443" query="auto" response-range="100-399" scheme="https"/>
                <attributes>
                        <attrib alias="SBytesPerSec" match-group="1" type="gauge32"/>
                        <attrib alias="SBusyWorkers" match-group="2" type="gauge32"/>
                        <attrib alias="SIdleWorkers" match-group="3" type="gauge32"/>
                </attributes>
            </uri>
        </uris>
    </http-collection>

Reference

http://commons.apache.org/httpclient/authentication.html