Repaired iwx to work with openwrt

1.3
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
Depends-dpkg: dash curl
Depens-opkg: busybox curl
Depens-opkg: busybox curl jshn
Depends-rpm: curl
Depends-bin: curl ps iw
@ -49,6 +49,14 @@ Parameters: dev
Cmd: wifi_clients_discovery $1
/Item
Item neigh_discovery:
Description::
Discovery of wireless neighbours
::
Parameters: dev
Cmd: wifi_neigh_discovery $1
/Item
Item client_signal:
Description::
Signal level of client

View File

@ -1,26 +1,33 @@
wifi_ifphylist_openwrt() {
local devs phys p ifname ifindex i
json_load "$(ubus -S call network.wireless status)"
json_get_keys phys
for p in $phys; do
if [ "$1" = "phy" ]; then
echo $p
continue
fi
json_select "$p"
json_select "interfaces"
json_get_keys ifindex
for i in $ifindex; do
json_select $i
json_get_var ifname ifname
echo $ifname
json_select ..
done
json_select ..
json_select ..
done
if [ -f /usr/share/libubox/jshn.sh ]; then
. /usr/share/libubox/jshn.sh
json_load "$(ubus -S call network.wireless status)"
json_get_keys phys
for p in $phys; do
if [ "$1" = "phy" ]; then
echo $p
continue
fi
json_select "$p"
json_select "interfaces"
json_get_keys ifindex
for i in $ifindex; do
json_select $i
json_get_var ifname ifname
echo $ifname
json_select ..
done
json_select ..
json_select ..
done
else
wifi_ifphylist "$1"
fi
}
wifi_ifphylist() {

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>3.0</version>
<date>2016-05-13T15:42:32Z</date>
<version>3.2</version>
<date>2016-11-21T16:43:49Z</date>
<groups>
<group>
<name>Templates</name>
@ -21,7 +21,7 @@
<application>
<name>Wifi</name>
</application>
<application>
<application>
<name>ZAF</name>
</application>
</applications>
@ -284,13 +284,19 @@
<trigger_prototypes>
<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>
<recovery_mode>0</recovery_mode>
<recovery_expression/>
<name>Busy time on channel {#FREQ} on {#DEV} is high</name>
<correlation_mode>0</correlation_mode>
<correlation_tag/>
<url/>
<status>0</status>
<priority>2</priority>
<description/>
<type>0</type>
<manual_close>0</manual_close>
<dependencies/>
<tags/>
</trigger_prototype>
</trigger_prototypes>
<graph_prototypes>
@ -612,7 +618,6 @@
</graph_prototypes>
<host_prototypes/>
</discovery_rule>
<discovery_rule>
<name>Wifi neighbours discovery</name>
<type>7</type>
@ -784,6 +789,7 @@
<host_prototypes/>
</discovery_rule>
</discovery_rules>
<httptests/>
<macros/>
<templates/>
<screens/>