Problem with SNMP Data Query - Alcatel Router string inface

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

stefanbrudny
Cacti User
Posts: 130
Joined: Thu Jan 19, 2012 11:52 am

Problem with SNMP Data Query - Alcatel Router string inface

Post by stefanbrudny »

Hello,

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>
Index is probably OK (.1.xxxxxxxx I assume is OK):

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]
And here i stuck - how to check if cacti is fine with the xml data? how to instruct cacti which information should be on a graph? Any errors in above thinking?

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).
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Problem with SNMP Data Query - Alcatel Router string inf

Post by gandalf »

Find regexp example at 1st link of my sig, chapter on snmp data queries.
There are also a lot of regexp examples in this forum
R.
stefanbrudny
Cacti User
Posts: 130
Joined: Thu Jan 19, 2012 11:52 am

Re: Problem with SNMP Data Query - Alcatel Router string inf

Post by stefanbrudny »

Helo, thank you very much for the answer.

Unfortunately I need much more than it is written :-) look:

I have snmptable which is very ugly as its for the whole router and not interface. It includes all 8 queues for each interface. Interfaces are recognizable by the middle of the index number. Interfaces cannot be enumerated using if-mib, as this include logical interfaces too, and queues are only for physical links.

To put it simply, I wanted to have index for interface, but I don't know the interface (I use simple regex to enumerat them). So I've used the regex part for interfaces and have nothing to create the index for queues.

Either its time to learn and dive into regular expressions more, or I need something like second regex in <oid></oid> container.

Code: Select all

SNMP table: TIMETRA-PORT-MIB::tmnxPortNetEgressStatsTable

       index tmnxPortNetEgressFwdInProfPkts tmnxPortNetEgressFwdOutProfPkts tmnxPortNetEgressFwdInProfOcts tmnxPortNetEgressFwdOutProfOcts tmnxPortNetEgressDroInProfPkts tmnxPortNetEgressDroOutProfPkts tmnxPortNetEgressDroInProfOcts tmnxPortNetEgressDroOutProfOcts
1.35684352.1                       24107024                               0                    12294353857                               0                              0                               0                              0                               0
1.35684352.2                         289032                               0                       26602232                               0                              0                               0                              0                               0
1.35684352.3                       31373620                               0                    26487683513                               0                              0                               0                              0                               0
1.35684352.4                       15682016                               0                     9587862395                               0                              0                               0                              0                               0
1.35684352.5                              0                               0                              0                               0                              0                               0                              0                               0
1.35684352.6                              0                               0                              0                               0                              0                               0                              0                               0
1.35684352.7                         181116                               0                       17657680                               0                              0                               0                              0                               0
1.35684352.8                       17627282                               0                     1597570769                               0                              0                               0                              0                               0
1.35717120.1 
<-- this is the second interface.

My motivation is to limit the number of graphs - I have ~7820 ports to graph, what is to be multiplied by 8 queues and 4, which is 250240 graphs, if I get this right yet :-)
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Problem with SNMP Data Query - Alcatel Router string inf

Post by gandalf »

stefanbrudny wrote: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?
I'm still confused by all this information. An answer to the quoted question could be the use of oid_suffix option, see http://docs.cacti.net/manual:088:3a_adv ... xml_syntax
R.
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Problem with SNMP Data Query - Alcatel Router string inf

Post by noname »

Maybe its structure is like this:

Code: Select all

Interface  Fwd/Drop       Queue
1/1/1 ---- ifFwdOcts ---- #1
                          #2
                          #3
                          #4
                          #5
                          #6
                          #7
                          #8
           ifDroOcts ---- #1
                          #2
                          #3
                          #4
                          #5
                          #6
                          #7
                          #8

1/1/2 ---- ifFwdOcts ---- #1
                          #2
                          #3
                          ...
Cacti is weak in such multi-dimensional indexes.
XML query can walk against interfaces, but cannot walk against queues simultaneously.

As gandalf said, you can use <oid_suffix> for each queues (1-8) to construct "OID plus index plus queue number".
For example:

Code: Select all

<ifFwdOcts_1>
	<name>ifFwdOcts_1</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>
	<oid_suffix>1</oid_suffix>
</ifFwdOcts_1>

    ....

<ifFwdOcts_8>
	<name>ifFwdOcts_8</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>
	<oid_suffix>8</oid_suffix>
</ifFwdOcts_8>
<ifDroOcts_1>
	<name>ifDroOcts_1</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>
	<oid_suffix>1</oid_suffix>
</ifDroOcts_1>

    ....

<ifDroOcts_8>
	<name>ifDroOcts_8</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>
	<oid_suffix>8</oid_suffix>
</ifDroOcts_8>
qos_test.xml
Sample XML
(4.25 KiB) Downloaded 290 times
* I use <method>get</method> for ifName to exclude unwanted interface
stefanbrudny
Cacti User
Posts: 130
Joined: Thu Jan 19, 2012 11:52 am

Re: Problem with SNMP Data Query - Alcatel Router string inf

Post by stefanbrudny »

Cacti is weak in such multi-dimensional indexes.
XML query can walk against interfaces, but cannot walk against queues simultaneously.
Exactly, but with oid_suffix it can be done somewhat handy but once.
As gandalf said, you can use <oid_suffix> for each queues (1-8) to construct "OID plus index plus queue number".
What a fail :oops: I have read old manual! http://www.cacti.net/downloads/docs/htm ... y_xml.html . Here, no suffix option...

Anyway, I have to check if its way to go, as I need also to substract index in yet another way.

Many thanks!
stefanbrudny
Cacti User
Posts: 130
Joined: Thu Jan 19, 2012 11:52 am

Re: Problem with SNMP Data Query - Alcatel Router string inf

Post by stefanbrudny »

OK,
If I create index with oid suffix, my example index will be shorter by a suffix (.1 - .8) and will look "1.35684352".

So I have immediate question:how to extract part after the dot so I can use it in question for interface name? honestly, some cheating possible as ifName from IF-MIB always end on 1 (so I can ask for .1.3.6.1.2.1.31.1.1.1 + index instead of .1.3.6.1.2.1.31.1.1.1.1) but this doesn work for description of the interface.

