Memcached Monitor

From OpenNMS
Jump to: navigation, search
Work In Progress

This article is a work in progress, and as a result may change without notice.

For more information on the current state of this page, ask user indigo or check the Jira ticket: NMS-6672

Last Revision: 17 November 2014 17:54

Memcached Monitor

This monitor checks whether a memcached server is responding to a remote stats request, and optionally stores the values returned in the response to a successful stats request.

Detecting with Capsd

To detect the service you include a protocol-plugin in your capsd configuration ( $OPENNMS_HOME/capsd-configuration.xml) using the TcpPlugin targeted to the memcached listening port, for example:

    <protocol-plugin protocol="Memcached" class-name="org.opennms.netmgt.capsd.plugins.TcpPlugin" scan="on">
        <property key="port" value="11211" />
        <property key="timeout" value="2000" />
        <property key="retry" value="1" />

Monitoring with Pollerd

To monitor the availability and statistics from memcached, it is necessary to add a service to your poller configuration in $OPENNMS_HOME/etc/poller-configuration.xml, for example:

  <!-- Example configuration poller-configuration.xml -->
            <service name="Memcached" interval="300000" user-defined="false" status="on">
                    <parameter key="port" value="11211"/>
                    <parameter key="retry" value="2"/>
                    <parameter key="timeout" value="3000"/>
                    <parameter key="rrd-repository" value="/opt/opennms/share/rrd/response"/>
                    <parameter key="ds-name" value="memcached"/>
                    <parameter key="rrd-base-name" value="memcached" />
  <!-- ... -->
  <monitor service="Memcached" class-name="org.opennms.netmgt.poller.monitors.MemcachedMonitor" />

Statistics Collection

This monitor, like the StrafePingMonitor, returns a multi-valued result set. The datasource names are taken from the output of the memcached stats command:

  • uptime
  • rusageuser
  • rusage_system,
  • curr_items
  • totalitems
  • bytes,
  • currconnections
  • totalconnections
  • connectionstructure
  • cmdget
  • cmdset
  • gethits
  • getmisses
  • evictions,
  • bytesread
  • byteswritten
  • threads