Juniper COS statistics - help needed

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

Moderators: Developers, Moderators

fratzeskos
Posts: 10
Joined: Fri Sep 21, 2007 1:38 am
Location: GR

Juniper COS statistics - help needed

Post by fratzeskos »

Hi all,
I need a little help here.

I want to graph the jnxCosIfqTxedBytes

The OID for this is: 1.3.6.1.4.1.2636.3.15.1.1.9

If I walk this OID from CLI, I get back four results for each interface.


1: jnxCosIfqTxedBytes.22.11.98.101.115.116.45.101.102.102.111.114.116 (counter64) 154575730545
2: jnxCosIfqTxedBytes.22.15.110.101.116.119.111.114.107.45.99.111.110.116.114.111.108 (counter64) 16873826042
3: jnxCosIfqTxedBytes.22.18.97.115.115.117.114.101.100.45.102.111.114.119.97.114.100.105.110.103 (counter64) 0
4: jnxCosIfqTxedBytes.22.20.101.120.112.101.100.105.116.101.100.45.102.111.114.119.97.114.100.105.110.103 (counter64) 0


I want to make a data query that I can add in every router from the devices menu.

That data query has to print me back all the interfaces of the router (as if I was polling the main OID: 1.3.6.1.4.1.2636.3.15.1.1.9), I want then to be able to select the interfaces I need and graph the four results in one graph.

The hard part for me is to make the .XML file that will do the main job. Can someone give me directions for that?

Sorry for my bad English. If you need more info please ask.
fratzeskos
Posts: 10
Joined: Fri Sep 21, 2007 1:38 am
Location: GR

Post by fratzeskos »

Here is the XML file with the snmpwalk information and the XML from the graph template..
i must be missing lot of things!
i dont know if anyone can help.
Attachments
cacti_graph_template_juniper_cos.xml
(20.73 KiB) Downloaded 1774 times
juniper_COS.xml
(843 Bytes) Downloaded 1672 times
Tybio
Cacti User
Posts: 80
Joined: Thu Feb 16, 2006 8:14 am

Post by Tybio »

Ok, few bits of advice when working with Junipers. Be VERY SURE that you have the MIB being loaded....those strings represent the "Names" of the COS levels...here is what mine look like:

JUNIPER-COS-MIB::jnxCosIfqTxedBytes.101."best-effort" = Counter64: 1764626886793836
JUNIPER-COS-MIB::jnxCosIfqTxedBytes.101."network-control" = Counter64: 2616771586866
JUNIPER-COS-MIB::jnxCosIfqTxedBytes.101."assured-forwarding" = Counter64: 0
JUNIPER-COS-MIB::jnxCosIfqTxedBytes.101."expedited-forwarding" = Counter64: 0

My guess is that "101" is the ifIndex, but I don't have time to dig for that right now ;). So, that means that your "Index" for the snmp walk is everything after 1.3.6.1.4.1.2636.3.15.1.1.9 is the index. Let me do some walking and see what I come up with.
Tybio
Cacti User
Posts: 80
Joined: Thu Feb 16, 2006 8:14 am

Post by Tybio »

Yep, ok..here is an example XML for Juniper routers for something similar. This one returns the MPLS LSP Names and lets you graph inOctets and RSVP Reservation. But if you look at the top for the index lines you will see that it says "Take everything after the 27th character and make it the Index." Which is exactly what you need, just change the base OID and add in the proper Input and Output sections.

Again, I can't stress how vital it is to be sure that php is loading your SNMP MIBs with Juniper routers. You can ask the people around here, I fought for months to get this going and had it correct the /whole/ time. Without the MIB however, Cacti had no idea how to parse the Juniper MIB so it was always failing and returning "HEX" rather then text.
Attachments
Example-Juniper-MIB.xml
(1.32 KiB) Downloaded 1335 times
fratzeskos
Posts: 10
Joined: Fri Sep 21, 2007 1:38 am
Location: GR

Post by fratzeskos »

Hi Tybio,
that will be really useful, i will try it tomorrow though.
Thank you very very much
8)
i will let you know about the results.
mcanales
Posts: 1
Joined: Fri Jan 25, 2008 3:22 pm