Example of my index now is "1.35684352.1":

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.12.2.1.4</oid_index>
        <oid_num_indexes>.1.3.6.1.2.1.2.1.0</oid_num_indexes>
        <oid_index_parse>OID/REGEXP:^.{34}(.*)</oid_index_parse> 
        <index_order>AlcatelIndex</index_order>
        <index_order_type>numeric</index_order_type>
        <index_title_format>|chosen_order_field|</index_title_format>
        <fields>
                <AlcatelIndex>
                        <name>Index</name>
                        <source>index</source>
                        <direction>input</direction>
                </AlcatelIndex>
                <ifName>                                                                                              
                        <name>Name (ho</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.3.1.2.2.12.2.1.4</oid>
                </ifFwdOcts>
                <ifDroOcts>
                        <name>ifDroOcts</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.6527.3.1.2.2.12.2.1.8</oid>
                </ifDroOcts>
        </fields>
</interface>
I will surely change this to oid_suffix and by the cheat extract the interface name, but I'm still waiting for your help how to get the interface description.
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Problem with SNMP Data Query - Alcatel Router string inf

Post by noname »

stefanbrudny wrote:If I create index with oid suffix, my example index will be shorter by a suffix (.1 - . and will look "1.35684352".

So I have immediate question:how to extract part after the dot so I can use it in question for interface name? honestly, some cheating possible as ifName from IF-MIB always end on 1 (so I can ask for .1.3.6.1.2.1.31.1.1.1 + index instead of .1.3.6.1.2.1.31.1.1.1.1) but this doesn work for description of the interface.
<oid_suffix> is not necessary for ifName.
I couldn't fully understand your explanations, but the attached sample XML in my previous post doesn't help?
stefanbrudny
Cacti User
Posts: 130
Joined: Thu Jan 19, 2012 11:52 am

Re: Problem with SNMP Data Query - Alcatel Router string inf

Post by stefanbrudny »

Of course it helps, it gives me all data I want. Of course it doesn't do more than mine approach.

Yes, <oid_suffix> is not necessary for ifName. But I have now index as 1.12312343 and I have to extract interface name from it.

I can't use if-mib, because it includes improper information about logical interfaces (as written above). Thus i need to cut the 1. from the index to get the ifName.

Anyway, my goal now is to get interface names apart from index on the graph.
stefanbrudny
Cacti User
Posts: 130
Joined: Thu Jan 19, 2012 11:52 am

Re: Problem with SNMP Data Query - Alcatel Router string inf

Post by stefanbrudny »

OK, so I have xml as above, but can't get the name of interfaces properly. Any direction how can I proceed (apart from writing my own snmp query 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:^.{36}(.*)</oid_index_parse> 
        <index_order>AlcatelIndex:ifName:ifPolicy</index_order>
        <index_order_type>numeric</index_order_type>
        <index_title_format>|chosen_order_field|</index_title_format>
        <fields>
                <AlcatelIndex>
                        <name>Interface index</name>
                        <source>index</source>
                        <direction>input</direction>
                </AlcatelIndex>
                <ifName>                                                                                              
                        <name>Interface Name</name>                                                                    
                        <method>walk</method>                                                                         
                        <source>value</source>                                                                        
                        <direction>input</direction>                                                                  
                        <oid>.1.3.6.1.2.1.2.2.1.1</oid>
                </ifName>
                <ifPolicy>                                                                                              
                        <name>Policy Name (tied to interface)</name>                                                                    
                        <method>walk</method>                                                                         
                        <source>value</source>                                                                        
                        <direction>input</direction>                                                                  
                        <oid>.1.3.6.1.4.1.6527.3.1.2.2.4.2.1.50</oid>
                </ifPolicy>
                
                <ifFwdOcts_1>
                        <name>ifFwdOcts_1</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.6527.3.1.2.2.12.2.1.4.1</oid>
                        <oid_suffix>1</oid_suffix>
                </ifFwdOcts_1>
                <ifFwdOcts_2>
                        <name>ifFwdOcts_2</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.6527.3.1.2.2.12.2.1.4.1</oid>
                        <oid_suffix>2</oid_suffix>
                </ifFwdOcts_2>
                <ifFwdOcts_3>
                        <name>ifFwdOcts_3</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.6527.3.1.2.2.12.2.1.4.1</oid>
                        <oid_suffix>3</oid_suffix>
                </ifFwdOcts_3>
                <ifFwdOcts_4>
                        <name>ifFwdOcts_4</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.6527.3.1.2.2.12.2.1.4.1</oid>
                        <oid_suffix>4</oid_suffix>
                </ifFwdOcts_4>

                <ifFwdOcts_5>
                        <name>ifFwdOcts_5</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.6527.3.1.2.2.12.2.1.4.1</oid>
                        <oid_suffix>5</oid_suffix>
                </ifFwdOcts_5>
                <ifFwdOcts_6>
                        <name>ifFwdOcts_6</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.6527.3.1.2.2.12.2.1.4.1</oid>
                        <oid_suffix>6</oid_suffix>
                </ifFwdOcts_6>
                <ifFwdOcts_7>
                        <name>ifFwdOcts_7</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.6527.3.1.2.2.12.2.1.4.1</oid>
                        <oid_suffix>7</oid_suffix>
                </ifFwdOcts_7>

                <ifFwdOcts_8>
                        <name>ifFwdOcts_8</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.6527.3.1.2.2.12.2.1.4.1</oid>
                        <oid_suffix>8</oid_suffix>
                </ifFwdOcts_8>
                <ifDroOcts_1>
                        <name>ifDroOcts_1</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.6527.3.1.2.2.12.2.1.8.1</oid>
                        <oid_suffix>1</oid_suffix>
                </ifDroOcts_1>
                <ifDroOcts_2>
                        <name>ifDroOcts_2</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.6527.3.1.2.2.12.2.1.8.1</oid>
                        <oid_suffix>2</oid_suffix>
                </ifDroOcts_2>
                <ifDroOcts_3>
                        <name>ifDroOcts_3</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.6527.3.1.2.2.12.2.1.8.1</oid>
                        <oid_suffix>3</oid_suffix>
                </ifDroOcts_3>
                <ifDroOcts_4>
                        <name>ifDroOcts_4</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.6527.3.1.2.2.12.2.1.8.1</oid>
                        <oid_suffix>4</oid_suffix>
                </ifDroOcts_4>
                <ifDroOcts_5>
                        <name>ifDroOcts_5</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.6527.3.1.2.2.12.2.1.8.1</oid>
                        <oid_suffix>5</oid_suffix>
                </ifDroOcts_5>
                <ifDroOcts_6>
                        <name>ifDroOcts_6</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.6527.3.1.2.2.12.2.1.8.1</oid>
                        <oid_suffix>6</oid_suffix>
                </ifDroOcts_6>
                <ifDroOcts_7>
                        <name>ifDroOcts_7</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.6527.3.1.2.2.12.2.1.8.1</oid>
                        <oid_suffix>7</oid_suffix>
                </ifDroOcts_7>
                <ifDroOcts_8>
                        <name>ifDroOcts_8</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.6527.3.1.2.2.12.2.1.8.1</oid>
                        <oid_suffix>8</oid_suffix>
                </ifDroOcts_8>
        </fields>
</interface>
Attachments
This is what happens when using OIDs from queues for index and if-mib OIDs for ifNames. ifNames are not matched as OID includes logical interfaces.
This is what happens when using OIDs from queues for index and if-mib OIDs for ifNames. ifNames are not matched as OID includes logical interfaces.
alc.png (36.34 KiB) Viewed 8099 times
stefanbrudny
Cacti User
Posts: 130
Joined: Thu Jan 19, 2012 11:52 am

Re: Problem with SNMP Data Query - Alcatel Router string inf

Post by stefanbrudny »

All right, method: walk changed to get solved the issue, but all of the sudden my graphs are not displayed.

Thumbnails are fine, but graphs are missing :-/

Code: Select all

	

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=1327570174 \
--end=1327584574 \
--title='SAS7210M-LAB4 - 1/1/1, 10/100/G - Policy: default' \
--base=1000 \
--height=200 \
--width=800 \
--alt-autoscale-max \
--lower-limit=0 \
COMMENT:"From 2012/01/26 10\:29\:34 To 2012/01/26 14\:29\:34\c" \
COMMENT:"  \n" \
--vertical-label='Octects went through queues' \
--slope-mode \
--font TITLE:10: \
--font AXIS:7: \
--font LEGEND:8: \
--font UNIT:7: \
DEF:a="/var/www/cacti/rra/sas7210m-lab4_fwdqueue2_356.rrd":fwdQueue1:AVERAGE \
DEF:b="/var/www/cacti/rra/sas7210m-lab4_fwdqueue2_356.rrd":fwdQueue2:AVERAGE \
DEF:c="/var/www/cacti/rra/sas7210m-lab4_fwdqueue2_356.rrd":fwdQueue3:AVERAGE \
DEF:d="/var/www/cacti/rra/sas7210m-lab4_fwdqueue2_356.rrd":fwdQueue4:AVERAGE \
DEF:e="/var/www/cacti/rra/sas7210m-lab4_fwdqueue2_356.rrd":fwdQueue4:MAX \
DEF:f="/var/www/cacti/rra/sas7210m-lab4_fwdqueue2_356.rrd":fwdQueue5:AVERAGE \
DEF:g="/var/www/cacti/rra/sas7210m-lab4_fwdqueue2_356.rrd":fwdQueue6:AVERAGE \
DEF:h="/var/www/cacti/rra/sas7210m-lab4_fwdqueue2_356.rrd":fwdQueue7:AVERAGE \
DEF:i="/var/www/cacti/rra/sas7210m-lab4_fwdqueue2_356.rrd":fwdQueue8:AVERAGE \
LINE1:a#00FF00FF:"fwd Queue 1"  \
GPRINT:a:LAST:"Current\:%8.2lf %s"  \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n"  \
LINE1:b#4668E4FF:"fwd Queue 2"  \
GPRINT:b:LAST:"Current\:%8.2lf %s"  \
GPRINT::AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:b:MAX:"Maximum\:%8.2lf %s\n"  \
LINE1:c#000000FF:"fwd Queue 3"  \
GPRINT:c:LAST:"Current\:%8.2lf %s"  \
GPRINT:c:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:c:MAX:"Maximum\:%8.2lf %s\n"  \
LINE1:d#55009DFF:"fwd Queue 4"  \
GPRINT:d:LAST:"Current\:%8.2lf %s"  \
GPRINT:d:AVERAGE:"Average\:%8.2lf %s"  \
COMMENT:"Maximum\:\n"  \
LINE2:f#009F67FF:"fwd Queue 5"  \
GPRINT:f:LAST:"Current\:%8.2lf %s"  \
GPRINT:f:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:f:MAX:"Maximum\:%8.2lf %s\n"  \
LINE3:g#B90054FF:"fwd Queue 6"  \
GPRINT:g:LAST:"Current\:%8.2lf %s"  \
GPRINT:g:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:g:MAX:"Maximum\:%8.2lf %s\n"  \
LINE3:h#AFECEDFF:"fwd Queue 7"  \
GPRINT:h:LAST:"Current\:%8.2lf %s"  \
GPRINT:h:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:h:MAX:"Maximum\:%8.2lf %s\n"  \
LINE1:i#837C04FF:"fwd Queue 8"  \
GPRINT:i:LAST:"Current\:%8.2lf %s"  \
GPRINT:i:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:i:MAX:"Maximum\:%8.2lf %s\n" 
Apache gives me this:

ERROR: Could not parse line 'GPRINT::AVERAGE:Average\:%8.2lf %s'

Edit 2: Damn, Invalid :-) GPRINT in Graph template had no task assigned.
stefanbrudny
Cacti User
Posts: 130
Joined: Thu Jan 19, 2012 11:52 am

Re: Problem with SNMP Data Query - Alcatel Router string inf

Post by stefanbrudny »

Solved :-)

