Hi, sorry to top-post but this f***ing tablet is against me, so i will just answer in the order.
-The "wifi" package should also work with broadcom-wl and madwifi, where the "mac80211" is only for mac80211. I split up to put dependencies, and in case someone want to make "extra-madwifi" later... We can make only one package we just have to be sure that the discovery rules fails gracefully (i think it's the case for mac80211) and explain the dependencies in the files and not put them in the makefile. (you ask for the depencies in the first place) -for the startup script i will stop using chown/zabbix user and only make a chmod +r. I don't want to run zabbix as root. The chmod -R +r /var/state (2 startup scripts) isn't needed if we correct uci to give the same right for files in /var/state as in /etc/config (but i haven't looked into). -lua is doing all the parsing for me, and i always put luci, so it's not a dependency for me. Can you check the size of all lua dependencies that i add, i think it's rather small. (can't check right now) -the idea of the netowrt.discovery is: monitor only relevant iface (like br-lan and not eth0.1 and wlan0), and have cool name on the graphs (like wan instead of eth0.0, or vpn instead of tap99) thanks for your feedback/interrest Etienne Stefan Hellermann <ste...@the2masters.de> a écrit : >Hi, > >> This patch add 3 extra packages for zabbix-agentd: >> zabbix-extra-network: a detection rule with the ifname (eth0.1) and the >> network name (wan). >> zabbix-extra-wifi: an universal detection rule for wifi (using libuci) and >> many userparameters (using libiwinfo) >> zabbix-extra-mac80211: a phy (phy0) detection rule and userparameters for >> mac80211 devices > >Who would want mac80211 and not wifi? or the other way around? I think >it's okay to put them into the same package. > >> >> With each packages come a startup script to set rights so that you can still >> run zabbix as non root user. > >You add 3 startup scripts which all check and add the user zabbix. >Doesn't look to nice to me. And then the startup scripts only change >permissions, they don't start anything. More comments below. > >> Ready to use templates are available here: >> http://wiki.openwrt.org/doc/howto/zabbix >Nice! >> >> Please delete files/zabbix_agentd.conf, it's an empty file. >> >> Signed-off-by: Etienne CHAMPETIER <etienne.champet...@free.fr> >> >> Index: files/zabbix_extra_wifi.init >> =================================================================== >> --- files/zabbix_extra_wifi.init (révision 0) >> +++ files/zabbix_extra_wifi.init (révision 0) >> @@ -0,0 +1,18 @@ >> +#!/bin/sh /etc/rc.common >> +# Copyright (C) 2008-2011 OpenWrt.org >> + >> +START=59 >> + >> +CONFIG=/etc/zabbix_agentd.conf >> + >> +start() { >> + grep -q "^AllowRoot=1" ${CONFIG} || { >> + user_exists zabbix 53 || user_add zabbix 53 >> + group_exists zabbix 53 || group_add zabbix 53 >> + [ -d /var/state ] && { >> + chown -R root:zabbix /var/state/ >> + chmod -R g+r /var/state/ >> + } >> + } >> +} >> + > >Are you sure it's save to do this? This folder is not owned by zabbix. >If other packages start to do the same, then we will get into trouble. >I think it's a bad idea. We could make this folder readable for >others. But I think it's better to run zabbix as root. > >> Index: files/network >> =================================================================== >> --- files/network (révision 0) >> +++ files/network (révision 0) >> @@ -0,0 +1,8 @@ >> +#tested with ath9k/zabbix 2.0.3-2.0.4/openwrt AA rc1 >> +#see http://wiki.openwrt.org/doc/howto/zabbix for ready to use templates >> + >> +# >> +UserParameter=netowrt.discovery,lua -l uci -e 'x = uci.cursor(nil, >> "/var/state");list = "{\"data\":[";x:foreach("network", "interface", >> function(s) list=list.."{\"{#IF}\":\""..s.ifname.."\", >> \"{#NET}\":\""..s[".name"].."\", \"{#DEV}\":\""..s.device.."\"}," end); >> list=string.gsub(list,",$",""); print(list.."]}")' > >Would it be possible to get this info without lua? >I thought about 'uci show network | grep ".ifname=" | sed something'. >Then we don't need this additional dependency and could maybe even >include this in the zabbix-agentd package. >What do you do with the detected interface names? > >[snip] >> Index: files/zabbix_extra_mac80211.init >> =================================================================== >> --- files/zabbix_extra_mac80211.init (révision 0) >> +++ files/zabbix_extra_mac80211.init (révision 0) >> @@ -0,0 +1,18 @@ >> +#!/bin/sh /etc/rc.common >> +# Copyright (C) 2008-2011 OpenWrt.org >> + >> +START=59 >> + >> +CONFIG=/etc/zabbix_agentd.conf >> + >> +start() { >> + grep -q "^AllowRoot=1" ${CONFIG} || { >> + user_exists zabbix 53 || user_add zabbix 53 >> + group_exists zabbix 53 || group_add zabbix 53 >> + [ -d /sys/kernel/debug/ieee80211 ] && { >> + chown -R root:zabbix /sys/kernel/debug/ieee80211/ >> + chmod -R g+r /sys/kernel/debug/ieee80211/ >> + } >> + } >> +} >> + > >Is this actually possible? Again, I think it's better to run zabbix as >root. Or maybe "chmod -R o+r". Your solution doesn't scale to many >packages wanting to do the same. > >[snip] >> +define Package/zabbix-extra-mac80211/postinst >> +[ -n "$${IPKG_INSTROOT}" ] || /etc/init.d/zabbix_extra_mac80211 enable >> +exit 0 >> +endef >> + >> +define Package/zabbix-extra-network/postinst >> +[ -n "$${IPKG_INSTROOT}" ] || /etc/init.d/zabbix_extra_network enable >> +exit 0 >> +endef >> + >> +define Package/zabbix-extra-wifi/postinst >> +[ -n "$${IPKG_INSTROOT}" ] || /etc/init.d/zabbix_extra_wifi enable >> +exit 0 >> +endef > >Is this really needed? > >To sum it up: I like your rules, but would like to know if lua is >needed. Further I think the startup scripts are a bad idea and we >should just run zabbix as root. >I have to run your rules on a router with wifi devices to test them, I >have not done it till now. > >Regards, >Stefan Hellermann _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel