mirror of
https://github.com/limosek/zaf-plugins.git
synced 2024-11-01 08:17:19 +01:00
116 lines
2.4 KiB
Plaintext
116 lines
2.4 KiB
Plaintext
|
|
Plugin: tcqos
|
|
Description::
|
|
Plugin which will look and discover linux qos using tc command
|
|
::
|
|
|
|
Version: 0.1
|
|
Url: https://raw.githubusercontent.com/limosek/zaf-plugins/master/tcqos
|
|
Web: https://github.com/limosek/zaf-plugins/
|
|
Maintainer: Lukas Macura <lukas@macura.cz>
|
|
|
|
# Dependencies
|
|
Depends-dpkg: dash curl iproute
|
|
Depens-opkg: busybox curl ip
|
|
Depends-rpm: curl
|
|
Depends-bin: curl tc
|
|
|
|
Item discovery_interfaces:
|
|
Description::
|
|
Discovery of tc enabled interfaces
|
|
::
|
|
Script: tc qdisc show | sed 's/.*dev \([\_a-z0-9\-]*\).*/\1/' | sort | uniq | zaf_discovery '{#IFACE}'
|
|
/Item
|
|
|
|
Item discovery_classes:
|
|
Description::
|
|
Discovery of tc classes
|
|
::
|
|
Script::
|
|
ifs=$(tc qdisc show | sed 's/.*dev \([\_a-z0-9\-]*\).*/\1/' | sort | uniq)
|
|
for i in $ifs; do
|
|
tc class ls dev $i |cut -d ' ' -f 2,3,5 | while read type id parent; do
|
|
echo $i $type $id $parent
|
|
done | zaf_discovery '{#IFACE}' '{#TYPE}' '{#ID}' '{#PARENT}'
|
|
done
|
|
::
|
|
/Item
|
|
|
|
Item discovery_qdiscs:
|
|
Parameters::
|
|
interface '' ''
|
|
::
|
|
Description::
|
|
Discovery of tc qdiscs
|
|
::
|
|
Cmd: tc qdisc show |cut -d ' ' -f 2,3,5,7 | zaf_discovery '{#TYPE}' '{#ID}' '{#IFACE}' '{#PARENT}'
|
|
/Item
|
|
|
|
Item qdisc_limit:
|
|
Parameters:
|
|
interface '' '' # Interface
|
|
id '' '' # Id
|
|
::
|
|
Description::
|
|
Show limit of given qdisc handle
|
|
::
|
|
Cmd: tc -s qdisc show dev $1 | awk '/qdisc(.*)'$1':/ { print $7 }' | tr -d 'p'
|
|
/Item
|
|
|
|
Item qdisc_flows:
|
|
Parameters:
|
|
interface '' '' # Interface
|
|
id '' '' # Id
|
|
::
|
|
Description::
|
|
Show flows of given qdisc handle
|
|
::
|
|
Cmd: tc -s qdisc show dev $1 | awk '/qdisc(.*)'$1':/ { print $9 }' | tr -d 'p'
|
|
/Item
|
|
|
|
Item class_sentbytes:
|
|
Parameters:
|
|
interface '' '' # Interface
|
|
id '' '' # Id
|
|
::
|
|
Description::
|
|
Show bytes sent to this class
|
|
::
|
|
Cmd: tc -s class show dev $1 | awk '/class(.*)'$2'/ { getline; print $2 }'
|
|
/Item
|
|
|
|
Item class_sentpackets:
|
|
Parameters:
|
|
interface '' '' # Interface
|
|
id '' '' # Id
|
|
::
|
|
Description::
|
|
Show packets sent to this class
|
|
::
|
|
Cmd: tc -s class show dev $1 | awk '/class(.*)'$2'/ { getline; print $4 }'
|
|
/Item
|
|
|
|
Item class_dropped:
|
|
Parameters:
|
|
interface '' '' # Interface
|
|
id '' '' # Id
|
|
::
|
|
Description::
|
|
Show dropped packets in this class
|
|
::
|
|
Cmd: tc -s class show dev $1 | awk '/class(.*)'$2'/ { getline; print $7 }' | tr -d ','
|
|
/Item
|
|
|
|
Item class_overlimit:
|
|
Parameters:
|
|
interface '' '' # Interface
|
|
id '' '' # Id
|
|
::
|
|
Description::
|
|
Show overlimit packets in this class
|
|
::
|
|
Cmd: tc -s class show dev $1 | awk '/class(.*)'$2'/ { getline; print $9 }' | tr -d ','
|
|
/Item
|
|
|
|
|