mirror of
https://github.com/limosek/zaf-plugins.git
synced 2025-01-21 07:25:56 +01:00
Added tcqos plugin
This commit is contained in:
parent
79cd022fad
commit
af41b39533
@ -16,7 +16,7 @@ Depends-rpm: curl
|
|||||||
Depends-bin: curl find
|
Depends-bin: curl find
|
||||||
|
|
||||||
# Sudo needed. It will be preconfigured if sudo is installed
|
# 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
|
# Cron for info about busy directories
|
||||||
# This is only example to get disk usage of common /var dirs
|
# This is only example to get disk usage of common /var dirs
|
||||||
|
96
tcqos/control.zaf
Normal file
96
tcqos/control.zaf
Normal file
@ -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 <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: {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
|
||||||
|
|
||||||
|
|
203
tcqos/template.xml
Normal file
203
tcqos/template.xml
Normal file
@ -0,0 +1,203 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<zabbix_export>
|
||||||
|
<version>3.0</version>
|
||||||
|
<date>2016-04-15T09:13:54Z</date>
|
||||||
|
<groups>
|
||||||
|
<group>
|
||||||
|
<name>Templates</name>
|
||||||
|
</group>
|
||||||
|
</groups>
|
||||||
|
<templates>
|
||||||
|
<template>
|
||||||
|
<template>Template Zaf tcqos</template>
|
||||||
|
<name>Template Zaf tcqos</name>
|
||||||
|
<description/>
|
||||||
|
<groups>
|
||||||
|
<group>
|
||||||
|
<name>Templates</name>
|
||||||
|
</group>
|
||||||
|
</groups>
|
||||||
|
<applications>
|
||||||
|
<application>
|
||||||
|
<name>ZAF</name>
|
||||||
|
</application>
|
||||||
|
</applications>
|
||||||
|
<items/>
|
||||||
|
<discovery_rules>
|
||||||
|
<discovery_rule>
|
||||||
|
<name>TC qdisc discovery</name>
|
||||||
|
<type>7</type>
|
||||||
|
<snmp_community/>
|
||||||
|
<snmp_oid/>
|
||||||
|
<key>tcqos.discovery_qdiscs</key>
|
||||||
|
<delay>3600</delay>
|
||||||
|
<status>0</status>
|
||||||
|
<allowed_hosts/>
|
||||||
|
<snmpv3_contextname/>
|
||||||
|
<snmpv3_securityname/>
|
||||||
|
<snmpv3_securitylevel>0</snmpv3_securitylevel>
|
||||||
|
<snmpv3_authprotocol>0</snmpv3_authprotocol>
|
||||||
|
<snmpv3_authpassphrase/>
|
||||||
|
<snmpv3_privprotocol>0</snmpv3_privprotocol>
|
||||||
|
<snmpv3_privpassphrase/>
|
||||||
|
<delay_flex/>
|
||||||
|
<params/>
|
||||||
|
<ipmi_sensor/>
|
||||||
|
<authtype>0</authtype>
|
||||||
|
<username/>
|
||||||
|
<password/>
|
||||||
|
<publickey/>
|
||||||
|
<privatekey/>
|
||||||
|
<port/>
|
||||||
|
<filter>
|
||||||
|
<evaltype>0</evaltype>
|
||||||
|
<formula/>
|
||||||
|
<conditions/>
|
||||||
|
</filter>
|
||||||
|
<lifetime>30</lifetime>
|
||||||
|
<description/>
|
||||||
|
<item_prototypes>
|
||||||
|
<item_prototype>
|
||||||
|
<name>Overlimit packets in classid {#ID} on interface {#IFACE}</name>
|
||||||
|
<type>7</type>
|
||||||
|
<snmp_community/>
|
||||||
|
<multiplier>0</multiplier>
|
||||||
|
<snmp_oid/>
|
||||||
|
<key>tcqos.class_overlimit[{#IFACE},{#ID}]</key>
|
||||||
|
<delay>60</delay>
|
||||||
|
<history>90</history>
|
||||||
|
<trends>365</trends>
|
||||||
|
<status>0</status>
|
||||||
|
<value_type>3</value_type>
|
||||||
|
<allowed_hosts/>
|
||||||
|
<units>P</units>
|
||||||
|
<delta>0</delta>
|
||||||
|
<snmpv3_contextname/>
|
||||||
|
<snmpv3_securityname/>
|
||||||
|
<snmpv3_securitylevel>0</snmpv3_securitylevel>
|
||||||
|
<snmpv3_authprotocol>0</snmpv3_authprotocol>
|
||||||
|
<snmpv3_authpassphrase/>
|
||||||
|
<snmpv3_privprotocol>0</snmpv3_privprotocol>
|
||||||
|
<snmpv3_privpassphrase/>
|
||||||
|
<formula>1</formula>
|
||||||
|
<delay_flex/>
|
||||||
|
<params/>
|
||||||
|
<ipmi_sensor/>
|
||||||
|
<data_type>0</data_type>
|
||||||
|
<authtype>0</authtype>
|
||||||
|
<username/>
|
||||||
|
<password/>
|
||||||
|
<publickey/>
|
||||||
|
<privatekey/>
|
||||||
|
<port/>
|
||||||
|
<description/>
|
||||||
|
<inventory_link>0</inventory_link>
|
||||||
|
<applications>
|
||||||
|
<application>
|
||||||
|
<name>ZAF</name>
|
||||||
|
</application>
|
||||||
|
</applications>
|
||||||
|
<valuemap/>
|
||||||
|
<logtimefmt/>
|
||||||
|
<application_prototypes/>
|
||||||
|
</item_prototype>
|
||||||
|
<item_prototype>
|
||||||
|
<name>Sent bytes in classid {#ID} on interface {#IFACE}</name>
|
||||||
|
<type>7</type>
|
||||||
|
<snmp_community/>
|
||||||
|
<multiplier>0</multiplier>
|
||||||
|
<snmp_oid/>
|
||||||
|
<key>tcqos.class_sentbytes[{#IFACE},{#ID}]</key>
|
||||||
|
<delay>60</delay>
|
||||||
|
<history>90</history>
|
||||||
|
<trends>365</trends>
|
||||||
|
<status>0</status>
|
||||||
|
<value_type>3</value_type>
|
||||||
|
<allowed_hosts/>
|
||||||
|
<units>B</units>
|
||||||
|
<delta>0</delta>
|
||||||
|
<snmpv3_contextname/>
|
||||||
|
<snmpv3_securityname/>
|
||||||
|
<snmpv3_securitylevel>0</snmpv3_securitylevel>
|
||||||
|
<snmpv3_authprotocol>0</snmpv3_authprotocol>
|
||||||
|
<snmpv3_authpassphrase/>
|
||||||
|
<snmpv3_privprotocol>0</snmpv3_privprotocol>
|
||||||
|
<snmpv3_privpassphrase/>
|
||||||
|
<formula>1</formula>
|
||||||
|
<delay_flex/>
|
||||||
|
<params/>
|
||||||
|
<ipmi_sensor/>
|
||||||
|
<data_type>0</data_type>
|
||||||
|
<authtype>0</authtype>
|
||||||
|
<username/>
|
||||||
|
<password/>
|
||||||
|
<publickey/>
|
||||||
|
<privatekey/>
|
||||||
|
<port/>
|
||||||
|
<description/>
|
||||||
|
<inventory_link>0</inventory_link>
|
||||||
|
<applications>
|
||||||
|
<application>
|
||||||
|
<name>ZAF</name>
|
||||||
|
</application>
|
||||||
|
</applications>
|
||||||
|
<valuemap/>
|
||||||
|
<logtimefmt/>
|
||||||
|
<application_prototypes/>
|
||||||
|
</item_prototype>
|
||||||
|
<item_prototype>
|
||||||
|
<name>Sent packets in classid {#ID} on interface {#IFACE}</name>
|
||||||
|
<type>7</type>
|
||||||
|
<snmp_community/>
|
||||||
|
<multiplier>0</multiplier>
|
||||||
|
<snmp_oid/>
|
||||||
|
<key>tcqos.class_sentpackets[{#IFACE},{#ID}]</key>
|
||||||
|
<delay>60</delay>
|
||||||
|
<history>90</history>
|
||||||
|
<trends>365</trends>
|
||||||
|
<status>0</status>
|
||||||
|
<value_type>3</value_type>
|
||||||
|
<allowed_hosts/>
|
||||||
|
<units>P</units>
|
||||||
|
<delta>0</delta>
|
||||||
|
<snmpv3_contextname/>
|
||||||
|
<snmpv3_securityname/>
|
||||||
|
<snmpv3_securitylevel>0</snmpv3_securitylevel>
|
||||||
|
<snmpv3_authprotocol>0</snmpv3_authprotocol>
|
||||||
|
<snmpv3_authpassphrase/>
|
||||||
|
<snmpv3_privprotocol>0</snmpv3_privprotocol>
|
||||||
|
<snmpv3_privpassphrase/>
|
||||||
|
<formula>1</formula>
|
||||||
|
<delay_flex/>
|
||||||
|
<params/>
|
||||||
|
<ipmi_sensor/>
|
||||||
|
<data_type>0</data_type>
|
||||||
|
<authtype>0</authtype>
|
||||||
|
<username/>
|
||||||
|
<password/>
|
||||||
|
<publickey/>
|
||||||
|
<privatekey/>
|
||||||
|
<port/>
|
||||||
|
<description/>
|
||||||
|
<inventory_link>0</inventory_link>
|
||||||
|
<applications>
|
||||||
|
<application>
|
||||||
|
<name>ZAF</name>
|
||||||
|
</application>
|
||||||
|
</applications>
|
||||||
|
<valuemap/>
|
||||||
|
<logtimefmt/>
|
||||||
|
<application_prototypes/>
|
||||||
|
</item_prototype>
|
||||||
|
</item_prototypes>
|
||||||
|
<trigger_prototypes/>
|
||||||
|
<graph_prototypes/>
|
||||||
|
<host_prototypes/>
|
||||||
|
</discovery_rule>
|
||||||
|
</discovery_rules>
|
||||||
|
<macros/>
|
||||||
|
<templates/>
|
||||||
|
<screens/>
|
||||||
|
</template>
|
||||||
|
</templates>
|
||||||
|
</zabbix_export>
|
@ -29,22 +29,22 @@ Item framework_version:
|
|||||||
Description::
|
Description::
|
||||||
Returns version of zaf installed.
|
Returns version of zaf installed.
|
||||||
::
|
::
|
||||||
# If item is function defined in shared library, use Function:
|
# If item is Cmd: defined in shared library, use Cmd::
|
||||||
Function: zaf_version
|
Cmd:: zaf_version
|
||||||
/Item
|
/Item
|
||||||
|
|
||||||
Item plugins:
|
Item plugins:
|
||||||
Description::
|
Description::
|
||||||
Returns installed plugins
|
Returns installed plugins
|
||||||
::
|
::
|
||||||
Function: zaf_list_plugins
|
Cmd:: zaf_list_plugins
|
||||||
/Item
|
/Item
|
||||||
|
|
||||||
Item discovery.plugins:
|
Item discovery.plugins:
|
||||||
Description::
|
Description::
|
||||||
Returns installed plugins in form suitable for zabbix discovery
|
Returns installed plugins in form suitable for zabbix discovery
|
||||||
::
|
::
|
||||||
Function: zaf_discovery_plugins
|
Cmd:: zaf_discovery_plugins
|
||||||
/Item
|
/Item
|
||||||
|
|
||||||
Item plugin_version:
|
Item plugin_version:
|
||||||
@ -52,7 +52,7 @@ Parameters: plugin_name
|
|||||||
Description::
|
Description::
|
||||||
Returns version of plugin
|
Returns version of plugin
|
||||||
::
|
::
|
||||||
Function: zaf_plugin_version $1
|
Cmd:: zaf_plugin_version $1
|
||||||
/Item
|
/Item
|
||||||
|
|
||||||
Item plugin_url:
|
Item plugin_url:
|
||||||
@ -60,7 +60,7 @@ Parameters: plugin_name
|
|||||||
Description::
|
Description::
|
||||||
Returns base url of plugin
|
Returns base url of plugin
|
||||||
::
|
::
|
||||||
Function: zaf_plugin_url $1
|
Cmd:: zaf_plugin_url $1
|
||||||
/Item
|
/Item
|
||||||
|
|
||||||
Item plugin_web:
|
Item plugin_web:
|
||||||
@ -68,7 +68,7 @@ Parameters: plugin_name
|
|||||||
Description::
|
Description::
|
||||||
Returns home url of plugin
|
Returns home url of plugin
|
||||||
::
|
::
|
||||||
Function: zaf_plugin_web $1
|
Cmd:: zaf_plugin_web $1
|
||||||
/Item
|
/Item
|
||||||
|
|
||||||
Item plugin_maintainer:
|
Item plugin_maintainer:
|
||||||
@ -76,7 +76,7 @@ Parameters: plugin_name
|
|||||||
Description::
|
Description::
|
||||||
Returns maintainer of plugin
|
Returns maintainer of plugin
|
||||||
::
|
::
|
||||||
Function: zaf_plugin_maintainer $1
|
Cmd:: zaf_plugin_maintainer $1
|
||||||
/Item
|
/Item
|
||||||
|
|
||||||
Item plugin_items:
|
Item plugin_items:
|
||||||
@ -84,7 +84,7 @@ Parameters: plugin_name
|
|||||||
Description::
|
Description::
|
||||||
Returns items defined in plugin
|
Returns items defined in plugin
|
||||||
::
|
::
|
||||||
Function: zaf_list_plugin_items $1
|
Cmd:: zaf_list_plugin_items $1
|
||||||
/Item
|
/Item
|
||||||
|
|
||||||
Item plugin_template_url:
|
Item plugin_template_url:
|
||||||
@ -92,6 +92,6 @@ Parameters: plugin_name
|
|||||||
Description::
|
Description::
|
||||||
Returns base template url for plugin
|
Returns base template url for plugin
|
||||||
::
|
::
|
||||||
Function: zaf_plugin_template_url $1
|
Cmd:: zaf_plugin_template_url $1
|
||||||
/Item
|
/Item
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user