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

RRD creation for JMX data fails

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.5.90
    • None
    • JMX Poller/Collector
    • Security Level: Default (Default Security Scheme)
    • Operating System: Linux
      Platform: PC
    • 2446

    Description

      there is a mismatch in hardwired jmx-collection names, that cause jmx-datacollection to fail.

      Quote from Christopher L. Cousins <clc-opennms@sparf.net>:

      "I ran into this the other day. The problem is that the Jsr160 collector
      is looking for a collection named 'default' instead of 'jsr160' when
      creating the RRD. As a quick fix, copy the jsr160 'jmx-collection' in
      jmx-datacollection-config.xml and change the name to 'default'. You
      must have both, jsr160 and default in the file."

      BTW: Why are these names hardwired in the code at all?

      To reproduce:

      capsd-configuration.xml :
      -----------------------------------------------------------------------

      ...
      <protocol-plugin protocol="jmx-test" class-name="org.opennms.netmgt.capsd.plugins.Jsr160Plugin" scan="on" user-defined="false">
      <property key="port" value="9003"/>
      <property key="type" value="default"/>
      <property key="protocol" value="rmi"/>
      <property key="urlPath" value="/jmxrmi"/>
      <property key="retry" value="2"/>
      <property key="timeout" value="2000"/>
      </protocol-plugin>
      ...

      collectd-configuration.xml:
      -----------------------------------------------------------------------

      <?xml version="1.0"?>
      <?castor class-name="org.opennms.netmgt.collectd.CollectdConfiguration"?>
      <collectd-configuration
      threads="50">

      <package name="example1">
      <filter>IPADDR != '0.0.0.0'</filter>
      <include-range begin="1.1.1.1" end="254.254.254.254"/>

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

      </package>

      <package name="jvm">
      <filter>IPADDR != '0.0.0.0'</filter>
      <include-range begin="0.0.0.0" end="255.255.255.255"/>
      <include-url>file:/opt/opennms/etc/includes/collection</include-url>

      ...

      <service name="jmx-test" interval="300000" user-defined="false" status="on">
      <parameter key="port" value="9003"/>
      <parameter key="retry" value="2"/>
      <parameter key="timeout" value="3000"/>
      <parameter key="protocol" value="rmi"/>
      <parameter key="urlPath" value="/jmxrmi"/>
      <parameter key="ds-name" value="jmx"/>
      <parameter key="friendly-name" value="jmx-test"/>
      </service>

      ...
      <collector service="jmx-test" class-name="org.opennms.netmgt.collectd.Jsr160Collector"/>

      ...

      </collectd-configuration>

      jmx-datacollection-config:

      -----------------------------------------------------------------------
      <jmx-datacollection-config rrdRepository="/opt/opennms/share/rrd/snmp/">
      <jmx-collection name="jsr160" maxVarsPerPdu="50">
      <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>

      <mbeans>

      <mbean name="Java" objectname="java.lang:type=OperatingSystem">
      <attrib name="SystemLoadAverage" alias="jloadavg" type="gauge"/>
      <attrib name="FreeSwapSpaceSize" alias="jfreeswap" type="gauge"/>
      <attrib name="MaxFileDescriptorCount" alias="jmaxfile" type="gauge"/>
      <attrib name="OpenFileDescriptorCount" alias="jopenfile" type="gauge"/>
      <attrib name="CacheSize" alias="jcachemem" type="gauge"/>
      <attrib name="OpenSessionCount" alias="jopensess" type="gauge"/>
      </mbean>

      </mbeans>
      </jmx-collection>
      </jmx-datacollection-config>

      Collection throws exception:

      2008-04-29 10:52:18,493 INFO [CollectdScheduler-50 Pool-fiber10] RrdUtils: createRRD: creating RRD file /opt/opennms/share/rrd/snmp/214/jmx-test/jopenfile.jrb
      2008-04-29 10:52:18,493 ERROR [CollectdScheduler-50 Pool-fiber10] RrdUtils: createRRD: An error occured creating rrdfile /opt/opennms/share/rrd/snmp/214/jmx-test/jopenfile.jrb: org.jrobin.core.RrdException: Invalid heartbeat, must be positive: -2
      org.jrobin.core.RrdException: Invalid heartbeat, must be positive: -2
      at org.jrobin.core.DsDef.validate(DsDef.java:146)
      at org.jrobin.core.DsDef.<init>(DsDef.java:83)
      at org.jrobin.core.RrdDef.addDatasource(RrdDef.java:230)
      at org.opennms.netmgt.rrd.jrobin.JRobinRrdStrategy.createDefinition(JRobinRrdStrategy.java:105)
      at org.opennms.netmgt.rrd.QueuingRrdStrategy.createDefinition(QueuingRrdStrategy.java:732)
      at org.opennms.netmgt.rrd.RrdUtils.createRRD(RrdUtils.java:193)
      at org.opennms.netmgt.collectd.PersistOperationBuilder.commit(PersistOperationBuilder.java:110)
      at org.opennms.netmgt.collectd.BasePersister.commitBuilder(BasePersister.java:72)
      at org.opennms.netmgt.collectd.OneToOnePersister.completeAttribute(OneToOnePersister.java:57)
      at org.opennms.netmgt.collectd.AbstractCollectionAttribute.visit(AbstractCollectionAttribute.java:65)
      at org.opennms.netmgt.collectd.AttributeGroup.visit(AttributeGroup.java:75)
      at org.opennms.netmgt.collectd.AbstractCollectionResource.visit(AbstractCollectionResource.java:103)
      at org.opennms.netmgt.collectd.JMXCollector$JMXCollectionSet.visit(JMXCollector.java:913)
      at org.opennms.netmgt.collectd.CollectableService.doCollection(CollectableService.java:354)
      at org.opennms.netmgt.collectd.CollectableService.run(CollectableService.java:296)
      at org.opennms.netmgt.scheduler.LegacyScheduler$1.run(LegacyScheduler.java:292)
      at org.opennms.core.concurrent.RunnableConsumerThreadPool$FiberThreadImpl.run(RunnableConsumerThreadPool.java:422)
      at java.lang.Thread.run(Thread.java:595)
      2008-04-29 10:52:18,494 ERROR [CollectdScheduler-50 Pool-fiber10] OneToOnePersister: Unable to persist data for jopenfile: org.opennms.netmgt.rrd.RrdException: An error occured creating rrdfile /opt/opennms/share/rrd/snmp/214/jmx-test/jopenfile.jrb: org.jrobin.core.RrdException:
      Invalid heartbeat, must be positive: -2
      org.opennms.netmgt.rrd.RrdException: An error occured creating rrdfile /opt/opennms/share/rrd/snmp/214/jmx-test/jopenfile.jrb: org.jrobin.core.RrdException: Invalid heartbeat, must be positive: -2
      at org.opennms.netmgt.rrd.RrdUtils.createRRD(RrdUtils.java:198)
      at org.opennms.netmgt.collectd.PersistOperationBuilder.commit(PersistOperationBuilder.java:110)
      at org.opennms.netmgt.collectd.BasePersister.commitBuilder(BasePersister.java:72)
      at org.opennms.netmgt.collectd.OneToOnePersister.completeAttribute(OneToOnePersister.java:57)
      at org.opennms.netmgt.collectd.AbstractCollectionAttribute.visit(AbstractCollectionAttribute.java:65)
      at org.opennms.netmgt.collectd.AttributeGroup.visit(AttributeGroup.java:75)
      at org.opennms.netmgt.collectd.AbstractCollectionResource.visit(AbstractCollectionResource.java:103)
      at org.opennms.netmgt.collectd.JMXCollector$JMXCollectionSet.visit(JMXCollector.java:913)
      at org.opennms.netmgt.collectd.CollectableService.doCollection(CollectableService.java:354)
      at org.opennms.netmgt.collectd.CollectableService.run(CollectableService.java:296)
      at org.opennms.netmgt.scheduler.LegacyScheduler$1.run(LegacyScheduler.java:292)
      at org.opennms.core.concurrent.RunnableConsumerThreadPool$FiberThreadImpl.run(RunnableConsumerThreadPool.java:422)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: org.jrobin.core.RrdException: Invalid heartbeat, must be positive: -2
      at org.jrobin.core.DsDef.validate(DsDef.java:146)
      at org.jrobin.core.DsDef.<init>(DsDef.java:83)
      at org.jrobin.core.RrdDef.addDatasource(RrdDef.java:230)
      at org.opennms.netmgt.rrd.jrobin.JRobinRrdStrategy.createDefinition(JRobinRrdStrategy.java:105)
      at org.opennms.netmgt.rrd.QueuingRrdStrategy.createDefinition(QueuingRrdStrategy.java:732)
      at org.opennms.netmgt.rrd.RrdUtils.createRRD(RrdUtils.java:193)
      ... 12 more

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kastner@devicen.de Tilman Kastner (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.