Linux TC QoS Queue Discipline Stats template

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

Moderators: Developers, Moderators

User avatar
Setarcos
Cacti User
Posts: 143
Joined: Mon Dec 13, 2004 2:55 pm
Location: San Jose, CA
Contact:

Post by Setarcos »

saaremaa wrote: No errors in the Cacti log write :-?
I manually created the rrd, but graphs are empty. rrd not receive data: (
I did not find the instructions on how to create graphics QOS.
Can you post screen shots of your data sources for this graph and the "Create Graphs for this Host" screen for the host?
User avatar
Setarcos
Cacti User
Posts: 143
Joined: Mon Dec 13, 2004 2:55 pm
Location: San Jose, CA
Contact:

Post by Setarcos »

saaremaa wrote:
Do you see any poller errors related to these queries file?
No errors in the Cacti log write :-?
I manually created the rrd, but graphs are empty. rrd not receive data: (
I did not find the instructions on how to create graphics QOS.
Per your PM: It appears your system isn't creating the data sources when generating the graphs for the host, and doesn't preserve the index values when attempting to do so for some reason. I see one discrepancy between your verbose query results and my own that might account for this. Can you post the version of snmp_persist.pl you have in /usr/local/sbin/snmp_persist.pl, and your version of linux_qos.xml?
User avatar
saaremaa
Posts: 7
Joined: Thu Nov 13, 2008 4:37 am
Location: Russia, Kaliningrad

Post by saaremaa »

I installed linux_qos.xml and snmp_persist.pl of Linux-QoS.zip (http://forums.cacti.net/download.php?id=14980)

Today I replaced snmp_persist.pl latest available files snmp_persist.pl(http://forums.cacti.net/download.php?id=15250) file and restarted snmpd.

My current linux_qos.xml and snmp_persist.pl
Attachments
linux_qos.xml
(1.95 KiB) Downloaded 488 times
snmp_persist.pl
(7.9 KiB) Downloaded 504 times
Ubuntu Server 9.04, NET-SNMP 5.4.1 , Cacti 0.8.7d+official patches , Kernel 2.6.28-11-server on i686 PHP 5.2.6-3ubuntu4.1 with Suhosin-Patch 0.9.6.2 Perl v5.10.0 built for i486-linux-gnu-thread-multi
User avatar
Setarcos
Cacti User
Posts: 143
Joined: Mon Dec 13, 2004 2:55 pm
Location: San Jose, CA
Contact:

Post by Setarcos »

saaremaa wrote: Today I replaced snmp_persist.pl latest available files snmp_persist.pl(http://forums.cacti.net/download.php?id=15250) file and restarted snmpd.
Please be sure to set $debug = 0, or snmpd won't know what to do with the debugging output.

I'm still digging, but haven't found anything noticeably out of place that would cause this yet.
User avatar
saaremaa
Posts: 7
Joined: Thu Nov 13, 2008 4:37 am
Location: Russia, Kaliningrad

Post by saaremaa »

Setarcos wrote:I'm still digging, but haven't found anything noticeably out of place that would cause this yet.

You have found a fix?
Ubuntu Server 9.04, NET-SNMP 5.4.1 , Cacti 0.8.7d+official patches , Kernel 2.6.28-11-server on i686 PHP 5.2.6-3ubuntu4.1 with Suhosin-Patch 0.9.6.2 Perl v5.10.0 built for i486-linux-gnu-thread-multi
User avatar
Setarcos
Cacti User
Posts: 143
Joined: Mon Dec 13, 2004 2:55 pm
Location: San Jose, CA
Contact:

Post by Setarcos »

saaremaa wrote:
Setarcos wrote:I'm still digging, but haven't found anything noticeably out of place that would cause this yet.

You have found a fix?
Sorry, I have not. From what I can tell, the data sources should be getting created properly when creating new graphs from the host screen, but they are loosing the indexes.

Does your Cacti install have anything other than the vanilla Cacti 0.8.7d base (e.g. Boost, PIA)? I saw your server do a few weird things while using it, and wondered if this might be related to one of these.
User avatar
saaremaa
Posts: 7
Joined: Thu Nov 13, 2008 4:37 am
Location: Russia, Kaliningrad

Post by saaremaa »

Cacti 0.8.7d only installed + my scripts for Cacti.
My written scripts for Cacti does not use SNMP.
Ubuntu Server 9.04, NET-SNMP 5.4.1 , Cacti 0.8.7d+official patches , Kernel 2.6.28-11-server on i686 PHP 5.2.6-3ubuntu4.1 with Suhosin-Patch 0.9.6.2 Perl v5.10.0 built for i486-linux-gnu-thread-multi
Rob1234291
Posts: 1
Joined: Wed Nov 12, 2008 3:32 pm

Post by Rob1234291 »

Was this ever solved, I'm having a similar issue.
mates007
Posts: 3
Joined: Sat Aug 16, 2008 5:43 am

Script freezes

Post by mates007 »

I installed snmp-persist.pl and snmp-persist-test.pl on my debian etch router/firewall.

When running the script, it freezes after printing found NICs.

Code: Select all

sudo -u snmp /usr/local/bin/snmp_persist-test.pl
Found NIC=lo
Found NIC=eth0
Found NIC=eth1
Found NIC=eth2
Found NIC=wifi0
Found NIC=wlan0
Found NIC=tun0
Found NIC=tun1
Found NIC=tap0
Found NIC=sit0
Found NIC=sixxs
Found NIC=tap1
Found NIC=tun2
I have to ctrl+c after several minutes.

Code: Select all

# uname -a
Linux cz-br-axmanova 2.6.24-etchnhalf.1-486 #1 Fri Dec 26 03:27:37 UTC 2008 i586 GNU/Linux

# snmpd --version
NET-SNMP version:  5.2.3

# /sbin/tc -s -d qdisc show dev eth0
qdisc htb 1: root r2q 10 default 12 direct_packets_stat 0 ver 3.17
 Sent 44342253033 bytes 101597199 pkt (dropped 7961, overlimits 23190703 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 11: parent 1:11 limit 127p quantum 1514b flows 127/1024 perturb 10sec
 Sent 2267912151 bytes 37939489 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 12: parent 1:12 limit 127p quantum 1514b flows 127/1024 perturb 10sec
 Sent 5452805520 bytes 27601476 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 13: parent 1:13 limit 127p quantum 1514b flows 127/1024 perturb 10sec
 Sent 36621535362 bytes 36056234 pkt (dropped 7961, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
I didn't put it intosnmpd.conf yet, as the script doesn't work. What could be a problem?
BareMetal
Posts: 5
Joined: Tue Mar 22, 2011 11:40 am

Re:

Post by BareMetal »

Rob1234291 wrote:Was this ever solved, I'm having a similar issue.
This would be a long shot, but did anyone ever solve this?
sergserg
Posts: 1
Joined: Wed Mar 23, 2011 9:01 am
Location: Poland

Re: Linux TC QoS Queue Discipline Stats template

Post by sergserg »

OK, I found it. Index value must be unique, so with this same classid on different interfaces going to problem.
I made basic patch, adding interface name to index value:

Code: Select all

--- snmp_persist.pl.orig        2011-03-23 14:50:47.000000000 +0100
+++ snmp_persist.pl     2011-03-23 14:52:02.000000000 +0100
@@ -133,6 +133,7 @@
                        if ($line =~ /^\s*qdisc/) {
                                #($number) = $line =~ /\s+([A-Za-z0-9]+):\s+/o;
                                ($number) = $line =~ /qdisc\s+(.*):\s+/o;
+                               $number = "$interface $number";
                        }

                        # Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
@@ -173,7 +174,7 @@

                        #print "$line\n\n";
                        if ($line =~ /\s+(([A-Za-z0-9]+:)[A-Za-z0-9]+)\s+root/o) {
-                               $number = $1;
+                               $number = "$interface $1";
                                $numberSnmp++;

                                $qos{"3.$interfaceNumSnmp.1.$numberSnmp"} = [ "string", $number ];
BareMetal
Posts: 5
Joined: Tue Mar 22, 2011 11:40 am

Re: Linux TC QoS Queue Discipline Stats template

Post by BareMetal »

Thanks for the response, sorry it has taken me this long to get back. It still does not create graphs, but I run the command from the data source debug output it creates the graph but does not put any data into it.
sles
Posts: 6
Joined: Tue Oct 06, 2009 12:45 am

Re: Linux TC QoS Queue Discipline Stats template

Post by sles »

sergserg wrote:OK, I found it.
Hello!

Unfortunately, this patch even can't be applied:


[root@p100-vpn-x cacti]# patch -p0 <snmp-persist.patch
patching file snmp_persist.pl
Hunk #1 FAILED at 133.
Hunk #2 FAILED at 174.

But I found right places and still have the same problem as before patch:

[root@p100-vpn-x cacti]# ./snmp_persist-test.pl
Found NIC=lo
Found NIC=eth0
Found NIC=eth1
Found NIC=sit0
Found NIC=gre0
Found NIC=gre1
Found NIC=eth0
Found NIC=eth0


This is CentOS 5.6 and I have vlan interfaces- eth 0.6 and eth0.29, looks like these are last two eth0, but they are not reconised correctly.
May be somebody already fixed this?

Thank you!
sles
Posts: 6
Joined: Tue Oct 06, 2009 12:45 am

Re: Linux TC QoS Queue Discipline Stats template

Post by sles »

OK, really I have htb only on gre1, so I created following quick hack, so only htb interfaces are listed:

sub nics() {
my @niclist = `$ipcmd link show`;
my (@nic, $line, $lilnic);
foreach $line (@niclist) {
# ($lilnic) = $line =~ /^[0-9]+:\s+([a-z0-9]+)/ or next;
if ( index($line, "qdisc htb") > -1 ) {
($lilnic) = $line =~ /^[0-9]+:\s+([a-z0-9]+)/ or next;
print "Found NIC=$lilnic\n" if $debug;
# print "Found NIC=$line\n" if $debug;
push(@nic, $lilnic);
}
}
return(@nic);
}


It works :-)
carlosbrolo
Posts: 1
Joined: Thu Oct 13, 2011 3:44 pm

Re: Linux TC QoS Queue Discipline Stats template

Post by carlosbrolo »

Can I have help?

Currently I managed the script to work, but is only reporting "HTB 1" traffic not the classes inside it.
I mean, on Cacti I only see eth0 as interface name, and htb1 as qdisc name..... No tc classes to graph.

System: Ubuntu 9.10

My TC structure was made using:

Code: Select all

tc qdisc add dev eth0 root handle 1: htb default 50

tc class add dev eth0 parent 1: classid 1:1 htb rate 5500kbit prio 1
tc class add dev eth0 parent 1: classid 1:2 htb rate 500kbit prio 2
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 2558kbit ceil 5000kbit prio 1
tc class add dev eth0 parent 1:1 classid 1:40 htb rate 2558kbit ceil 5000kbit prio 2
tc class add dev eth0 parent 1:1 classid 1:60 htb rate 128kbit ceil 512kbit prio 5
tc class add dev eth0 parent 1:1 classid 1:20 htb rate 128kbit ceil 512kbit prio 5
tc class add dev eth0 parent 1:1 classid 1:21 htb rate 128kbit ceil 512kbit prio 4
#--------------------------------------------------------------------------------------
tc class add dev eth0 parent 1:2 classid 1:70 htb rate 416kbit ceil 500kbit prio 3
tc class add dev eth0 parent 1:2 classid 1:80 htb rate 64kbit ceil 90kbit prio 6
tc class add dev eth0 parent 1:2 classid 1:90 htb rate 20kbit ceil 30kbit prio 6

Code: Select all

[b]root@campus:~# tc -s -d class show dev eth0[/b]
class htb 1:10 parent 1:1 prio 1 quantum 31975 rate 2558Kbit ceil 5000Kbit burst 1599b/8 mpu 0b overhead 0b cburst 1600b/8 mpu 0b overhead 0b level 0 
 Sent 667601766 bytes 714098 pkt (dropped 0, overlimits 0 requeues 0) 
 rate 151128bit 21pps backlog 0b 0p requeues 0 
 lended: 446519 borrowed: 81587 giants: 0
 tokens: 75437 ctokens: 38610

class htb 1:1 root rate 5500Kbit ceil 5500Kbit burst 1599b/8 mpu 0b overhead 0b cburst 1599b/8 mpu 0b overhead 0b level 7 
 Sent 5699650417 bytes 4863074 pkt (dropped 0, overlimits 0 requeues 0) 
 rate 2838Kbit 275pps backlog 0b 0p requeues 0 
 lended: 878085 borrowed: 0 giants: 0
 tokens: -13916 ctokens: -13916

class htb 1:2 root rate 500000bit ceil 500000bit burst 1600b/8 mpu 0b overhead 0b cburst 1600b/8 mpu 0b overhead 0b level 7 
 Sent 919176251 bytes 1117135 pkt (dropped 0, overlimits 0 requeues 0) 
 rate 360992bit 38pps backlog 0b 0p requeues 0 
 lended: 89285 borrowed: 0 giants: 0
 tokens: -1738454 ctokens: -1738454

class htb 1:20 parent 1:1 prio 5 quantum 1600 rate 128000bit ceil 512000bit burst 1600b/8 mpu 0b overhead 0b cburst 1600b/8 mpu 0b overhead 0b level 0 
 Sent 119032745 bytes 83040 pkt (dropped 0, overlimits 0 requeues 0) 
 rate 2680bit 1pps backlog 0b 0p requeues 0 
 lended: 6485 borrowed: 14198 giants: 0
 tokens: 591094 ctokens: 163360

class htb 1:21 parent 1:1 prio 4 quantum 1600 rate 128000bit ceil 512000bit burst 1600b/8 mpu 0b overhead 0b cburst 1600b/8 mpu 0b overhead 0b level 0 
 Sent 151346566 bytes 111409 pkt (dropped 0, overlimits 0 requeues 0) 
 rate 624bit 0pps backlog 0b 0p requeues 0 
 lended: 15776 borrowed: 23420 giants: 0
 tokens: 1054704 ctokens: 263688

class htb 1:40 parent 1:1 prio 2 quantum 31975 rate 2558Kbit ceil 5000Kbit burst 1599b/8 mpu 0b overhead 0b cburst 1600b/8 mpu 0b overhead 0b level 0 
 Sent 3751308725 bytes 3257224 pkt (dropped 0, overlimits 0 requeues 0) 
 rate 2170Kbit 209pps backlog 0b 0p requeues 0 
 lended: 1188008 borrowed: 650757 giants: 0
 tokens: -12051 ctokens: 33813

class htb 1:60 parent 1:1 prio 5 quantum 1600 rate 128000bit ceil 512000bit burst 1600b/8 mpu 0b overhead 0b cburst 1600b/8 mpu 0b overhead 0b level 0 
 Sent 1010411985 bytes 697338 pkt (dropped 0, overlimits 0 requeues 0) 
 rate 509352bit 43pps backlog 0b 5p requeues 0 
 lended: 37369 borrowed: 108123 giants: 0
 tokens: -4948098 ctokens: -1796785

class htb 1:70 parent 1:2 prio 3 quantum 5200 rate 416000bit ceil 500000bit burst 1599b/8 mpu 0b overhead 0b cburst 1600b/8 mpu 0b overhead 0b level 0 
 Sent 828827846 bytes 1055637 pkt (dropped 295, overlimits 0 requeues 0) 
 rate 285864bit 31pps backlog 0b 16p requeues 0 
 lended: 698650 borrowed: 87547 giants: 0
 tokens: -1334058 ctokens: -710000

class htb 1:80 parent 1:2 prio 6 quantum 1000 rate 64000bit ceil 90000bit burst 1600b/8 mpu 0b overhead 0b cburst 1599b/8 mpu 0b overhead 0b level 0 
 Sent 90396136 bytes 61535 pkt (dropped 0, overlimits 0 requeues 0) 
 rate 82600bit 7pps backlog 0b 4p requeues 0 
 lended: 16187 borrowed: 1738 giants: 0
 tokens: -5812417 ctokens: -1911094

class htb 1:90 parent 1:2 prio 6 quantum 1000 rate 20000bit ceil 30000bit burst 1600b/8 mpu 0b overhead 0b cburst 1599b/8 mpu 0b overhead 0b level 0 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 rate 0bit 0pps backlog 0b 0p requeues 0 
 lended: 0 borrowed: 0 giants: 0
 tokens: 10000000 ctokens: 6666656

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest