为什么这个小的 datacollection-config.xml 在 opennms 中无效?

为什么这个小的 datacollection-config.xml 在 opennms 中无效?
<?xml version="1.0"?>
<datacollection-config rrdRepository="/var/lib/opennms/rrd/snmp/">
  <snmp-collection name="default" snmpStorageFlag="select">
    <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>

<resourceType name="testResourceType" label="ciscotestgroup" >
  <persistenceSelectorStrategy class="org.opennms.netmgt.collectd.PersistAllSelectorStrategy"/>
  <storageStrategy class="org.opennms.netmgt.dao.support.FrameRelayStorageStrategy"/>
</resourceType>

  <group name="ciscotestgroup" ifType="all">
    <mibObj oid=".1.3.6.1.2.1.2.2.1.10"     instance="ifIndex" alias="ifInOctets"      type="counter" />
  </group>

  <systemDef name="cisco-routers-test">
    <sysoidMask>.1.3.6.1.4.1.9.1.</sysoidMask>
    <collect>
      <includeGroup>ciscotestgroup</includeGroup>
    </collect>
  </systemDef>

大家好,

我尝试了数周,只从思科路由器的所有接口获取所需的一小部分 snmp 数据。使用 opennms wiki 验证帮助不大。它仍然无法使用上述 datacollection-config.xml 文件重新启动。

如果我用下面的替换,opennms 就会启动并运行。我怀疑是 resourceType 名称和 group instace 变量。有人能告诉我上面的配置文件在逻辑上/技术上有什么错误吗......(我将 ifIndex 替换为 testResourceType,但仍然不起作用)

谢谢。

<?xml version="1.0"?>
<datacollection-config rrdRepository="/var/lib/opennms/rrd/snmp/">
  <snmp-collection name="default" snmpStorageFlag="select">
    <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>

<resourceType name="frCircuitIfIndex" label="Frame-Relay Circuit (RFC1315)">
  <persistenceSelectorStrategy class="org.opennms.netmgt.collectd.PersistAllSelectorStrategy"/>
  <storageStrategy class="org.opennms.netmgt.dao.support.FrameRelayStorageStrategy"/>
</resourceType>


<groups>
  <group name="cisco-frame-relay" ifType="all">
    <mibObj oid=".1.3.6.1.4.1.9.9.49.1.2.2.1.1" instance="frCircuitIfIndex" alias="frIfName"     type="string" />
    <mibObj oid=".1.3.6.1.4.1.9.9.49.1.2.2.1.2" instance="frCircuitIfIndex" alias="frIfType"     type="string" />
    <mibObj oid=".1.3.6.1.4.1.9.9.49.1.2.2.1.3" instance="frCircuitIfIndex" alias="frSubifIndex" type="string" />
    <mibObj oid=".1.3.6.1.4.1.9.9.49.1.2.1.1.1" instance="frCircuitIfIndex" alias="frDEins"        type="counter" />
    <mibObj oid=".1.3.6.1.4.1.9.9.49.1.2.1.1.2" instance="frCircuitIfIndex" alias="frDEouts"       type="counter" />
    <mibObj oid=".1.3.6.1.4.1.9.9.49.1.2.1.1.3" instance="frCircuitIfIndex" alias="frDropPktsOuts" type="counter" />
  </group>

  <group name="rfc1315-frame-relay" ifType="all">
    <mibObj oid=".1.3.6.1.2.1.10.32.2.1.1" instance="frCircuitIfIndex" alias="frIfIndex"        type="string" />
    <mibObj oid=".1.3.6.1.2.1.10.32.2.1.2" instance="frCircuitIfIndex" alias="frDlci"           type="string" />
    <mibObj oid=".1.3.6.1.2.1.10.32.2.1.3" instance="frCircuitIfIndex" alias="frState"          type="string" />
    <mibObj oid=".1.3.6.1.2.1.10.32.2.1.4" instance="frCircuitIfIndex" alias="frReceivedFECNs"  type="Counter" />
    <mibObj oid=".1.3.6.1.2.1.10.32.2.1.5" instance="frCircuitIfIndex" alias="frReceivedBECNs"  type="Counter" />
    <mibObj oid=".1.3.6.1.2.1.10.32.2.1.6" instance="frCircuitIfIndex" alias="frSentFrames"     type="Counter" />
    <mibObj oid=".1.3.6.1.2.1.10.32.2.1.7" instance="frCircuitIfIndex" alias="frSentOctets"     type="Counter" />
    <mibObj oid=".1.3.6.1.2.1.10.32.2.1.8" instance="frCircuitIfIndex" alias="frReceivedFrames" type="Counter" />
    <mibObj oid=".1.3.6.1.2.1.10.32.2.1.9" instance="frCircuitIfIndex" alias="frReceivedOctets" type="Counter" />
  </group>

</groups>

<systems>

  <systemDef name="Cisco Routers">
    <sysoidMask>.1.3.6.1.4.1.9.1.</sysoidMask>
    <collect>
      <includeGroup>rfc1315-frame-relay</includeGroup>
      <includeGroup>cisco-frame-relay</includeGroup>
    </collect>
  </systemDef>

</systems>

答案1

我相信附件<systems><groups>标签是强制性的,但在您的示例中却缺失了。

<groups>
  <group name="ciscotestgroup" ifType="all">
    <mibObj oid=".1.3.6.1.2.1.2.2.1.10"     instance="ifIndex" alias="ifInOctets"      type="counter" />
  </group>
</groups>

<systems>
  <systemDef name="cisco-routers-test">
    <sysoidMask>.1.3.6.1.4.1.9.1.</sysoidMask>
    <collect>
      <includeGroup>ciscotestgroup</includeGroup>
    </collect>
  </systemDef>
</systems>

相关内容