Juniper COS statistics - help needed

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

Moderators: Developers, Moderators

User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

hipster wrote: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?
Not possible using pure SNMP approach. This would at least required a full featured Script Data Query with the logic to concatenate data as required. From a short glance, I'm not able to figure out if this would be doable, but it would be the only approach known to me
Reinhard
hipster
Posts: 30
Joined: Thu Mar 16, 2006 7:54 am

Post by hipster »

Thanks. Maybe I'll write a sript them.

Cheers,

hipster
chispuelo
Posts: 5
Joined: Fri Mar 14, 2008 10:04 am

4 graph --> same interface

Post by chispuelo »

Hello HIPSTER, i have a similar problem with a cisco router... im still looking the way to put 7 Class (qos) with the same interface, did you find something?
Thks
Chispol

hipster wrote: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?
chispuelo
Posts: 5
Joined: Fri Mar 14, 2008 10:04 am

4 class ---> same interface

Post by chispuelo »

Hello HIPSTER, i have a similar problem with a cisco router... im still looking the way to put 7 Class (qos) in the same interface, did you find something?
Thks
Chispol
farukbostanci
Posts: 17
Joined: Mon Sep 08, 2008 2:32 am

Post by farukbostanci »

gandalf wrote:
hipster wrote: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?
Not possible using pure SNMP approach. This would at least required a full featured Script Data Query with the logic to concatenate data as required. From a short glance, I'm not able to figure out if this would be doable, but it would be the only approach known to me
Reinhard

Hi Gandalf,

You sad you were'nt able to do a full featured Script Data Query for Juniper COS long time ago.

I need this information as soon as possible. But i cant figure out how to do this.

Can you help me ?

all i need is to monitoring Best Effort, Assured Forwarding, Network Controller,Expedited Forwarding queues as individual.

we have two different OID that represent same queues value ;

1.3.6.1.4.1.2636.3.15.4.1.10

output example ;

> show snmp mib walk 1.3.6.1.4.1.2636.3.15.4.1.10
jnxCosQstatTxedByteRate.22.0 = 35826315
jnxCosQstatTxedByteRate.22.1 = 1142717
jnxCosQstatTxedByteRate.22.2 = 99099
jnxCosQstatTxedByteRate.22.3 = 17137

1.3.6.1.4.1.2636.3.15.1.1.10

output example ;

jnxCosIfqTxedByteRate.22.11.98.101.115.116.45.101.102.102.111.114.116 = 32865464
jnxCosIfqTxedByteRate.22.15.110.101.116.119.111.114.107.45.99.111.110.116.114.111.108 = 13314
jnxCosIfqTxedByteRate.22.18.97.115.115.117.114.101.100.45.102.111.114.119.97.114.100.105.110.103 = 70565
jnxCosIfqTxedByteRate.22.20.101.120.112.101.100.105.116.101.100.45.102.111.114.119.97.114.100.105.110.103 = 1110951


Is there anybody who can accomplish this job ?
hipster
Posts: 30
Joined: Thu Mar 16, 2006 7:54 am

Post by hipster »

Hi,

I got tired of creating static graphs for juniper's cos queues.

Thanks for wonderfull manual and how-to's. I copied php script from the example got things working except graphs itself. What I have done this far:
- xml: index = ifindex and there is element for each cos class queued and dropped. dropped is reddrop + taildrop.
- php script
- data and graph templates + collection methods

For some reason graphs are empty.Poller log looks ok:
12/21/2009 05:17:15 PM - CMDPHP: Poller[0] Host[18] DS[1752] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXX 2 161 500 "" "" get queued.0 119, output: 119!0
12/21/2009 05:17:12 PM - CMDPHP: Poller[0] Host[18] DS[1753] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXX 2 161 500 "" "" get queued.0 120, output: 120!378081
12/21/2009 05:17:09 PM - CMDPHP: Poller[0] Host[18] DS[1751] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXX 2 161 500 "" "" get queued.0 118, output: 118!1622364065
12/21/2009 05:17:07 PM - CMDPHP: Poller[0] Host[18] DS[1750] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXX 2 161 500 "" "" get queued.0 117, output: 117!1308050398
12/21/2009 05:12:09 PM - CMDPHP: Poller[0] Host[18] DS[1752] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXX 2 161 500 "" "" get queued.0 119, output: 119!0
12/21/2009 05:12:06 PM - CMDPHP: Poller[0] Host[18] DS[1753] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXX 2 161 500 "" "" get queued.0 120, output: 120!378020
12/21/2009 05:12:03 PM - CMDPHP: Poller[0] Host[18] DS[1751] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXX 2 161 500 "" "" get queued.0 118, output: 118!1620513546
12/21/2009 05:12:01 PM - CMDPHP: Poller[0] Host[18] DS[1750] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXX 2 161 500 "" "" get queued.0 117, output: 117!1306977095
12/21/2009 05:07:09 PM - CMDPHP: Poller[0] Host[18] DS[1752] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXX 2 161 500 "" "" get queued.0 119, output: 119!0
12/21/2009 05:07:07 PM - CMDPHP: Poller[0] Host[18] DS[1753] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXX 2 161 500 "" "" get queued.0 120, output: 120!377965
12/21/2009 05:07:04 PM - CMDPHP: Poller[0] Host[18] DS[1751] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXX 2 161 500 "" "" get queued.0 118, output: 118!1618480688
12/21/2009 05:07:02 PM - CMDPHP: Poller[0] Host[18] DS[1750] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXX 2 161 500 "" "" get queued.0 117, output: 117!1305933612
12/21/2009 05:02:15 PM - CMDPHP: Poller[0] Host[18] DS[1752] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXX 2 161 500 "" "" get queued.0 119, output: 119!0
12/21/2009 05:02:13 PM - CMDPHP: Poller[0] Host[18] DS[1753] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXX 2 161 500 "" "" get queued.0 120, output: 120!377908
12/21/2009 05:02:09 PM - CMDPHP: Poller[0] Host[18] DS[1751] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXX 2 161 500 "" "" get queued.0 118, output: 118!1616369746
12/21/2009 05:02:08 PM - CMDPHP: Poller[0] Host[18] DS[1750] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXX 2 161 500 "" "" get queued.0 117, output: 117!1305057265
12/21/2009 04:57:14 PM - CMDPHP: Poller[0] Host[18] DS[1752] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXX 2 161 500 "" "" get queued.0 119, output: 119!0
12/21/2009 04:57:12 PM - CMDPHP: Poller[0] Host[18] DS[1753] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXX 2 161 500 "" "" get queued.0 120, output: 120!377841
12/21/2009 04:57:09 PM - CMDPHP: Poller[0] Host[18] DS[1751] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXX 2 161 500 "" "" get queued.0 118, output: 118!1613951234
12/21/2009 04:57:07 PM - CMDPHP: Poller[0] Host[18] DS[1750] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXX 2 161 500 "" "" get queued.0 117, output: 117!1304115385
"!" is delimeter in xml-file:
<output_delimeter>!</output_delimeter>
Could anyone help me?
Attachments
cacti-log.txt
(2.03 KiB) Downloaded 355 times
command-line-output.txt
(1.23 KiB) Downloaded 386 times
xml-output.txt
(11.53 KiB) Downloaded 384 times
Picture2.png
Picture2.png (92.76 KiB) Viewed 8634 times
hipster
Posts: 30
Joined: Thu Mar 16, 2006 7:54 am

Post by hipster »

WHat does this log entry mean?
12/21/2009 06:00:01 PM - POLLER: Poller[0] WARNING: Poller Output Table not Empty. Issues Found: 80, Data Sources: dropped_q_0(DS[1754]), dropped_q_1(DS[1754]), dropped_q_2(DS[1754]), dropped_q_3(DS[1754]), dropped_q_4(DS[1754]), queued_q_0(DS[1754]), queued_q_1(DS[1754]), queued_q_2(DS[1754]), queued_q_3(DS[1754]), queued_q_4(DS[1754]), dropped_q_0(DS[1755]), dropped_q_1(DS[1755]), dropped_q_2(DS[1755]), dropped_q_3(DS[1755]), dropped_q_4(DS[1755]), queued_q_0(DS[1755]), queued_q_1(DS[1755]), queued_q_2(DS[1755]), queued_q_3(DS[1755]), queued_q_4(DS[1755]), dropped_q_0(DS[1756]), Additional Issues Remain. Only showing first 20
hipster
Posts: 30
Joined: Thu Mar 16, 2006 7:54 am

Post by hipster »

Does "U" mean that no data is found from data source?
Data Source Debug

