3 # let netdata know our PID
4 # this is required to kill us when it exits
7 # default sleep function
11 # if found and included, this file overwrites loopsleepms()
12 # with a high resolution timer function for precise looping.
13 . "`dirname $0`/loopsleepms.sh.inc"
15 # check if we have a valid number for interval
17 sleep_time=$(( t + 1 - 1 ))
18 if [ "$sleep_time" -eq 0 ]
27 echo "SETCLASSNAME $3 $2"
35 /sbin/tc -s class show dev $x
37 # check FireQOS names for classes
38 if [ ! -z "$fix_names" -a -f /var/run/fireqos/ifaces/$x ]
40 name="`cat /var/run/fireqos/ifaces/$x`"
41 echo "SETDEVICENAME $name"
44 . /var/run/fireqos/$name.conf
45 for n in $interface_classes_monitor
47 setclassname `echo $n | tr '|' ' '`
50 echo "SETDEVICEGROUP $interface_dev"
56 cat /proc/net/dev | grep ":" | cut -d ':' -f 1 | while read dev
58 l=`/sbin/tc class show dev $dev | wc -l`
59 [ $l -ne 0 ] && echo $dev
63 # update devices and class names
64 # once every 2 minutes
65 names_every=$((120 / sleep_time))
67 # exit this script every hour
68 # it will be restarted automatically
69 exit_after=$((3600 / sleep_time))
79 if [ $c -le 1 -o $c -ge $names_every ]
83 devices="`all_devices`"
91 [ $gc -gt $exit_after ] && exit 0
93 loopsleepms $sleep_time