I'm trying to get QoS statistics for Alcatel router. The information is in enterprises OID and structure looks like this:
OID: .1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50 includes string names of QoS policies for each interface. Output looks like this:
TIMETRA-PORT-MIB::tmnxPortNetworkEgrQueues.1.35684352 = STRING: "FirstPort"
TIMETRA-PORT-MIB::tmnxPortNetworkEgrQueues.1.35717120 = STRING: "SecondDesription"
TIMETRA-PORT-MIB::tmnxPortNetworkEgrQueues.1.35749888 = STRING: "etc..."
TIMETRA-PORT-MIB::tmnxPortNetworkEgrQueues.1.35782656 = STRING: "default"
TIMETRA-PORT-MIB::tmnxPortNetworkEgrQueues.1.35815424 = STRING: "default"
The 8 digits number is an interface name in Alcatals terminology. Statistics information I'm interested about is in another place,in 2 another OIDs:
OID: .1.3.6.1.4.1.6527.6.2.2.2.2.8.1.3 and 5 - those are: tmnxPortNetEgressQueueStatsFwdOcts and tmnxPortNetEgressQueueStatsDroOcts.
.1.3.6.1.4.1.6527.6.2.2.2.2.8.1.3.1.35684352.1 = Counter64: 12245752311
.1.3.6.1.4.1.6527.6.2.2.2.2.8.1.3.1.35684352.2 = Counter64: 26602232
.1.3.6.1.4.1.6527.6.2.2.2.2.8.1.3.1.35684352.3 = Counter64: 26487683513
.1.3.6.1.4.1.6527.6.2.2.2.2.8.1.3.1.35684352.4 = Counter64: 9587862395
.1.3.6.1.4.1.6527.6.2.2.2.2.8.1.3.1.35684352.5 = Counter64: 0
.1.3.6.1.4.1.6527.6.2.2.2.2.8.1.3.1.35684352.6 = Counter64: 0
.1.3.6.1.4.1.6527.6.2.2.2.2.8.1.3.1.35684352.7 = Counter64: 10756206
.1.3.6.1.4.1.6527.6.2.2.2.2.8.1.3.1.35684352.8 = Counter64: 1520525497
.1.3.6.1.4.1.6527.6.2.2.2.2.8.1.3.1.35717120.1 = Counter64: 0
.1.3.6.1.4.1.6527.6.2.2.2.2.8.1.3.1.35717120.2 = Counter64: 0
So I want to draw 16 graphs for every interface (every interface has 2 types of information in 8 queue counters each).
The thing is I need to template interface scanning as I've got 30+ of those routers and have no real control on interface change . And also on every single router interface names are different. Moreover, QoS policies are tied to physical interfaces, so I can't (probably) rely on IF-MIB as it includes also logical interfaces.
So what I came to is:
* I have to create index basing on different OID than the data,
* after index is appended to quetsioned OID I will get 8 integers.
I've came to the script:
Code: Select all
<interface>
<name>Alcatel QoS Statistics</name>
<description>Queries a host for a list of monitorable queues</description>
<oid_index>.1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50</oid_index>
<oid_num_indexes>.1.3.6.1.2.1.2.1.0</oid_num_indexes>
<oid_index_parse>OID/REGEXP:^.{33}(.*)</oid_index_parse>
<index_order>AlcatelIndex</index_order>
<index_order_type>numeric</index_order_type>
<index_title_format>|chosen_order_field|</index_title_format>
1Q
<fields>
<AlcatelIndex>
<name>Index</name>
<source>index</source>
<direction>input</direction>
</AlcatelIndex>
<ifName>
<name>Name (IF-MIB)</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.2.1.31.1.1.1.1</oid>
</ifName>
<ifFwdOcts>
<name>ifFwdOcts</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.6527.6.2.2.2.2.8.1.3</oid>
</ifFwdOcts>
<ifDroOcts>
<name>ifDroOcts</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.6527.6.2.2.2.2.8.1.5</oid>
</ifDroOcts>
</fields>
</interface>
Code: Select all
+ Running data query [10].
+ Found type = '3' [SNMP Query].
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/Alcatel_7x50-QoS.xml'
+ XML file parsed ok.
+ Executing SNMP get for num of indexes @ '.1.3.6.1.2.1.2.1.0' Index Count: 29
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50' Index Count: 24
+ Index found at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.35684352' value: 'otvp'
+ Index found at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.35717120' value: 'default'
+ Index found at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.35749888' value: 'default'
+ Index found at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.35782656' value: 'default'
+ Index found at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.35815424' value: 'default'
+ Index found at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.35848192' value: 'default'
+ Index found at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.35880960' value: 'default'
+ Index found at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.35913728' value: 'default'
+ Index found at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.35946496' value: 'default'
+ Index found at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.35979264' value: 'default'
+ Index found at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36012032' value: 'default'
+ Index found at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36044800' value: 'default'
+ Index found at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36077568' value: 'default'
+ Index found at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36110336' value: 'default'
+ Index found at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36143104' value: 'default'
+ Index found at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36175872' value: 'default'
+ Index found at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36208640' value: 'default'
+ Index found at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36241408' value: 'default'
+ Index found at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36274176' value: 'default'
+ Index found at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36306944' value: 'default'
+ Index found at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36339712' value: 'default'
+ Index found at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36372480' value: 'default'
+ Index found at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36405248' value: 'default'
+ Index found at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36438016' value: 'default'
+ index_parse at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.35684352' results: '.1.35684352'
+ index_parse at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.35717120' results: '.1.35717120'
+ index_parse at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.35749888' results: '.1.35749888'
+ index_parse at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.35782656' results: '.1.35782656'
+ index_parse at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.35815424' results: '.1.35815424'
+ index_parse at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.35848192' results: '.1.35848192'
+ index_parse at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.35880960' results: '.1.35880960'
+ index_parse at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.35913728' results: '.1.35913728'
+ index_parse at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.35946496' results: '.1.35946496'
+ index_parse at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.35979264' results: '.1.35979264'
+ index_parse at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36012032' results: '.1.36012032'
+ index_parse at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36044800' results: '.1.36044800'
+ index_parse at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36077568' results: '.1.36077568'
+ index_parse at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36110336' results: '.1.36110336'
+ index_parse at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36143104' results: '.1.36143104'
+ index_parse at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36175872' results: '.1.36175872'
+ index_parse at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36208640' results: '.1.36208640'
+ index_parse at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36241408' results: '.1.36241408'
+ index_parse at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36274176' results: '.1.36274176'
+ index_parse at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36306944' results: '.1.36306944'
+ index_parse at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36339712' results: '.1.36339712'
+ index_parse at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36372480' results: '.1.36372480'
+ index_parse at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36405248' results: '.1.36405248'
+ index_parse at OID: '1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50.1.36438016' results: '.1.36438016'
+ Inserting index data for field 'AlcatelIndex' [value='.1.35684352']
+ Inserting index data for field 'AlcatelIndex' [value='.1.35717120']
+ Inserting index data for field 'AlcatelIndex' [value='.1.35749888']
+ Inserting index data for field 'AlcatelIndex' [value='.1.35782656']
+ Inserting index data for field 'AlcatelIndex' [value='.1.35815424']
+ Inserting index data for field 'AlcatelIndex' [value='.1.35848192']
+ Inserting index data for field 'AlcatelIndex' [value='.1.35880960']
+ Inserting index data for field 'AlcatelIndex' [value='.1.35913728']
+ Inserting index data for field 'AlcatelIndex' [value='.1.35946496']
+ Inserting index data for field 'AlcatelIndex' [value='.1.35979264']
+ Inserting index data for field 'AlcatelIndex' [value='.1.36012032']
+ Inserting index data for field 'AlcatelIndex' [value='.1.36044800']
+ Inserting index data for field 'AlcatelIndex' [value='.1.36077568']
+ Inserting index data for field 'AlcatelIndex' [value='.1.36110336']
+ Inserting index data for field 'AlcatelIndex' [value='.1.36143104']
+ Inserting index data for field 'AlcatelIndex' [value='.1.36175872']
+ Inserting index data for field 'AlcatelIndex' [value='.1.36208640']
+ Inserting index data for field 'AlcatelIndex' [value='.1.36241408']
+ Inserting index data for field 'AlcatelIndex' [value='.1.36274176']
+ Inserting index data for field 'AlcatelIndex' [value='.1.36306944']
+ Inserting index data for field 'AlcatelIndex' [value='.1.36339712']
+ Inserting index data for field 'AlcatelIndex' [value='.1.36372480']
+ Inserting index data for field 'AlcatelIndex' [value='.1.36405248']
+ Inserting index data for field 'AlcatelIndex' [value='.1.36438016']
+ Located input field 'ifName' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.31.1.1.1.1'
+ Found item [ifName='system'] index: 1.3.6.1.2.1.31.1.1.1.1.1 [from value]
+ Found item [ifName='zarzadzanie'] index: 1.3.6.1.2.1.31.1.1.1.1.2 [from value]
+ Found item [ifName='rel-LAB1-p1/1/3'] index: 1.3.6.1.2.1.31.1.1.1.1.3 [from value]
+ Found item [ifName='rel-LAB2-p1/1/3'] index: 1.3.6.1.2.1.31.1.1.1.1.4 [from value]
+ Found item [ifName='rel-LAB6-p1/1/2'] index: 1.3.6.1.2.1.31.1.1.1.1.5 [from value]
+ Found item [ifName='1/1/1'] index: 1.3.6.1.2.1.31.1.1.1.1.35684352 [from value]
+ Found item [ifName='1/1/2'] index: 1.3.6.1.2.1.31.1.1.1.1.35717120 [from value]
+ Found item [ifName='1/1/3'] index: 1.3.6.1.2.1.31.1.1.1.1.35749888 [from value]
+ Found item [ifName='1/1/4'] index: 1.3.6.1.2.1.31.1.1.1.1.35782656 [from value]
+ Found item [ifName='1/1/5'] index: 1.3.6.1.2.1.31.1.1.1.1.35815424 [from value]
+ Found item [ifName='1/1/6'] index: 1.3.6.1.2.1.31.1.1.1.1.35848192 [from value]
+ Found item [ifName='1/1/7'] index: 1.3.6.1.2.1.31.1.1.1.1.35880960 [from value]
+ Found item [ifName='1/1/8'] index: 1.3.6.1.2.1.31.1.1.1.1.35913728 [from value]
+ Found item [ifName='1/1/9'] index: 1.3.6.1.2.1.31.1.1.1.1.35946496 [from value]
+ Found item [ifName='1/1/10'] index: 1.3.6.1.2.1.31.1.1.1.1.35979264 [from value]
+ Found item [ifName='1/1/11'] index: 1.3.6.1.2.1.31.1.1.1.1.36012032 [from value]
+ Found item [ifName='1/1/12'] index: 1.3.6.1.2.1.31.1.1.1.1.36044800 [from value]
+ Found item [ifName='1/1/13'] index: 1.3.6.1.2.1.31.1.1.1.1.36077568 [from value]
+ Found item [ifName='1/1/14'] index: 1.3.6.1.2.1.31.1.1.1.1.36110336 [from value]
+ Found item [ifName='1/1/15'] index: 1.3.6.1.2.1.31.1.1.1.1.36143104 [from value]
+ Found item [ifName='1/1/16'] index: 1.3.6.1.2.1.31.1.1.1.1.36175872 [from value]
+ Found item [ifName='1/1/17'] index: 1.3.6.1.2.1.31.1.1.1.1.36208640 [from value]
+ Found item [ifName='1/1/18'] index: 1.3.6.1.2.1.31.1.1.1.1.36241408 [from value]
+ Found item [ifName='1/1/19'] index: 1.3.6.1.2.1.31.1.1.1.1.36274176 [from value]
+ Found item [ifName='1/1/20'] index: 1.3.6.1.2.1.31.1.1.1.1.36306944 [from value]
+ Found item [ifName='1/1/21'] index: 1.3.6.1.2.1.31.1.1.1.1.36339712 [from value]
+ Found item [ifName='1/1/22'] index: 1.3.6.1.2.1.31.1.1.1.1.36372480 [from value]
+ Found item [ifName='1/1/23'] index: 1.3.6.1.2.1.31.1.1.1.1.36405248 [from value]
+ Found item [ifName='1/1/24'] index: 1.3.6.1.2.1.31.1.1.1.1.36438016 [from value]
Now I have no graphs at all created, don't know why yet :-/
edit: Ouch Cacti thinks that I have 2 datasources only, while I wanted 16. So how to adjust .xml file to include <source></source>: OID plus index plus queue number? regex exaple please?
EDIT 2: So to clarify what I need is to graph:
1.3.6.1.4.1.6527.6.2.2.2.2.8.1.3.1.35684352.1-8
1.3.6.1.4.1.6527.6.2.2.2.2.8.1.5.1.35684352.1-8
1.3.6.1.4.1.6527.6.2.2.2.2.8.1.3.1.35717120.1-8
1.3.6.1.4.1.6527.6.2.2.2.2.8.1.5.1.35717120.1-8
etc., where "35684352" part differs on every router (and its my only index).