Huawei QoS Port Queue Stats Index-based SNMP template

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
kulga
Posts: 5
Joined: Tue Aug 08, 2017 1:34 am

Huawei QoS Port Queue Stats Index-based SNMP template

Post by kulga »

Hello Guys,

i have create a template for the Huawei QoS Port Queue Statistik.
This is working, but not really smart.
It is based on a snmp-index template.

The OID is: .1.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1

Code: Select all

# snmpwalk -v 2c -c xxxxx xxxxxx .1.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1
SNMPv2-SMI::enterprises.2011.5.25.32.4.1.1.31.1.1.6.2.1 = INTEGER: 6
SNMPv2-SMI::enterprises.2011.5.25.32.4.1.1.31.1.1.6.2.2 = INTEGER: 6
SNMPv2-SMI::enterprises.2011.5.25.32.4.1.1.31.1.1.6.2.3 = INTEGER: 6
SNMPv2-SMI::enterprises.2011.5.25.32.4.1.1.31.1.1.6.2.4 = INTEGER: 6
SNMPv2-SMI::enterprises.2011.5.25.32.4.1.1.31.1.1.6.2.5 = INTEGER: 6
SNMPv2-SMI::enterprises.2011.5.25.32.4.1.1.31.1.1.6.2.6 = INTEGER: 6
SNMPv2-SMI::enterprises.2011.5.25.32.4.1.1.31.1.1.6.2.7 = INTEGER: 6
SNMPv2-SMI::enterprises.2011.5.25.32.4.1.1.31.1.1.6.2.8 = INTEGER: 6
SNMPv2-SMI::enterprises.2011.5.25.32.4.1.1.31.1.1.7.2.1 = INTEGER: 7
SNMPv2-SMI::enterprises.2011.5.25.32.4.1.1.31.1.1.7.2.2 = INTEGER: 7
SNMPv2-SMI::enterprises.2011.5.25.32.4.1.1.31.1.1.7.2.3 = INTEGER: 7
SNMPv2-SMI::enterprises.2011.5.25.32.4.1.1.31.1.1.7.2.4 = INTEGER: 7
SNMPv2-SMI::enterprises.2011.5.25.32.4.1.1.31.1.1.7.2.5 = INTEGER: 7
SNMPv2-SMI::enterprises.2011.5.25.32.4.1.1.31.1.1.7.2.6 = INTEGER: 7
SNMPv2-SMI::enterprises.2011.5.25.32.4.1.1.31.1.1.7.2.7 = INTEGER: 7
SNMPv2-SMI::enterprises.2011.5.25.32.4.1.1.31.1.1.7.2.8 = INTEGER: 7
The last 3 numbers are my index.
InterfaceIndex.Direction.Queue
6 . 2 . 1

Here my SNMP-query XML File:

Code: Select all

 hwXQoSPortQueueStatisticsTable.xml
 <interface>
   <name>Get Huawei QoS Port Queue Statistics</name>
   <oid_index>.1.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1</oid_index>
   <oid_index_parse>OID/REGEXP:^.{40}(.*)</oid_index_parse>
   <index_order>qosIndex</index_order>
   <index_order_type>numeric</index_order_type>

   <fields>
        <qosIndex>
          <name>Index</name>
          <method>walk</method>
          <source>index</source>
          <direction>input</direction>
        </qosIndex>

        <hwXQoSPortQueueStatisticsInterfaceIndex>
          <name>Name</name>
          <method>walk</method>
          <source>value</source>
          <direction>input</direction>
          <oid>.1.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1</oid>
        </hwXQoSPortQueueStatisticsInterfaceIndex>

        <hwXQoSPortQueueStatisticsQueueIndex>
          <name>QueueIndex</name>
          <method>walk</method>
          <source>value</source>
          <direction>input</direction>
          <oid>.1.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.3</oid>
        </hwXQoSPortQueueStatisticsQueueIndex>

        <hwXQoSPortQueueStatisticsTotalPassPackets>
          <name>TotalPassPackets</name>
          <method>walk</method>
          <source>value</source>
          <direction>output</direction>
          <oid>.1.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.5</oid>
        </hwXQoSPortQueueStatisticsTotalPassPackets>

        <hwXQoSPortQueueStatisticsTotalPassBytes>
          <name>TotalPassBytes</name>
          <method>walk</method>
          <source>value</source>
          <direction>output</direction>
          <oid>.1.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.6</oid>
        </hwXQoSPortQueueStatisticsTotalPassBytes>

        <hwXQoSPortQueueStatisticsTotalDiscardPackets>
          <name>TotalDiscardPackets</name>
          <method>walk</method>
          <source>value</source>
          <direction>output</direction>
          <oid>.1.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.7</oid>
        </hwXQoSPortQueueStatisticsTotalDiscardPackets>

        <hwXQoSPortQueueStatisticsTotalDiscardBytes>
          <name>TotalDiscardBytes</name>
          <method>walk</method>
          <source>value</source>
          <direction>output</direction>
          <oid>.1.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.8</oid>
        </hwXQoSPortQueueStatisticsTotalDiscardBytes>

        <hwXQoSPortQueueStatisticsDropTailDiscardPackets>
          <name>DropTailDiscardPackets</name>
          <method>walk</method>
          <source>value</source>
          <direction>output</direction>
          <oid>.1.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.9</oid>
        </hwXQoSPortQueueStatisticsDropTailDiscardPackets>

        <hwXQoSPortQueueStatisticsDropTailDiscardBytes>
          <name>DropTailDiscardBytes</name>
          <method>walk</method>
          <source>value</source>
          <direction>output</direction>
          <oid>.1.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.10</oid>
        </hwXQoSPortQueueStatisticsDropTailDiscardBytes>

        <hwXQoSPortQueueStatisticsWredDiscardPackets>
          <name>WredDiscardPackets</name>
          <method>walk</method>
          <source>value</source>
          <direction>output</direction>
          <oid>.1.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.11</oid>
        </hwXQoSPortQueueStatisticsWredDiscardPackets>

        <hwXQoSPortQueueStatisticsWredDiscardBytes>
          <name>WredDiscardBytes</name>
          <method>walk</method>
          <source>value</source>
          <direction>output</direction>
          <oid>.1.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.12</oid>
        </hwXQoSPortQueueStatisticsWredDiscardBytes>

      </fields>
 </interface>
Here are the Data Query Debug Infos:

Code: Select all

Data Query Debug Information
+ Running data query [17].
+ Found type = '3' [SNMP Query].
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/hwXQoSPortQueueStatisticsTable.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.2011.5.25.32.4.1.1.31.1.1' Index Count: 352
+ Index found at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.6.2.1' value: '6'
+ Index found at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.6.2.2' value: '6'
+ Index found at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.6.2.3' value: '6'
+ Index found at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.6.2.4' value: '6'
+ Index found at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.6.2.5' value: '6'
+ Index found at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.6.2.6' value: '6'
+ Index found at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.6.2.7' value: '6'
+ Index found at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.6.2.8' value: '6'
+ Index found at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.7.2.1' value: '7'
+ Index found at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.7.2.2' value: '7'
+ Index found at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.7.2.3' value: '7'
+ Index found at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.7.2.4' value: '7'
+ Index found at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.7.2.5' value: '7'
+ Index found at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.7.2.6' value: '7'
+ Index found at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.7.2.7' value: '7'
+ Index found at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.7.2.8' value: '7'
...
+ index_parse at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.6.2.1' results: '6.2.1'
+ index_parse at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.6.2.2' results: '6.2.2'
+ index_parse at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.6.2.3' results: '6.2.3'
+ index_parse at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.6.2.4' results: '6.2.4'
+ index_parse at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.6.2.5' results: '6.2.5'
+ index_parse at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.6.2.6' results: '6.2.6'
+ index_parse at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.6.2.7' results: '6.2.7'
+ index_parse at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.6.2.8' results: '6.2.8'
+ index_parse at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.7.2.1' results: '7.2.1'
+ index_parse at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.7.2.2' results: '7.2.2'
+ index_parse at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.7.2.3' results: '7.2.3'
+ index_parse at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.7.2.4' results: '7.2.4'
+ index_parse at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.7.2.5' results: '7.2.5'
+ index_parse at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.7.2.6' results: '7.2.6'
+ index_parse at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.7.2.7' results: '7.2.7'
+ index_parse at OID: 'iso.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1.7.2.8' results: '7.2.8'
...
+ Inserting index data for field 'qosIndex' [value='6.2.1']
+ Inserting index data for field 'qosIndex' [value='6.2.2']
+ Inserting index data for field 'qosIndex' [value='6.2.3']
+ Inserting index data for field 'qosIndex' [value='6.2.4']
+ Inserting index data for field 'qosIndex' [value='6.2.5']
+ Inserting index data for field 'qosIndex' [value='6.2.6']
+ Inserting index data for field 'qosIndex' [value='6.2.7']
+ Inserting index data for field 'qosIndex' [value='6.2.8']
+ Inserting index data for field 'qosIndex' [value='7.2.1']
+ Inserting index data for field 'qosIndex' [value='7.2.2']
+ Inserting index data for field 'qosIndex' [value='7.2.3']
+ Inserting index data for field 'qosIndex' [value='7.2.4']
+ Inserting index data for field 'qosIndex' [value='7.2.5']
+ Inserting index data for field 'qosIndex' [value='7.2.6']
+ Inserting index data for field 'qosIndex' [value='7.2.7']
+ Inserting index data for field 'qosIndex' [value='7.2.8']
...
+ Located input field 'hwXQoSPortQueueStatisticsInterfaceIndex' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.1'
+ Found item [hwXQoSPortQueueStatisticsInterfaceIndex='6'] index: 6.2.1 [from value]
+ Found item [hwXQoSPortQueueStatisticsInterfaceIndex='6'] index: 6.2.2 [from value]
+ Found item [hwXQoSPortQueueStatisticsInterfaceIndex='6'] index: 6.2.3 [from value]
+ Found item [hwXQoSPortQueueStatisticsInterfaceIndex='6'] index: 6.2.4 [from value]
+ Found item [hwXQoSPortQueueStatisticsInterfaceIndex='6'] index: 6.2.5 [from value]
+ Found item [hwXQoSPortQueueStatisticsInterfaceIndex='6'] index: 6.2.6 [from value]
+ Found item [hwXQoSPortQueueStatisticsInterfaceIndex='6'] index: 6.2.7 [from value]
+ Found item [hwXQoSPortQueueStatisticsInterfaceIndex='6'] index: 6.2.8 [from value]
+ Found item [hwXQoSPortQueueStatisticsInterfaceIndex='7'] index: 7.2.1 [from value]
+ Found item [hwXQoSPortQueueStatisticsInterfaceIndex='7'] index: 7.2.2 [from value]
+ Found item [hwXQoSPortQueueStatisticsInterfaceIndex='7'] index: 7.2.3 [from value]
+ Found item [hwXQoSPortQueueStatisticsInterfaceIndex='7'] index: 7.2.4 [from value]
+ Found item [hwXQoSPortQueueStatisticsInterfaceIndex='7'] index: 7.2.5 [from value]
+ Found item [hwXQoSPortQueueStatisticsInterfaceIndex='7'] index: 7.2.6 [from value]
+ Found item [hwXQoSPortQueueStatisticsInterfaceIndex='7'] index: 7.2.7 [from value]
+ Found item [hwXQoSPortQueueStatisticsInterfaceIndex='7'] index: 7.2.8 [from value]
...
+ Located input field 'hwXQoSPortQueueStatisticsQueueIndex' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.2011.5.25.32.4.1.1.31.1.3'
+ Found item [hwXQoSPortQueueStatisticsQueueIndex='1'] index: 6.2.1 [from value]
+ Found item [hwXQoSPortQueueStatisticsQueueIndex='2'] index: 6.2.2 [from value]
+ Found item [hwXQoSPortQueueStatisticsQueueIndex='3'] index: 6.2.3 [from value]
+ Found item [hwXQoSPortQueueStatisticsQueueIndex='4'] index: 6.2.4 [from value]
+ Found item [hwXQoSPortQueueStatisticsQueueIndex='5'] index: 6.2.5 [from value]
+ Found item [hwXQoSPortQueueStatisticsQueueIndex='6'] index: 6.2.6 [from value]
+ Found item [hwXQoSPortQueueStatisticsQueueIndex='7'] index: 6.2.7 [from value]
+ Found item [hwXQoSPortQueueStatisticsQueueIndex='8'] index: 6.2.8 [from value]
+ Found item [hwXQoSPortQueueStatisticsQueueIndex='1'] index: 7.2.1 [from value]
+ Found item [hwXQoSPortQueueStatisticsQueueIndex='2'] index: 7.2.2 [from value]
+ Found item [hwXQoSPortQueueStatisticsQueueIndex='3'] index: 7.2.3 [from value]
+ Found item [hwXQoSPortQueueStatisticsQueueIndex='4'] index: 7.2.4 [from value]
+ Found item [hwXQoSPortQueueStatisticsQueueIndex='5'] index: 7.2.5 [from value]
+ Found item [hwXQoSPortQueueStatisticsQueueIndex='6'] index: 7.2.6 [from value]
+ Found item [hwXQoSPortQueueStatisticsQueueIndex='7'] index: 7.2.7 [from value]
+ Found item [hwXQoSPortQueueStatisticsQueueIndex='8'] index: 7.2.8 [from value]
I can now generate statistiks for each interface and each queue. But it is not smart, because i have only the interface index but not the name of the interface. How can I identifiy the ifdescr per snmp in this xml file?

