Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-1539

JMX Configs For Database Polling

    Details

    • Type: Enhancement
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3.1
    • Fix Version/s: 1.12.2
    • Component/s: JMX Poller/Collector
    • Security Level: Default (Default Security Scheme)
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: All
    • Bugzilla Id:
      1462

      Description

      Using the JMX/MBeans features in OpenNMS 1.3.1, I have configured a poller to
      monitor a JNDI Postgres DB Connection Pool internal to the Tomcat 5.5.x server
      running Java 5. The connection pool was configured using Tomcat's server.xml as
      a global resource. Below are my configuration snippets for
      1) jmx-datacollection-config.xml (Placed under JSR160 Collection)

      <mbean name="DB Datasource" objectname="Catalina:type=DataSou
      rce,class=javax.sql.DataSource,name="jdbc/postgres"">
      <attrib name="numActive" alias="dbActive" type="gauge"/>
      <attrib name="numIdle" alias="dbIdle" type="gauge"/>
      </mbean>

      2) snmp-graph.properties (These props prob. need to be tweaked as I am not
      familiar with RRDTool's graphing syntax)
      report.jndi.database.name=JNDI Database
      report.jndi.database.columns=dbActive, dbIdle
      report.jndi.database.type=interface
      report.jndi.database.command=--title="Database Connections" \
      DEF:jndiActive=

      {rrd1}

      :dbActive:AVERAGE \
      DEF:jndiIdle=

      {rrd2}

      :dbIdle:AVERAGE \
      LINE2:jndiActive#00aa00:"Active Connections " \
      GPRINT:jndiActive:AVERAGE:" Avg
      : %8.2lf %s" \
      GPRINT:jndiActive:MIN:"Min
      : %8.2lf %s" \
      GPRINT:jndiActive:MAX:"Max
      : %8.2lf %s
      n" \
      LINE2:jndiIdle#ff0000:"Idle Connections " \
      GPRINT:jndiIdle:AVERAGE:" Avg
      : %8.2lf %s" \
      GPRINT:jndiIdle:MIN:"Min
      : %8.2lf %s" \
      GPRINT:jndiIdle:MAX:"Max
      : %8.2lf %s
      n"

      The value for the jndi name I have is "jdbc/postgres" where the quotes are
      escaped for XML validity. This name can be changed depending on the JNDI name
      listed in your Tomcat server. The MBean names will be different for another
      servlet container or may not be available. Hope this helps.

        Attachments

          Activity

            People

            • Assignee:
              agalue Alejandro Galue
              Reporter:
              cerebro70@yahoo.com Julian
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: