diff --git a/fsx/control.zaf b/fsx/control.zaf index afe051a..0bd49cd 100644 --- a/fsx/control.zaf +++ b/fsx/control.zaf @@ -16,7 +16,7 @@ Depends-rpm: curl Depends-bin: curl find # Sudo needed. It will be preconfigured if sudo is installed -Sudo: /usr/bin/find %, {PLUGINDIR}/%sh % +Sudo: find %, {PLUGINDIR}/%sh % # Cron for info about busy directories # This is only example to get disk usage of common /var dirs diff --git a/tcqos/control.zaf b/tcqos/control.zaf new file mode 100644 index 0000000..82872e0 --- /dev/null +++ b/tcqos/control.zaf @@ -0,0 +1,96 @@ + +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 + +# 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: {INCLUDES} 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:: +{INCLUDES} +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 +:: +Script: {INCLUDES} tc qdisc show |cut -d ' ' -f 2,3,5,7 | zaf_discovery '{#TYPE}' '{#ID}' '{#IFACE}' '{#PARENT}' +/Item + +Item qdisc_limit: +Parameters: interface id +Description:: + Show limit of given qdisc handle +:: +Script: {INCLUDES} tc -s qdisc show dev $1 | awk '/qdisc(.*)'$1':/ { print $7 }' | tr -d 'p' +/Item + +Item qdisc_flows: +Parameters: interface id +Description:: + Show flows of given qdisc handle +:: +Script: {INCLUDES} tc -s qdisc show dev $1 | awk '/qdisc(.*)'$1':/ { print $9 }' | tr -d 'p' +/Item + +Item class_sentbytes: +Parameters: interface id +Description:: + Show bytes sent to this class +:: +Script: {INCLUDES} tc -s class show dev $1 | awk '/class(.*)'$2'/ { getline; print $2 }' +/Item + +Item class_sentpackets: +Parameters: interface id +Description:: + Show packets sent to this class +:: +Script: {INCLUDES} tc -s class show dev $1 | awk '/class(.*)'$2'/ { getline; print $4 }' +/Item + +Item class_dropped: +Parameters: interface id +Description:: + Show dropped packets in this class +:: +Script: {INCLUDES} tc -s class show dev $1 | awk '/class(.*)'$2'/ { getline; print $7 }' | tr -d ',' +/Item + +Item class_overlimit: +Parameters: interface id +Description:: + Show overlimit packets in this class +:: +Script: {INCLUDES} tc -s class show dev $1 | awk '/class(.*)'$2'/ { getline; print $9 }' | tr -d ',' +/Item + + diff --git a/tcqos/template.xml b/tcqos/template.xml new file mode 100644 index 0000000..20e3738 --- /dev/null +++ b/tcqos/template.xml @@ -0,0 +1,203 @@ + + + 3.0 + 2016-04-15T09:13:54Z + + + Templates + + + + + + diff --git a/zaf/control.zaf b/zaf/control.zaf index 2f22b16..f351d58 100644 --- a/zaf/control.zaf +++ b/zaf/control.zaf @@ -29,22 +29,22 @@ Item framework_version: Description:: Returns version of zaf installed. :: -# If item is function defined in shared library, use Function: -Function: zaf_version +# If item is Cmd: defined in shared library, use Cmd:: +Cmd:: zaf_version /Item Item plugins: Description:: Returns installed plugins :: -Function: zaf_list_plugins +Cmd:: zaf_list_plugins /Item Item discovery.plugins: Description:: Returns installed plugins in form suitable for zabbix discovery :: -Function: zaf_discovery_plugins +Cmd:: zaf_discovery_plugins /Item Item plugin_version: @@ -52,7 +52,7 @@ Parameters: plugin_name Description:: Returns version of plugin :: -Function: zaf_plugin_version $1 +Cmd:: zaf_plugin_version $1 /Item Item plugin_url: @@ -60,7 +60,7 @@ Parameters: plugin_name Description:: Returns base url of plugin :: -Function: zaf_plugin_url $1 +Cmd:: zaf_plugin_url $1 /Item Item plugin_web: @@ -68,7 +68,7 @@ Parameters: plugin_name Description:: Returns home url of plugin :: -Function: zaf_plugin_web $1 +Cmd:: zaf_plugin_web $1 /Item Item plugin_maintainer: @@ -76,7 +76,7 @@ Parameters: plugin_name Description:: Returns maintainer of plugin :: -Function: zaf_plugin_maintainer $1 +Cmd:: zaf_plugin_maintainer $1 /Item Item plugin_items: @@ -84,7 +84,7 @@ Parameters: plugin_name Description:: Returns items defined in plugin :: -Function: zaf_list_plugin_items $1 +Cmd:: zaf_list_plugin_items $1 /Item Item plugin_template_url: @@ -92,6 +92,6 @@ Parameters: plugin_name Description:: Returns base template url for plugin :: -Function: zaf_plugin_template_url $1 +Cmd:: zaf_plugin_template_url $1 /Item