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

How to create sub XML collector ?

0 votes
7 views

Hi,

I have a probleme , i search to obtain all datas by Slot / instance , with this XML source.
Each slot has x instances .

But i have a collection with all slots , and a other collection with all instances . but never all instances by slot.

is it possible to make it ?

tks.

<nxBuffersLinecard>
 <slot slotNum="3">
   <instance instanceId="0">
     <parameter key="total" value="16384"/>
     <parameter key="used" value="123"/>
   </instance>
   <instance instanceId="1">
     <parameter key="total" value="16384"/>
     <parameter key="used" value="47"/>
   </instance>
   <instance instanceId="2">
     <parameter key="total" value="16384"/>
    <parameter key="used" value="25"/>
  </instance>
 <slot slotNum="4">
   <instance instanceId="0">
     <parameter key="total" value="16384"/>
     <parameter key="used" value="123"/>
   </instance>
   <instance instanceId="1">
     <parameter key="total" value="16384"/>
     <parameter key="used" value="47"/>
   </instance>
   <instance instanceId="2">
     <parameter key="total" value="16384"/>
    <parameter key="used" value="25"/>
  </instance>
 </slot>
</nxBuffersLinecard>
XML Source

 

/etc/xml-datacollection-config.xml
<xml-collection name="coll_xml_linecardBuffers">
        <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="http://10.0.0.10:8080/xml/linecard_10.0.0.15.xml">
           <import-groups>xml-datacollection/XML_linecardBuffers.xml</import-groups>
       </xml-source>
    </xml-collection> 

 

/etc/xml-datacollection/XML_linecardBuffers

<xml-groups>
    <xml-group name="lc.linecard" resource-type="nexusLinecardSlot" resource-xpath="/nxBuffersLinecard/slot" key-xpath="@slotNum">
        <xml-object name="lc.slotnum" type="STRING" xpath="@slotNum"/>
    </xml-group>
   
    <xml-group name="lc.slot" resource-type="nexusLinecardInstance"   resource-xpath="/nxBuffersLinecard/slot/instance" key-xpath="@instanceId">
          <xml-object name="lc.instance" type="STRING" xpath="@instanceId"/>
          <xml-object name="lc.total"    type="GAUGE"  xpath="parameter[@key='total']/@value" />
          <xml-object name="lc.used"     type="GAUGE"  xpath="parameter[@key='used']/@
value" />
    </xml-group>

</xml-groups>

 

/etc/datacollection/bpceit.xml

<datacollection-group name="bpceit">
   <resourceType name="nexusLinecardSlot" label="Nexus Linecard Buffer"   resourceLabel="Instance: ${lc.slotnum}" >
     <persistenceSelectorStrategy class="org.opennms.netmgt.collection.support.PersistAllSelectorStrategy"/>
     <storageStrategy class="org.opennms.netmgt.collection.support.IndexStorageStrategy"/>
  </resourceType>

  <resourceType name="nexusLinecardInstance" label="Nexus Linecard Buffer"  resourceLabel="slotNum: ${lc.slotnum} / instanceId: ${lc.instance}" >
       <persistenceSelectorStrategy class="org.opennms.netmgt.collection.support.PersistAllSelectorStrategy"/>
       <storageStrategy class="org.opennms.netmgt.collection.support.IndexStorageStrategy"/>
  </resourceType>

</datacollection-group>

Fred

 

 

OpenNMS version
20.0.2
Java version
1.8.0_05 Oracle Corporation
Operating system
Windows Server 2008 R2 6.1 (amd64)
PostgreSQL version
9.3
asked Oct 25 by fredo (150 points)

Please log in or register to answer this question.

...