qos_get_class_names_every=120
qos_exit_every=3600
+tc_show="qdisc" # can also be "class"
+
# check if we have a valid number for interval
t=${1}
update_every=$((t))
source "${config_dir}/tc-qos-helper.conf"
fi
+case "${tc_show}" in
+ qdisc|class)
+ ;;
+
+ *)
+ error "tc_show variable can be either 'qdisc' or 'class' but is set to '${tc_show}'. Assuming it is 'qdisc'."
+ tc_show="qdisc"
+ ;;
+esac
+
# default sleep function
LOOPSLEEPMS_LASTWORK=0
loopsleepms() {
fix_names=
setclassname() {
- echo "SETCLASSNAME $3 $2"
+ if [ "${tc_show}" = "qdisc" ]
+ then
+ echo "SETCLASSNAME $4 $2"
+ else
+ echo "SETCLASSNAME $3 $2"
+ fi
}
show_tc_cls() {
+ [ "${tc_show}" = "qdisc" ] && return 1
+
local x="${1}"
if [ -f /etc/iproute2/tc_cls ]
echo "BEGIN ${x}"
# netdata can parse the output of tc
- ${tc} -s class show dev ${x}
- ${tc} -s qdisc show dev ${x}
+ ${tc} -s ${tc_show} show dev ${x}
# check FireQOS names for classes
if [ ! -z "${fix_names}" ]