Failed at applying specific rrd step to the node

Hi, teams.

I think the failed reason for this topic is the same as Failed at applying specific threshold to the node

I defined a snmp-collection name A with rrd step is 900:

   <snmp-collection name="A" snmpStorageFlag="select">
      <rrd step="900">
         <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>
     <include-collection dataCollectionGroup="MIB2"/>
      ...
   </snmp-collection>

and defined a snmp-collection name B with rrd step is 1200:

   <snmp-collection name="B" snmpStorageFlag="select">
      <rrd step="1200">
         <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>
     <include-collection dataCollectionGroup="MIB2"/>
      ...
   </snmp-collection>

In collects-configuration.xml, I also defined packages, naming A and B, its collection value is the same as I defined in snmp-collection, for example:

   <package name="A" remote="false">
      <filter><![CDATA[((IPADDR != '0.0.0.0') & catincA & catincyue)]]></filter>
      <include-range begin="1.1.1.1" end="254.254.254.254"/>
      <include-range begin="::1" end="ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"/>
      <service name="SNMP" interval="900000" user-defined="false" status="on">
         <parameter key="collection" value="A"/>
         <parameter key="thresholding-enabled" value="true"/>
      </service>
   </package>
   <package name="B" remote="false">
      <filter><![CDATA[((IPADDR != '0.0.0.0') & catincB & catincyue)]]></filter>
      <include-range begin="1.1.1.1" end="254.254.254.254"/>
      <include-range begin="::1" end="ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"/>
      <service name="SNMP" interval="1200000" user-defined="false" status="on">
         <parameter key="collection" value="B"/>
         <parameter key="thresholding-enabled" value="true"/>
      </service>
   </package>

Verify filter by opennms:filter result:

admin@opennms> opennms:filter "(IPADDR != '0.0.0.0') & catincA & catincyue"

nodeId=291 nodeLabel=collect-291 location=Default
	categories:
		yue		A	IpAddresses:
		192.168.2.2
admin@opennms> opennms:filter "(IPADDR != '0.0.0.0') & catincB & catincyue"

nodeId=292 nodeLabel=collect-292 location=Default
	categories:
		yue		B	IpAddresses:
		192.168.2.2

admin@opennms>

To reach my expected results, I do the recreating for rrd:

  1. remove old rrd file: rm -rf /var/opennms/rrd/snmp/${nodeId}.
  2. reloadDaemonConfig: /opt/opennms/bin/send-event.pl uei.opennms.org/internal/reloadDaemonConfig --parm 'daemonName Collectd'.
  3. rrdtool dump: rrdtool dump /var/opennms/rrd/snmp/' + nodeId + '/tcpActiveOpens.rrd ' + nodeId + '/tmp.xml'

Here is the result of the recreation, but isn’t my expectation:

----------------
nodeId 291: 	<step>1200</step> <!-- Seconds -->
 291 expected output: 900
----------------
nodeId 292: 	<step>900</step> <!-- Seconds -->
 292 expected output: 1200

Expected results

nodeId 291: 	<step>900</step> <!-- Seconds -->
nodeId 292: 	<step>1200</step> <!-- Seconds -->

Version:
Meridian 2020.1.3

Might take more than a reload. I’d restart OpenNMS and retest.

@dino2gnt still failed. :confused:

----------------
nodeId 291:     <step>1200</step> <!-- Seconds -->
 291 expected output: 900
----------------
nodeId 292:     <step>1200</step> <!-- Seconds -->
 292 expected output: 1200

I did something like:

<collectd-configuration xmlns="http://xmlns.opennms.org/xsd/config/collectd" threads="50">

   <package name="example0" remote="false">
      <filter>IPADDR != '0.0.0.0' &amp; catincfoo &amp; catincbazz</filter>
      <include-range begin="1.1.1.1" end="254.254.254.254"/>
      <include-range begin="::1" end="ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"/>
      <service name="SNMP" interval="900000" user-defined="false" status="on">
         <parameter key="collection" value="foo"/>
         <parameter key="thresholding-enabled" value="true"/>
      </service>
   </package>

   <package name="example1" remote="false">
      <filter>IPADDR != '0.0.0.0' &amp; catincbar &amp; catincbazz</filter>
      <include-range begin="1.1.1.1" end="254.254.254.254"/>
      <include-range begin="::1" end="ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"/>
      <service name="SNMP" interval="1200000" user-defined="false" status="on">
         <parameter key="collection" value="bar"/>
         <parameter key="thresholding-enabled" value="true"/>
      </service>
   </package>
   <package name="example2" remote="false">
   <...>

in collectd, then in datacolection-config.xml:

<datacollection-config xmlns="http://xmlns.opennms.org/xsd/config/datacollection" rrdRepository="/opt/opennms/share/rrd/snmp/">
   <snmp-collection name="foo" snmpStorageFlag="select">
      <rrd step="900">
         <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>
      <include-collection dataCollectionGroup="MIB2"/>
      <include-collection dataCollectionGroup="Net-SNMP"/>
   </snmp-collection>
   <snmp-collection name="bar" snmpStorageFlag="select">
      <rrd step="1200">
         <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>
      <include-collection dataCollectionGroup="MIB2"/>
      <include-collection dataCollectionGroup="Net-SNMP"/>
   </snmp-collection>

   <snmp-collection name="default" snmpStorageFlag="select">
      <rrd step="300">

Then provisioned two nodes:

<model-import xmlns="http://xmlns.opennms.org/xsd/config/model-import" date-stamp="2022-07-20T13:50:40.640-04:00" foreign-source="test" last-import="2022-07-20T13:51:23.855-04:00">
   <node foreign-id="1658339029248" node-label="Node-foo">
      <interface ip-addr="127.0.1.1" status="1" snmp-primary="P"/>
      <category name="foo"/>
      <category name="bazz"/>
   </node>
   <node foreign-id="1658339413246" node-label="Node-bar">
      <interface ip-addr="127.0.1.2" status="1" snmp-primary="P"/>
      <category name="bar"/>
      <category name="bazz"/>
   </node>
</model-import>

Works in Karaf:

admin@opennms()> opennms:filter "IPADDR != '0.0.0.0' & catincfoo & catincbazz"

nodeId=2 nodeLabel=Node-foo location=Default
        categories:
                bazz            foo     IpAddresses:
                127.0.1.1
admin@opennms()> opennms:filter "IPADDR != '0.0.0.0' & catincbar & catincbazz"

nodeId=3 nodeLabel=Node-bar location=Default
        categories:
                bazz            bar     IpAddresses:
                127.0.1.2

rrdtool shows the right steps:

[root@filtertest etc]# rrdtool info ../share/rrd/snmp/2/hrSystemUptime.rrd | grep step
step = 900
[root@filtertest etc]# rrdtool info ../share/rrd/snmp/3/hrSystemUptime.rrd | grep step
step = 1200

In your test I see that the filters are returning the same IP addresses for different nodes. What happens when you test on a set of nodes that aren’t duplicating IP addresses?

@dino2gnt I was working on the same IP address because I needed to do something like monitoring two separate nodes with the same IP in some specific cases… Is there a solution for my cases?

(btw) So… Is the reason the same as why I failed to apply the threshold?! (because I test with the same IP address.)