Changeset 36740


Ignore:
Timestamp:
2013-05-28T12:03:03+02:00 (3 years ago)
Author:
mirko
Message:

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-lua) and many userparameters (using libiwinfo-lua)
zabbix-extra-mac80211: a phy (phy0) detection rule and userparameters for mac80211 devices

zabbix-extra-network and zabbix-extra-wifi will work as non root user if /etc/config/wireless and /etc/config/network are world-readeable (default)
(see http://nbd.name/gitweb.cgi?p=uci.git;a=commit;h=07d6fd66f6a20e35490bc8b55d26fdb389016120)
zabbix-extra-mac80211 come with a suid helper so that you can still run zabbix as non root user.

Ready to use templates are available here: http://wiki.openwrt.org/doc/howto/zabbix

Please delete files/zabbix_agentd.conf, it's an empty file.

Signed-off-by: Etienne CHAMPETIER <etienne.champetier@…>

Location:
packages/admin/zabbix
Files:
4 added
2 edited

Legend:

Unmodified
Added
Removed
  • packages/admin/zabbix/Makefile

    r35636 r36740  
    4242endef 
    4343 
     44define Package/zabbix-extra-mac80211 
     45  $(call Package/zabbix/Default) 
     46  TITLE+= discovery/userparameters for mac80211 
     47  DEPENDS += +zabbix-agentd @PACKAGE_MAC80211_DEBUGFS @KERNEL_DEBUG_FS 
     48endef 
     49 
     50define Package/zabbix-extra-network 
     51  $(call Package/zabbix/Default) 
     52  TITLE+= discovery/userparameters for network 
     53  DEPENDS += +zabbix-agentd +libuci-lua +lua 
     54endef 
     55 
     56define Package/zabbix-extra-wifi 
     57  $(call Package/zabbix/Default) 
     58  TITLE+= discovery/userparameters for wifi 
     59  DEPENDS += +zabbix-agentd +libiwinfo-lua +libuci-lua +lua 
     60endef 
     61 
    4462define Package/zabbix-sender 
    4563  $(call Package/zabbix/Default) 
     
    6381  DEPENDS += +libsqlite3 
    6482endef 
     83 
     84define Package/zabbix-extra-mac80211/description 
     85An extra package for zabbix-agentd that adds a discovery rule for mac80211 wifi phy and many userparameters. 
     86It contains an suid helper to allow zabbix-agentd to still run as zabbix user and not as root. 
     87See http://wiki.openwrt.org/doc/howto/zabbix for ready to use zabbix templates. 
     88endef 
     89 
     90define Package/zabbix-extra-network/description 
     91An extra package for zabbix-agentd that adds a discovery rule for openwrt network interfaces. 
     92The idea here is to discover only interfaces listed in /etc/config/network (discover br-lan and not eth0.1 and wlan0) 
     93See http://wiki.openwrt.org/doc/howto/zabbix for ready to use zabbix templates. 
     94endef 
     95 
     96define Package/zabbix-extra-wifi/description 
     97An extra package for zabbix-agentd that adds a discovery rule for wifi interfaces and many userparameters. 
     98As it uses libiwinfo, it works with all wifi devices supported by openwrt. 
     99See http://wiki.openwrt.org/doc/howto/zabbix for ready to use zabbix templates. 
     100endef 
     101 
    65102 
    66103define Package/zabbix-agentd/config 
     
    114151endef 
    115152 
     153define Package/zabbix/install/zabbix.conf.d 
     154        $(INSTALL_DIR) \ 
     155                $(1)/etc/zabbix_$(2).conf.d 
     156 
     157        $(INSTALL_BIN) \ 
     158                ./files/$(3) \ 
     159                $(1)/etc/zabbix_$(2).conf.d/$(3) 
     160endef 
     161 
    116162define Package/zabbix-agent/conffiles 
    117163/etc/zabbix_agent.conf 
     
    125171define Package/zabbix-proxy/conffiles 
    126172/etc/zabbix_proxy.conf 
     173endef 
     174 
     175ifdef CONFIG_PACKAGE_zabbix-extra-mac80211 
     176define Build/Prepare/zabbix-extra-mac80211 
     177        mkdir -p $(PKG_BUILD_DIR)/zabbix-extra-mac80211 
     178        $(CP) ./files/zabbix_helper_mac80211.c $(PKG_BUILD_DIR)/zabbix-extra-mac80211/ 
     179endef 
     180 
     181define Build/Compile/zabbix-extra-mac80211 
     182        $(TARGET_CC) $(TARGET_CFLAGS) $(PKG_BUILD_DIR)/zabbix-extra-mac80211/zabbix_helper_mac80211.c -o $(PKG_BUILD_DIR)/zabbix-extra-mac80211/zabbix_helper_mac80211 
     183endef 
     184endif 
     185 
     186define Build/Prepare 
     187        $(call Build/Prepare/Default) 
     188        $(call Build/Prepare/zabbix-extra-mac80211) 
     189endef 
     190 
     191define Build/Compile 
     192        $(call Build/Compile/Default) 
     193        $(call Build/Compile/zabbix-extra-mac80211) 
    127194endef 
    128195 
     
    138205endef 
    139206 
     207define Package/zabbix-extra-mac80211/install 
     208        $(call Package/zabbix/install/zabbix.conf.d,$(1),agentd,mac80211) 
     209        $(INSTALL_DIR) $(1)/usr/bin 
     210        $(INSTALL_BIN) $(PKG_BUILD_DIR)/zabbix-extra-mac80211/zabbix_helper_mac80211 $(1)/usr/bin/ 
     211        chmod 4755 $(1)/usr/bin/zabbix_helper_mac80211 
     212endef 
     213 
     214define Package/zabbix-extra-network/install 
     215        $(call Package/zabbix/install/zabbix.conf.d,$(1),agentd,network) 
     216endef 
     217 
     218define Package/zabbix-extra-wifi/install 
     219        $(call Package/zabbix/install/zabbix.conf.d,$(1),agentd,wifi) 
     220endef 
     221 
    140222define Package/zabbix-sender/install 
    141223        $(call Package/zabbix/install/bin,$(1),sender) 
     
    158240$(eval $(call BuildPackage,zabbix-agent)) 
    159241$(eval $(call BuildPackage,zabbix-agentd)) 
     242$(eval $(call BuildPackage,zabbix-extra-mac80211)) 
     243$(eval $(call BuildPackage,zabbix-extra-network)) 
     244$(eval $(call BuildPackage,zabbix-extra-wifi)) 
    160245$(eval $(call BuildPackage,zabbix-sender)) 
    161246$(eval $(call BuildPackage,zabbix-server)) 
  • packages/admin/zabbix/patches/010-change-agentd-config.patch

    r34492 r36740  
    1 diff --git a/conf/zabbix_agentd.conf b/conf/zabbix_agentd.conf 
    2 index ed04751..e714c4d 100644 
    31--- a/conf/zabbix_agentd.conf 
    42+++ b/conf/zabbix_agentd.conf 
     
    5351 #      Item used for generating Hostname if it is undefined. 
    5452 #      Ignored if Hostname is defined. 
     53@@ -213,7 +204,7 @@ Hostname=Zabbix server 
     54 # Include= 
     55  
     56 # Include=/usr/local/etc/zabbix_agentd.userparams.conf 
     57-# Include=/usr/local/etc/zabbix_agentd.conf.d/ 
     58+Include=/etc/zabbix_agentd.conf.d/ 
     59  
     60 ####### USER-DEFINED MONITORED PARAMETERS ####### 
     61  
Note: See TracChangeset for help on using the changeset viewer.