diff --git a/iwx/control.zaf b/iwx/control.zaf index 3f31585..182fdb0 100644 --- a/iwx/control.zaf +++ b/iwx/control.zaf @@ -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 diff --git a/iwx/functions.sh b/iwx/functions.sh index 0699240..c8065fd 100644 --- a/iwx/functions.sh +++ b/iwx/functions.sh @@ -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() { diff --git a/iwx/template.xml b/iwx/template.xml index 0815ceb..a17d6a6 100644 --- a/iwx/template.xml +++ b/iwx/template.xml @@ -1,7 +1,7 @@ - 3.0 - 2016-05-13T15:42:32Z + 3.2 + 2016-11-21T16:43:49Z Templates @@ -21,7 +21,7 @@ Wifi - + ZAF @@ -284,13 +284,19 @@ {Template Zaf iwx:iwx.channel_activetime[{#DEV},{#FREQ}].change()}>20 and ({Template Zaf iwx:iwx.channel_busytime[{#DEV},{#FREQ}].last()}/{Template Zaf iwx:iwx.channel_activetime[{#DEV},{#FREQ}].last()})>0.3 + 0 + Busy time on channel {#FREQ} on {#DEV} is high + 0 + 0 2 0 + 0 + @@ -612,7 +618,6 @@ - Wifi neighbours discovery 7 @@ -784,6 +789,7 @@ +