Almost all is fine with above xml and of course I've still fight some issues with the data, but this is outside of Cacti. To summarize it, I would say:
* I should have read proper documentation (oid_suffix!),
* still I had to make some ugly hacks on gathered data so its likely to fail somewhere gere and there,
* Cacti snmp_query is not flexible enought to dance with changing OIDs and If I would have known it will take so much time, I would rather start with a collect script (which is much less flexible than snmp_query itself, but probably faster to implement with such situation).

Thank you guys for great product and help just in time!
franckcalleja
Posts: 3
Joined: Wed Oct 17, 2012 4:57 pm

Re: Problem with SNMP Data Query - Alcatel Router string inf

Post by franckcalleja »

Hi Stefan,

I'm encountering identical problem but with TIMETRA-SAP-MIB.
I'm also using 7750SR7 in SROS 9.0R10.

I'm looking a way to track the traffic in all SAP queues and to gain identificatin of the SAP, I need to concat data coming from several snmp indexed table like : CustObjs, SvcObjs and even SapObjs to be able to point to correct data.

Would it be possible you help me for indexed SNMP xml creation ?

Regards,
Franck
stefanbrudny
Cacti User
Posts: 130
Joined: Thu Jan 19, 2012 11:52 am

Re: Problem with SNMP Data Query - Alcatel Router string inf

Post by stefanbrudny »

Would it be possible you help me for indexed SNMP xml creation ?
Still no expert, even though I learnt a lot along the way :-) open new topic and mail me, I'm busy man, but still have some spare time - sometimes.
alopezdu
Posts: 8
Joined: Tue Mar 26, 2013 2:15 pm

Re: Problem with SNMP Data Query - Alcatel Router string inf

Post by alopezdu »

Hi All,

I'm in charge of several alcatel 7750 nodes and i wanted to graph all the information of each sap.

I'm now graphing the traffic through all the saps ( with the information of the Alcatel sap mib), and i did it using only an snmp data query ( i can attach it if someone else need it ).

As all of you said, the return of almost all the oids is something like:

SNMPv2-SMI::enterprises.6527.3.1.2.4.3.6.1.1.1100002557.1342177307.120 = Counter64: 221
SNMPv2-SMI::enterprises.6527.3.1.2.4.3.6.1.1.1100002601.69238784.831 = Counter64: 22254

the important is:
1100002557.1342177307.120
1100002557 is the service id
1342177307 is the sap encapsulation
120 is the vlan.

there is a way to generate the sap encapsulation value, i can post it but in this case, it's useless, because parsing the result of the snmpwalk with:
<oid_index_parse>OID/REGEXP:^.{33}(.*)</oid_index_parse>

You have all you need to get the sap info.I used the three indexes as one:
1100002557.1342177307.120 ( index (1))
1100002601.69238784.831 (index (2)) and so on.

to get the description:

.1.3.6.1.4.1.6527.3.1.2.4.3.2.1.5
adding: 1100002557.1342177307.120
so, if you walk: .1.3.6.1.4.1.6527.3.1.2.4.3.2.1.5.1100002557.1342177307.120:
You get saps descriptions:
SNMPv2-SMI::enterprises.6527.3.1.2.4.3.2.1.5.1100002557.1342177307.120 = STRING: "BLABLABLA, whatever you entered in the description of the sap, on the node"


I don't need each queue but you could get the traffic per queue using this method and the oid append ( since i suppose you use the same qos profiles in your network...)
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests