Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Mon Mar 25, 2019 3:30 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Data Query wrong index parse
PostPosted: Mon Feb 19, 2018 10:48 am 
Offline

Joined: Thu Dec 11, 2014 12:45 pm
Posts: 2
Good morning everyone!

I'm having an issue with a SNMP Data Query. Basically the error is shown in the following picture:
Attachment:
Captura de pantalla de 2018-02-19 12-38-33.png
Captura de pantalla de 2018-02-19 12-38-33.png [ 15.54 KiB | Viewed 229 times ]

There is a mismatch among the index and the IPv4 field for one of the peers.

The XML file for the Data Query is:
Code:
<interface>
   <name>Juniper BGP Peers</name>
   <description>Queries a Juniper router for a list of BGP peers and parameters</description>
   <oid_index>.1.3.6.1.4.1.2636.5.1.1.2.1.1.1.14</oid_index>
   <index_order>Index</index_order>
   <index_order_type>numeric</index_order_type>
   <index_title_format>|chosen_order_field|</index_title_format>

   <fields>
      <Index>
         <name>Index</name>
         <method>walk</method>
         <source>index</source>
         <direction>input</direction>
      </Index>
      <IPv4Address>
         <name>Peer Remote IPv4 Addr</name>
         <method>walk</method>
         <source>OID/REGEXP:.*\.1\.1\.14\.0\.1\.\d+\.\d+\.\d+\.\d+\.\d+\.(\d+\.\d+\.\d+\.\d+)$</source>
         <direction>input</direction>
         <oid>.1.3.6.1.4.1.2636.5.1.1.2.1.1.1.14.0.1</oid>
      </IPv4Address>
      <IPv6Address>
         <name>Peer Remote IPv6 Addr</name>
         <method>walk</method>
         <source>OID/REGEXP:.*\.1\.1\.14\.0\.2\.\d+\.\d+\.\d+\.\d+\.\d+\.\d+\.\d+\.\d+\.\d+\.\d+\.\d+\.\d+\.\d+\.\d+\.\d+\.\d+\.\d+\.(\d+\.\d+\.\d+\.\d+\.\d+\.\d+\.\d+\.\d+\.\d+\.\d+\.\d+\.\d+\.\d+\.\d+\.\d+\.\d+)$</source>
         <direction>input</direction>
         <oid>.1.3.6.1.4.1.2636.5.1.1.2.1.1.1.14.0.2</oid>
      </IPv6Address>
      <sampleJnxBgpM2PrefixInPrefixesAccepted>
         <name>In Prefixes Accepted</name>
         <method>get</method>
         <source>value</source>
         <direction>input</direction>
         <oid>.1.3.6.1.4.1.2636.5.1.1.2.6.2.1.8</oid>
         <oid_suffix>1.1</oid_suffix>
      </sampleJnxBgpM2PrefixInPrefixesAccepted>
      <sampleJnxBgpM2PrefixOutPrefixes>
         <name>Out Prefixes</name>
         <method>get</method>
         <source>value</source>
         <direction>input</direction>
         <oid>.1.3.6.1.4.1.2636.5.1.1.2.6.2.1.10</oid>
         <oid_suffix>1.1</oid_suffix>
      </sampleJnxBgpM2PrefixOutPrefixes>
      
      
      <jnxBgpM2PrefixInPrefixes>
         <name>In Prefixes</name>
         <method>get</method>
         <source>value</source>
         <direction>output</direction>
         <oid>.1.3.6.1.4.1.2636.5.1.1.2.6.2.1.7</oid>
         <oid_suffix>1.1</oid_suffix>
      </jnxBgpM2PrefixInPrefixes>
      <jnxBgpM2PrefixInPrefixesAccepted>
         <name>In Prefixes Accepted</name>
         <method>get</method>
         <source>value</source>
         <direction>output</direction>
         <oid>.1.3.6.1.4.1.2636.5.1.1.2.6.2.1.8</oid>
         <oid_suffix>1.1</oid_suffix>
      </jnxBgpM2PrefixInPrefixesAccepted>
      <jnxBgpM2PrefixInPrefixesRejected>
         <name>In Prefixes Rejected</name>
         <method>get</method>
         <source>value</source>
         <direction>output</direction>
         <oid>.1.3.6.1.4.1.2636.5.1.1.2.6.2.1.9</oid>
         <oid_suffix>1.1</oid_suffix>
      </jnxBgpM2PrefixInPrefixesRejected>
      <jnxBgpM2PrefixOutPrefixes>
         <name>Out Prefixes</name>
         <method>get</method>
         <source>value</source>
         <direction>output</direction>
         <oid>.1.3.6.1.4.1.2636.5.1.1.2.6.2.1.10</oid>
         <oid_suffix>1.1</oid_suffix>
      </jnxBgpM2PrefixOutPrefixes>
      <jnxBgpM2PrefixInPrefixesActive>
         <name>In Prefixes Active</name>
         <method>get</method>
         <source>value</source>
         <direction>output</direction>
         <oid>.1.3.6.1.4.1.2636.5.1.1.2.6.2.1.11</oid>
         <oid_suffix>1.1</oid_suffix>
      </jnxBgpM2PrefixInPrefixesActive>
   </fields>
</interface>


The debug information gives the following answer:

Code:
+ Running data query [23].
+ Found type = '3' [SNMP Query].
+ Found data query XML file at '/usr/share/cacti/resource/snmp_queries/juniper_bgp_prefix.xml'
+ XML file parsed ok.
+ <oid_num_indexes> missing in XML file, 'Index Count Changed' emulated by counting oid_index entries
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.2636.5.1.1.2.1.1.1.14' Index Count: 2
+ Index found at OID: 'enterprises.2636.5.1.1.2.1.1.1.14.0.1.ZZZ.ZZZ.ZZZ.ZZZ.1.AAA.AAA.AAA.AAA' value: '10'
+ Index found at OID: 'enterprises.2636.5.1.1.2.1.1.1.14.0.1.YYY.YYY.YYY.YYY.1.BBB.BBB.BBB.BBB' value: '0'
+ Inserting index data for field 'Index' [value='10']
+ Inserting index data for field 'Index' [value='0']
+ Located input field 'IPv4Address' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.2636.5.1.1.2.1.1.1.14.0.1'
+ Found item [IPv4Address='AAA.AAA.AAA.AAA'] index: 10 [from regexp oid parse]
+ Found item [IPv4Address='BBB.BBB.BBB.BBB'] index: 1 [from regexp oid parse]
+ Located input field 'IPv6Address' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.2636.5.1.1.2.1.1.1.14.0.2'
+ Located input field 'sampleJnxBgpM2PrefixInPrefixesAccepted' [get]
+ Executing SNMP get for data @ '.1.3.6.1.4.1.2636.5.1.1.2.6.2.1.8.10.1.1' [value='1']
+ Executing SNMP get for data @ '.1.3.6.1.4.1.2636.5.1.1.2.6.2.1.8.0.1.1' [value='1']
+ Located input field 'sampleJnxBgpM2PrefixOutPrefixes' [get]
+ Executing SNMP get for data @ '.1.3.6.1.4.1.2636.5.1.1.2.6.2.1.10.10.1.1' [value='8']
+ Executing SNMP get for data @ '.1.3.6.1.4.1.2636.5.1.1.2.6.2.1.10.0.1.1' [value='8']


The problematic line is the following one:
Code:
+ Found item [IPv4Address='BBB.BBB.BBB.BBB'] index: 1 [from regexp oid parse]


I don't know why the first index is parsed OK, but the second one is detected as 1 when it should be 0.

The snmpwalk queries are the following:
Code:
snmpwalk -v2c -c YYYY XXX.XXX.XXX.XXX 1.3.6.1.4.1.2636.5.1.1.2.1.1.1.14
SNMPv2-SMI::enterprises.2636.5.1.1.2.1.1.1.14.0.1.ZZZ.ZZZ.ZZZ.ZZZ.1.AAA.AAA.AAA.AAA = Gauge32: 10
SNMPv2-SMI::enterprises.2636.5.1.1.2.1.1.1.14.0.1.YYY.YYY.YYY.YYY.1.BBB.BBB.BBB.BBB = Gauge32: 0

snmpwalk -v2c -c YYYY XXX.XXX.XXX.XXX 1.3.6.1.4.1.2636.5.1.1.2.6.2.1.7
SNMPv2-SMI::enterprises.2636.5.1.1.2.6.2.1.7.0.1.1 = Gauge32: 1
SNMPv2-SMI::enterprises.2636.5.1.1.2.6.2.1.7.10.1.1 = Gauge32: 1

snmpwalk -v2c -c YYYY XXX.XXX.XXX.XXX 1.3.6.1.4.1.2636.5.1.1.2.6.2.1.10
SNMPv2-SMI::enterprises.2636.5.1.1.2.6.2.1.10.0.1.1 = Gauge32: 8
SNMPv2-SMI::enterprises.2636.5.1.1.2.6.2.1.10.10.1.1 = Gauge32: 8


Do you know why it parses the index that way?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 40 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group