I wrote a Perl script to poll `tc` for traffic control statistics (just bytes presently) for leaf qdiscs. The information is fed to either RRDTool or Munin[2], depending on what parameter is passed to the script. If the option for a RRD database is used, graphs[3][4] are written to disk for each ten second polling interval. If invoked via Munin[2], it handles graphing and samples at five minute intervals. [1] http://ee-staff.ethz.ch/~oetiker/webtools/rrdtool/ [2] http://www.linpro.no/projects/munin/ [3] http://trekweb.com/~jasonb/images/eth0-24-tc.png [4] http://trekweb.com/~jasonb/images/eth0-1-tc.png The aim is to graphically represent bandwidth utilization for each leaf class to help diagnose issues with misclassification, performance, and for long term profiling. The script is available[5] here. The included README explains basic configuration. [5] http://trekweb.com/~jasonb/code/polltc-1.0.tar.gz I hope someone else finds it useful. Comments welcome. -- Jason Boxman Perl Programmer / *NIX Systems Administrator Shimberg Center for Affordable Housing | University of Florida http://edseek.com/ - Linux and FOSS stuff _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
vicente@vicente.ferrando.name
2004-Oct-27 11:17 UTC
Re: Traffic Control Diagnostic Graphing Utility
Hi Jason, I''m trying your script with munin. But I can''t make it work. Here you have the error I get: munin-run polltc_eth0 Use of uninitialized value in hash element at /etc/munin/plugins/polltc_eth0 line 126. Use of uninitialized value in string eq at /etc/munin/plugins/polltc_eth0 line 159. Use of uninitialized value in string eq at /etc/munin/plugins/polltc_eth0 line 159. Use of uninitialized value in hash element at /etc/munin/plugins/polltc_eth0 line 126. Use of uninitialized value in string eq at /etc/munin/plugins/polltc_eth0 line 159. Use of uninitialized value in string eq at /etc/munin/plugins/polltc_eth0 line 159. Can''t use an undefined value as an ARRAY reference at /etc/munin/plugins/polltc_eth0 line 327. polltc_eth0 is linked to polltc_ as explained in the Readme. And It is modified to point to /sbin/tc. I''m checking polltc_ to see if something else need to be modified. Best regards. Jason Boxman writes:> I wrote a Perl script to poll `tc` for traffic control statistics (just bytes > presently) for leaf qdiscs. The information is fed to either RRDTool or > Munin[2], depending on what parameter is passed to the script. If the option > for a RRD database is used, graphs[3][4] are written to disk for each ten > second polling interval. If invoked via Munin[2], it handles graphing and > samples at five minute intervals. > > [1] http://ee-staff.ethz.ch/~oetiker/webtools/rrdtool/ > [2] http://www.linpro.no/projects/munin/ > [3] http://trekweb.com/~jasonb/images/eth0-24-tc.png > [4] http://trekweb.com/~jasonb/images/eth0-1-tc.png > > The aim is to graphically represent bandwidth utilization for each leaf class > to help diagnose issues with misclassification, performance, and for long > term profiling. > > The script is available[5] here. The included README explains basic > configuration. > > [5] http://trekweb.com/~jasonb/code/polltc-1.0.tar.gz > > I hope someone else finds it useful. > > Comments welcome. > > -- > > Jason Boxman > Perl Programmer / *NIX Systems Administrator > Shimberg Center for Affordable Housing | University of Florida > http://edseek.com/ - Linux and FOSS stuff > > _______________________________________________ > LARTC mailing list / LARTC@mailman.ds9a.nl > http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/_______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
hi Jason, and thx for your perl script. but i can''t do it work. I can''t use perl, so i feel myself an idiot :( the script answer this error: Use of uninitialized value in hash element at polltc_eth1 line 126. Use of uninitialized value in string eq at polltc_eth1 line 159. Use of uninitialized value in string eq at polltc_eth1 line 159. Use of uninitialized value in hash element at polltc_eth1 line 159. Use of uninitialized value in string eq at polltc_eth1 line 159. Use of uninitialized value in string eq at polltc_eth1 line 159. Use of uninitialized value in hash element at polltc_eth1 line 126. Use of uninitialized value in string eq at polltc_eth1 line 159. Use of uninitialized value in string eq at polltc_eth1 line 159. Use of uninitialized value in hash element at polltc_eth1 line 126. Use of uninitialized value in string eq at polltc_eth1 line 159. Use of uninitialized value in string eq at polltc_eth1 line 159. Can''t use an undefined value as an ARRAY reference at polltc_eth1 line 327. the Line 126 is: $stats{ $id } = { the line 159 is: if( $type eq "root" ) { and the line 327 is: if( scalar( @{ $child_hash{ $foo } } ) > 0 ) { TIA, Magin Lopez. _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
hi jason, this is the output: tc -s class show dev eth1 class htb 1:11 parent 1:1 prio 1 rate 40Kbit ceil 110Kbit burst 1650b cburst 1739b Sent 1116054 bytes 6654 pkts (dropped 0, overlimits 0) lended: 6654 borrowed: 0 giants: 0 tokens: 256479 ctokens: 98443 class htb 1:1 root rate 110Kbit ceil 110Kbit burst 1739b cburst 1739b Sent 493178799 bytes 2213090 pkts (dropped 0, overlimits 0) rate 6880bps 30pps lended: 1793498 borrowed: 0 giants: 0 tokens: 97512 ctokens: 97512 class htb 1:10 parent 1:1 prio 0 rate 50Kbit ceil 110Kbit burst 1663b cburst 1739b Sent 140 bytes 2 pkts (dropped 0, overlimits 0) lended: 2 borrowed: 0 giants: 0 tokens: 204799 ctokens: 97512 class htb 1:13 parent 1:1 leaf 130: prio 2 rate 10Kbit ceil 110Kbit burst 1611b cburst 1739b rate 6887bps 30pps lended: 412936 borrowed: 1793498 giants: 0 tokens: -1154560 ctokens: 97512 class htb 1:12 parent 1:1 leaf 120: prio 2 rate 10Kbit ceil 110Kbit burst 1611b cburst 1739b Sent 0 bytes 0 pkts (dropped 0, overlimits 0) lended: 0 borrowed: 0 giants: 0 tokens: 1031680 ctokens: 101235 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- tc -s qdisc show dev eth1 qdisc sfq 130: quantum 1514b perturb 10sec Sent 495698153 bytes 2225223 pkts (dropped 506, overlimits 0) backlog 5p qdisc sfq 120: quantum 1514b perturb 10sec Sent 0 bytes 0 pkts (dropped 0, overlimits 0) qdisc htb 1: r2q 10 default 13 direct_packets_stat 0 Sent 496814347 bytes 2231879 pkts (dropped 506, overlimits 347211) backlog 5p qdisc ingress ffff: ---------------- Sent 1591565024 bytes 8913161 pkts (dropped 0, overlimits 0) =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- That''s all... many thanks for your help. Magin Jason, i tried to send this msg to your private mail account but your server reject me >>> Remote host said: 550 5.7.1 Rejected: 217.127.143.88 listed at list.dsbl.org is my IP in a black list? how can i remove it from this list ? _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/