You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

6 lines
573 B

  1. #see https://openwrt.org/docs/guide-user/services/network_monitoring/zabbix for ready to use templates
  2. # network interface discovery
  3. # example: {"data":[{"{#IF}":"lo", "{#NET}":"loopback"},{"{#IF}":"br-lan", "{#NET}":"lan"},{"{#IF}":"eth0.1", "{#NET}":"wan"}]}
  4. #
  5. UserParameter=netowrt.discovery,lua -l ubus -e 'u=ubus.connect();list="{\"data\":[";dump=u:call("network.interface", "dump", {});for _, intf in ipairs(dump.interface) do list=list.."{\"{#IF}\":\""..intf.device.."\", \"{#NET}\":\""..intf.interface.."\"},";end;list=string.gsub(list,",$","");print(list.."]}")'