Post by mcanales »

Hi,
who work with routers juniper M40 with COS and has deployment the scripts correct for monitoring interfaces with CaCti??

I charge the template cacti_graph_template_juniper_cos.xml and I get the following error:

Error: XML: Hash version does not exist.

my version of cacti is 0.8.6h

Greetings.
Attachments
cacti_graph_template_juniper_cos.xml
(20.73 KiB) Downloaded 1098 times
fratzeskos
Posts: 10
Joined: Fri Sep 21, 2007 1:38 am
Location: GR

Post by fratzeskos »

I am coming back to this because I still haven’t found the solution and it is taking me so much time and resources to make 4 different graphs for each interface.

Lets take things from the begging:.

I want to take COS statistics from juniper routers.
The OID is:
1.3.6.1.4.1.2636.3.15.4.1.9.0

When I poll the router with this OID I get back smth like this:

1: jnxCosQstatTxedBytes.50.0 (counter64) 348422381542486
2: jnxCosQstatTxedBytes.50.1 (counter64) 1044388029519
3: jnxCosQstatTxedBytes.50.2 (counter64) 2209
4: jnxCosQstatTxedBytes.50.3 (counter64) 2701484254
5: jnxCosQstatTxedBytes.51.0 (counter64) 143901361389
6: jnxCosQstatTxedBytes.51.1 (counter64) 106060531305
7: jnxCosQstatTxedBytes.51.2 (counter64) 0
8: jnxCosQstatTxedBytes.51.3 (counter64) 1702559624
9: jnxCosQstatTxedBytes.52.0 (counter64) 320206697206108
10: jnxCosQstatTxedBytes.52.1 (counter64) 1520259812400
11: jnxCosQstatTxedBytes.52.2 (counter64) 1295
12: jnxCosQstatTxedBytes.52.3 (counter64) 90766195
13: jnxCosQstatTxedBytes.53.0 (counter64) 2042613757011
14: jnxCosQstatTxedBytes.53.1 (counter64) 852665693457
15: jnxCosQstatTxedBytes.53.2 (counter64) 16026900664
16: jnxCosQstatTxedBytes.53.3 (counter64) 6191834338
17: jnxCosQstatTxedBytes.54.0 (counter64) 234990
18: jnxCosQstatTxedBytes.54.1 (counter64) 1038802498824
19: jnxCosQstatTxedBytes.54.2 (counter64) 85334
20: jnxCosQstatTxedBytes.54.3 (counter64) 0

50,51,52 etc is the index number of the interface

I want to have in the same graph the four results of each interface.

Each result is explained like this:

BestEffort
1.3.6.1.4.1.2636.3.15.4.1.9.x.0
EF
1.3.6.1.4.1.2636.3.15.4.1.9.x.1
AF
1.3.6.1.4.1.2636.3.15.4.1.9.x.2
NetworkControl
1.3.6.1.4.1.2636.3.15.4.1.9.x.3
Where x is the interface index.


The steps that I follow are:
a) make a data template with four data source items
b) make a graph template for the four data sources.
c) Trying to write the .xml file that will give me back all the info I need

Till now I had no luck with the xml file. I have no idea how to make it work.

So, please give me some hints and ideas.
Thank you all 
Attachments
cos_datatemplate.JPG
cos_datatemplate.JPG (145.79 KiB) Viewed 28952 times
cos_graphtemplate.JPG
cos_graphtemplate.JPG (151.04 KiB) Viewed 28952 times
fratzeskos
Posts: 10
Joined: Fri Sep 21, 2007 1:38 am
Location: GR

Post by fratzeskos »

no ideas ?
:cry:
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Post the verbose query of the xml file you've created, from within Cacti. Does it properly enumerate all the data you're after?
User avatar
johnrembo
Cacti User
Posts: 216
Joined: Mon Apr 24, 2006 3:33 am

Post by johnrembo »

i think cos should be deepley realated to qos.
see the code: http://forums.cacti.net/viewtopic.php?t ... uniper+qos
fratzeskos
Posts: 10
Joined: Fri Sep 21, 2007 1:38 am
Location: GR

Post by fratzeskos »

here is the debug and the .xml file.
Please give me your help in how i can fix the .xml
thanks
Attachments
debug.JPG
debug.JPG (95.86 KiB) Viewed 28744 times
graph_.JPG
graph_.JPG (50.02 KiB) Viewed 28744 times
juniper_COS.xml
(901 Bytes) Downloaded 749 times
hipster
Posts: 30
Joined: Thu Mar 16, 2006 7:54 am

Post by hipster »

Did you ever got this working?
hipster
Posts: 30
Joined: Thu Mar 16, 2006 7:54 am

Post by hipster »

I have managed to create graphs for Cos classes per interface(Hard coded Data query per interface).

E.g.

Graph 1 Ge0 Best Effort:
- jnxCosQstatQedBytes
- jnxCosQstatTxedBytes
- jnxCosQstatTailDropPkts
- jnxCosQstatTotalRedDropPkts

Graph 2 Ge1 Less than Best Effort:
- jnxCosQstatQedBytes
- jnxCosQstatTxedBytes
- jnxCosQstatTailDropPkts
- jnxCosQstatTotalRedDropPkts

Graph 3 Ge2 Penalty class:
- jnxCosQstatQedBytes
- jnxCosQstatTxedBytes
- jnxCosQstatTailDropPkts
- jnxCosQstatTotalRedDropPkts

That works just fine but....

I would like to graph like this:

Graph 1 Ge0 jnxCosQstatTxedBytes:
- Best Effort
- Less than best effort
- Penalty Class

Graph 2 Ge1 jnxCosQstatTxedBytes:
- Best Effort
- Less than best effort
- Penalty Class

Graph 3 Ge3 jnxCosQstatTxedBytes:
- Best Effort
- Less than best effort
- Penalty Class

The problem that I need to solve is...

Code: Select all

OID tree (.9 = jnxCosQstatTxedBytes):

SNMPv2-SMI::enterprises.2636.3.15.4.1.9.<ifIndex>.<CoS Class>

Is it possible to parse MIB as array and use the results to combine results for graph per interface for each CoS Class??? Otherwise I would have to have graphs: (Interface X Cos Class) = 4 X 4 = 16 pcs. My goal is to have only graph per interface = 4 pcs....
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

If there is any SNMP table that includes the indices like you indicated, an SNMP Data Query would be fine. Else, a Script Data Query should fill the gap. Read about both at the first link of my sig (one of the Advanced Chapters)
Reinhard
hipster
Posts: 30
Joined: Thu Mar 16, 2006 7:54 am

Post by hipster »

Hi,

Thank you Gandalf for the great manual. I must be too incompetent to figure out how to do that all.

I was not able to graph as I wanted to: CoS classes per interface.

Instead I hard coded primary interface OIDs and took the easiest way... Now I have graphs for each CoS class. If anyone is interested in XML file. let me know. (pic attached)

Back to the problem itself. I figured that if based graphs require same kind of indexin as the default interface data query:

Code: Select all

<interface>
        <name>Get Juniper Interfaces for CoS Reporting</name>
        <description>Queries a host for a list of monitorable interfaces</description>
        <oid_index>.1.3.6.1.2.1.2.2.1.1</oid_index>
        <oid_num_indexes>.1.3.6.1.2.1.2.1.0</oid_num_indexes>
        <index_order>ifDescr:ifName:ifHwAddr:ifIndex</index_order>
        <index_order_type>numeric</index_order_type>
        <index_title_format>|chosen_order_field|</index_title_format>
After that I tried to figure out how to append OID <oid>.1.3.6.1.4.1.2636.3.15.4.1.9</oid> which should eventually end up been like this:

.1.3.6.1.4.1.2636.3.15.4.1.9.<ifIndex as result from oid_index>.<Cos Class index>

<Cos Class index> could be snmpwalked e.g. from .1.3.6.1.4.1.2636.3.15.3.1.2

is there a way to first use <oid_index> to get ifIdex, them get the cos class index from .1.3.6.1.4.1.2636.3.15.3.1.2 and finally concatenate these for data query?
Attachments
Picture3.png
Picture3.png (59.13 KiB) Viewed 28057 times
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests