LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Graphing Linux QoS - TC command (https://www.linuxquestions.org/questions/linux-server-73/graphing-linux-qos-tc-command-932823/)

Cheerz 03-05-2012 08:58 AM

Graphing Linux QoS - TC command
 
Hi All

I was wondering if anyone can assist me with the issue I am experiencing.

I have a Centos 6.2 box that is used a traffic shaping/ Qos server. Currently everything is set up and working like a charm. The rate limits etc are in place and by using the command tc -s I can verify the results.

However I need to try and graph the output of the statistics in some way so that we can present this to the guys (non-technical...hence the issue).

Currently we have a dedicated third party WAN monitoring solution in place and was thinking of possibility of using snmp to extract the data from the linux box.

Technical Details:
* tc command used to do the shaping
* qdisc / classes is used along with Hierarchical Token Bucket (HTB)
* Centos 6.2 i386 (Using a Test system at the moment)

Any assistance/ guidance would be appreciated.

Thanks

elfenlied 03-06-2012 02:57 AM

What exactly are you looking to graph? I mean you could use a number of tools which read SNMP statistics from your NIC's and graph them over time, is that what you're after?

Cheerz 03-06-2012 03:45 AM

Hi

I am looking to get the shaping statistics from the qdiscs /classes that was set up by the tc command:

Extract from bash script -

U32="$TC filter add dev $IF protocol ip parent 1:0 prio 1 u32"
TC=/sbin/tc
IF=eth1

MAX_RATE=500kbps
DNLD_RATE=40kbps

$TC qdisc add dev $IF root handle 1: htb
$TC class add dev $IF parent 1: classid 1:1 htb rate $MAX_RATE
$TC class add dev $IF parent 1:1 classid 1:10 htb rate $DNLD_RATE
$TC qdisc add dev $IF parent 1:10 handle 10: sfq perturb 10
$U32 match ip dst $IP/32 flowid 1:10

Using the above and starting a download from the IP address, I can see that the shaping is working.

The data that I want to extract using SNMP is that of the output below:

$TC -s class ls dev $IF

Using the normal SNMP MIBS I can get the statistics on the network interface, but not the detailed statistics on the shaping.

elfenlied 03-06-2012 04:40 AM

Have you looked at Cacti? By the looks of it you know what information you want to view over time and with Cacti you should be able to write a script as data source which will output a meaningful value which you can plot over a period of time.

I've created a Cacti graph for a couple of temperature sensors I have which essentially are plotting the output of a script I wrote which reads the sensor and gives me a value (ie 27.1), I then use that to put a line on a graph. You could do something similar for each of the counters you want to keep track of.

Cheerz 03-06-2012 06:40 AM

I did look at Cacti, however I need to get the data out using SNMP before I can set up a graph in Cacti.

At the moment I am stuck at getting the SNMP to work.

I'm using the snmp_persist.pl that I found on the Cacti documentation page.

elfenlied 03-06-2012 06:48 AM

Your data doesn't have to come from SNMP, it might be easier in your case just to get the data you are after with a script.

See http://docs.cacti.net/manual:087:3a_..._input_methods


All times are GMT -5. The time now is 01:16 PM.