/usr/bin/rrdtool create \
/usr/share/cacti/rra/britney-hel_queued_q_1_1754.rrd \
--step 300 \
DS:queued_q_0:COUNTER:600:0:U \
DS:queued_q_1:COUNTER:600:0:U \
DS:queued_q_3:COUNTER:600:0:U \
DS:queued_q_2:COUNTER:600:0:U \
DS:queued_q_4:COUNTER:600:0:U \
DS:dropped_q_0:COUNTER:600:0:U \
DS:dropped_q_1:COUNTER:600:0:U \
DS:dropped_q_2:COUNTER:600:0:U \
DS:dropped_q_3:COUNTER:600:0:U \
DS:dropped_q_4:COUNTER:600:0:U \
RRA:AVERAGE:0.5:1:500 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:500 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \
when I check the log file it looks like data is collected ok:

12/22/2009 05:02:02 PM - CMDPHP: Poller[0] Host[17] DS[1761] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXXXX 2 161 500 "" "" get queued.2 121, output: 121!140597759
12/22/2009 05:02:01 PM - CMDPHP: Poller[0] Host[17] DS[1761] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXXXX 2 161 500 "" "" get queued.4 121, output: 121!61243975
12/22/2009 05:02:01 PM - CMDPHP: Poller[0] Host[17] DS[1761] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXXXX 2 161 500 "" "" get queued.3 121, output: 121!19626203
12/22/2009 05:02:01 PM - CMDPHP: Poller[0] Host[17] DS[1761] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXXXX 2 161 500 "" "" get queued.0 121, output: 121!2472608205
12/22/2009 05:02:00 PM - CMDPHP: Poller[0] Host[17] DS[1761] CMD: /usr/bin/php -q /usr/share/cacti/scripts/query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXXXXXX 2 161 500 "" "" get queued.1 121, output: 121!1627505284
What could fail? is output syntax "121!1627505284" ok?

How strict is this "The output is not followed by a “newline”! " rule mentioned script data walkthrough?

http://docs.cacti.net/manual:087:3a_adv ... alkthrough
hipster
Posts: 30
Joined: Thu Mar 16, 2006 7:54 am

Post by hipster »

Found it!

get <function> <index> had wrong output:
/usr/share/cacti/scripts# php -q query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXX 1 161 500 "" "" get dropped.0 121
121!175169
Which should be
/usr/share/cacti/scripts# php -q query_juniper_if_cos.php 10.aaa.bbb.ccc XXXXXXXXXX 1 161 500 "" "" get dropped.0 121
175169
no it works.
hassanhija
Posts: 14
Joined: Wed Nov 26, 2008 3:58 am

Post by hassanhija »

Could You explain the case more for us??
What is the template you use ??and the script???
hipster
Posts: 30
Joined: Thu Mar 16, 2006 7:54 am

Post by hipster »

here are the screenshot, xml and php script.

The script started to work for me. It graphs 4 queues (BE=Best effort, LBE=Less than best effort etc.) dropped and queud pps.
Attachments
screensht.jpg
screensht.jpg (37.55 KiB) Viewed 7935 times
query_juniper_if_cos_php.txt
php.
(9.2 KiB) Downloaded 737 times
juniper-cos-interfaces.xml
xml
(5.84 KiB) Downloaded 902 times
sparrow
Posts: 1
Joined: Fri Jul 02, 2010 6:56 am

Post by sparrow »

Hi Hipster

I am using your script for monitoring junos cos
but i got this error when i tried to create the graph.

----
Notice: Undefined index: sgg_27 in /var/www/cacti/graphs_new.php on line 71

Notice: Undefined index: local_data_id in /var/www/cacti/graphs_new.php on line 214

Warning: Invalid argument supplied for foreach() in /var/www/cacti/graphs_new.php on line 214

Warning: Cannot modify header information - headers already sent by (output started at /var/www/cacti/graphs_new.php:71) in /var/www/cacti/graphs_new.php on line 330
---

i guess this related to the php script for cos query.
Thank you for your help.
Lazybones
Posts: 40
Joined: Wed Aug 23, 2006 9:47 am

Post by Lazybones »

Did anyone ever create something more complete with this? I am not exactly a cacti expert so grabbing the bits and pieces from this thread is a little confusing.
dkarpekin
Posts: 5
Joined: Fri Jan 14, 2011 4:16 pm

Re: Juniper COS statistics - help needed

Post by dkarpekin »

Hi all.
Can someone pinpoint me where I can get CPU/Memory template for Juniper MX960/320 ?
Or how difficult it cand be building yourself, as describe here
http://forums.cacti.net/viewtopic.php?t ... ht=juniper
hri_
Posts: 9
Joined: Mon Mar 30, 2009 4:19 pm

Re: Juniper COS statistics - help needed

Post by hri_ »

Can someone explain how we can use this template to collect any cos data?
Cacti usage: 98k DS !
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests