1
0
mirror of https://github.com/limosek/zaf-plugins.git synced 2025-01-21 23:45:56 +01:00

Repaired iwx to work with openwrt

This commit is contained in:
Lukas Macura 2016-11-21 17:45:35 +01:00
parent e2cc70596c
commit c598e31aaa
3 changed files with 45 additions and 24 deletions

View File

@ -10,7 +10,7 @@ Web: https://github.com/limosek/zaf-plugins
# Dependencies # Dependencies
Depends-dpkg: dash curl Depends-dpkg: dash curl
Depens-opkg: busybox curl Depens-opkg: busybox curl jshn
Depends-rpm: curl Depends-rpm: curl
Depends-bin: curl ps iw Depends-bin: curl ps iw
@ -49,6 +49,14 @@ Parameters: dev
Cmd: wifi_clients_discovery $1 Cmd: wifi_clients_discovery $1
/Item /Item
Item neigh_discovery:
Description::
Discovery of wireless neighbours
::
Parameters: dev
Cmd: wifi_neigh_discovery $1
/Item
Item client_signal: Item client_signal:
Description:: Description::
Signal level of client Signal level of client

View File

@ -1,7 +1,11 @@
wifi_ifphylist_openwrt() { wifi_ifphylist_openwrt() {
local devs phys p ifname ifindex i local devs phys p ifname ifindex i
if [ -f /usr/share/libubox/jshn.sh ]; then
. /usr/share/libubox/jshn.sh
json_load "$(ubus -S call network.wireless status)" json_load "$(ubus -S call network.wireless status)"
json_get_keys phys json_get_keys phys
for p in $phys; do for p in $phys; do
@ -21,6 +25,9 @@ wifi_ifphylist_openwrt() {
json_select .. json_select ..
json_select .. json_select ..
done done
else
wifi_ifphylist "$1"
fi
} }
wifi_ifphylist() { wifi_ifphylist() {

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<zabbix_export> <zabbix_export>
<version>3.0</version> <version>3.2</version>
<date>2016-05-13T15:42:32Z</date> <date>2016-11-21T16:43:49Z</date>
<groups> <groups>
<group> <group>
<name>Templates</name> <name>Templates</name>
@ -284,13 +284,19 @@
<trigger_prototypes> <trigger_prototypes>
<trigger_prototype> <trigger_prototype>
<expression>{Template Zaf iwx:iwx.channel_activetime[{#DEV},{#FREQ}].change()}&gt;20 and ({Template Zaf iwx:iwx.channel_busytime[{#DEV},{#FREQ}].last()}/{Template Zaf iwx:iwx.channel_activetime[{#DEV},{#FREQ}].last()})&gt;0.3</expression> <expression>{Template Zaf iwx:iwx.channel_activetime[{#DEV},{#FREQ}].change()}&gt;20 and ({Template Zaf iwx:iwx.channel_busytime[{#DEV},{#FREQ}].last()}/{Template Zaf iwx:iwx.channel_activetime[{#DEV},{#FREQ}].last()})&gt;0.3</expression>
<recovery_mode>0</recovery_mode>
<recovery_expression/>
<name>Busy time on channel {#FREQ} on {#DEV} is high</name> <name>Busy time on channel {#FREQ} on {#DEV} is high</name>
<correlation_mode>0</correlation_mode>
<correlation_tag/>
<url/> <url/>
<status>0</status> <status>0</status>
<priority>2</priority> <priority>2</priority>
<description/> <description/>
<type>0</type> <type>0</type>
<manual_close>0</manual_close>
<dependencies/> <dependencies/>
<tags/>
</trigger_prototype> </trigger_prototype>
</trigger_prototypes> </trigger_prototypes>
<graph_prototypes> <graph_prototypes>
@ -612,7 +618,6 @@
</graph_prototypes> </graph_prototypes>
<host_prototypes/> <host_prototypes/>
</discovery_rule> </discovery_rule>
<discovery_rule> <discovery_rule>
<name>Wifi neighbours discovery</name> <name>Wifi neighbours discovery</name>
<type>7</type> <type>7</type>
@ -784,6 +789,7 @@
<host_prototypes/> <host_prototypes/>
</discovery_rule> </discovery_rule>
</discovery_rules> </discovery_rules>
<httptests/>
<macros/> <macros/>
<templates/> <templates/>
<screens/> <screens/>