# ubus call only work as root so you need to run zabbix as root to use wifi.ifdiscovery
UserParameter=wifi.ifdiscovery, lua -l uci -l ubus -l iwinfo -e 'u = ubus.connect();x = uci.cursor();list="{\"data\":[";stat=u:call("network.wireless", "status", {});for dev, dev_table in pairs(stat) do for i, iface in pairs(dev_table["interfaces"]) do s=iface["section"];list=list.."{\"{#IF}\":\""..iface["ifname"].."\", \"{#MODE}\":\""..x:get("wireless", s, "mode").."\", \"{#SSID}\":\""..x:get("wireless", s, "ssid").."\", \"{#NET}\":\""..x:get("wireless", s, "network").."\", \"{#DEV}\":\""..dev.."\", \"{#ENC}\":\""..(x:get("wireless", s, "encryption") or "?").."\", \"{#TYPE}\":\""..x:get("wireless", dev, "type").."\", \"{#HWMODE}\":\""..x:get("wireless", dev, "hwmode").."\", \"{#CHANNEL}\":\""..x:get("wireless", dev, "channel").."\", \"{#BSSID}\":\""..iwinfo[iwinfo.type(iface["ifname"])].bssid(iface["ifname"]).."\"},";end;end;list=string.gsub(list,",$","");print(list.."]}")'
#iwinfo info (you need {#IF} as parameter, like 'wlan0')
#iwinfo info (you need {#IF} as parameter, like 'wlan0')
@ -23,7 +23,3 @@ UserParameter=wifi.iwinfo.nbusers[*],lua -l iwinfo -e "n = 0; for _,_ in pairs(i
UserParameter=wifi.iwinfo.encryption[*],lua -l iwinfo -e "e = iwinfo[iwinfo.type('$1')].encryption('$1'); print(e and e.description or 'None')"
UserParameter=wifi.iwinfo.encryption[*],lua -l iwinfo -e "e = iwinfo[iwinfo.type('$1')].encryption('$1'); print(e and e.description or 'None')"
UserParameter=wifi.iwinfo.hwmode[*],lua -l iwinfo -e "x=iwinfo[iwinfo.type('$1')].hwmodelist('$1'); print((x.a and 'a' or '')..(x.b and 'b' or '')..(x.g and 'g' or '')..(x.n and 'n' or ''))"
UserParameter=wifi.iwinfo.hwmode[*],lua -l iwinfo -e "x=iwinfo[iwinfo.type('$1')].hwmodelist('$1'); print((x.a and 'a' or '')..(x.b and 'b' or '')..(x.g and 'g' or '')..(x.n and 'n' or ''))"
#uci info (you need {#DEV} as parameter, like 'radio0')