I can provide the template, if it is running very well.

Kulga
kulga
Posts: 5
Joined: Tue Aug 08, 2017 1:34 am

Re: Huawei QoS Port Queue Stats Index-based SNMP template

Post by kulga »

How can I change the Index in a snmp-based queuey?

In my Index is the ifindex but with two additional informations.
Is it possible to change the index (form 6.2.1. to only 6) and with this Index ask the OID for the ifDescr?

I need this to identifiy the name of the interface.
Because with only the ifindex number is not user friendly.
aboutofit
Posts: 6
Joined: Fri Mar 23, 2018 3:30 pm

Re: Huawei QoS Port Queue Stats Index-based SNMP template

Post by aboutofit »

Hello friend, do you have progress with this template ? i need it too, could you share it ?
georkings
Posts: 9
Joined: Thu Apr 04, 2013 12:57 pm

Re: Huawei QoS Port Queue Stats Index-based SNMP template

Post by georkings »

Hi folks,

You cannot change the index (from 6.2.1. to only 6) because the index has to be unique by entry, and you have several entries for interface index 6. What you can do is to implement a script query to extract this index (6) and get the alias or description using this index and oid .1.3.6.1.2.1.31.1.1.1.18 (ifAlias) or .1.3.6.1.2.1.2.2.1.2 (ifDescription). Of course you have to read the documentation and see some examples to know how to do it.
Regards,
georkings
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Huawei QoS Port Queue Stats Index-based SNMP template

Post by netniV »

As said above, you'll need to switch to using a script server based query due to the need to programmatically adjust what OID you are reading on.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests