Welcome to Questions - Ask OpenNMS, where you can ask questions and receive answers from other members of the community.

Performance - Try to collect simple counter via XML file - New on OpenNMS [closed]

0 votes
618 views

Hello,

I am a new OpenNMS user and I try since few day to perform a simple performance counter acquisition from an xml file in a local directory.

The contain of the file is a file I have created for my test. I wanted to see how OpenNMS is working to read a file, treat it and the use the counter loaded to create a graph. I know the most basic way to treat counter in OpenNMS is to use SNMP but I wanted to see how work the other flow to collect the counter.

I have follow the indications described in the wiki:

  • Configure a new service in collectd-configuration.xml with a reference to the collector using the class: "org.opennms.protocols.xml.collector.XmlCollector"
  • Configure the xml-datacollection-config.xml file with defining the rrd configuration, the xml source contaning the counter data and the information to get in this file. As in my current test I am under Windows, I have defined for the path for the XML source file the following configuration: <xml-source url="file:D:/Performance/data/test.xml">

I have tried with this configuration to create manually a node in OpenNMS UI but the file does not seems to be read and no rrd file has been created.

 

I assum, I miss some configurations to be perform but I didn't get what.

 

Maybe I am wrong but I gess that I need to perform additional configuration. From other experience in Performance application I have, I thinks I should assign my new service or my configuration to a node or an interface.

Thanks in advance for you help

 

More details of the configuration I have currently done on my environment:

In collectd-configuration.xml:

  <package name="Test">
    <filter>IPADDR != '0.0.0.0'</filter>
    <include-range begin="1.1.1.1" end="254.254.254.254" />
    
    <service name="XMLTest" interval="300000" user-defined="false" status="on">
    
      <parameter key="collection" value="TestCollectionFile"/>
      <parameter key="handler-class" value="org.opennms.protocols.xml.vtdxml.DefaultVTDXmlCollectionHandler"/>     
      <parameter key="rrd-repository" value="C:/Program Files (x86)/OpenNMS/share/rrd/test" />
      <parameter key="rrd-base-name" value="file" />
    </service>
  </package>

...

<collector service="XMLTest" class-name="org.opennms.protocols.xml.collector.XmlCollector"/>

In xml-datacollection-config.xml:

<xml-collection name="TestCollectionFile">
        <rrd step="300">
            <rra>RRA:AVERAGE:0.5:1:2016</rra>
            <rra>RRA:AVERAGE:0.5:12:1488</rra>
            <rra>RRA:AVERAGE:0.5:288:366</rra>
            <rra>RRA:MAX:0.5:288:366</rra>
            <rra>RRA:MIN:0.5:288:366</rra>
        </rrd>
        <xml-source url="file:D:/Performance/data/test.xml">
            <xml-group name="srv-stats" resource-type="node" resource-xpath="/data/server">
                <xml-object name="ServerName" type="string" xpath="@name" />
                <xml-object name="ifInOctets" type="GAUGE" xpath="ifInOctets" />
                <xml-object name="ifOutOctets" type="GAUGE" xpath="ifOutOctets" />
            </xml-group>
        </xml-source>
    </xml-collection>

My test file is:

<data>
  <server name=”127.0.0.1”>
    <ifInOctets>101888</ifInOctets>
    <ifOutOctets>172231</ifOutOctets>
  </server>
</data>
 

 

OpenNMS version
1.4.2
Java version
1.7.0_45
Operating system
Windows 7
PostgreSQL version
9.3.5
closed with the note: Problem solved
asked Jan 8, 2015 by Sylvestre (380 points)
closed Jan 13, 2015 by Sylvestre

1 Answer

0 votes
 
Best answer

I have solved my problem.

First, the path was not correct, it was missing some "/" before the D: <xml-source url="file:///D:/Performance/data/test.xml">

Second, To start the treatment, I should assign to a node the service under an interface. I have done it in "Manage Provisioning Requisitions" admin menu. I get some issue in it because I didn't see in the IHM that you should enable the free text for the service which allows me to write my service name "XMLTest".

 

answered Jan 13, 2015 by Sylvestre (380 points)
selected Jan 18, 2015 by indigo
...