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.

247 lines
6.3 KiB

  1. #
  2. # Copyright (C) 2006-2014 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=zabbix
  9. PKG_VERSION:=2.4.2
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=@SF/zabbix
  13. PKG_MD5SUM:=50530e52c08d4a81f9e6e781f1a170ca
  14. PKG_LICENSE:=GPL-2.0
  15. PKG_LICENSE_FILES:=COPYING
  16. PKG_INSTALL:=1
  17. PKG_FIXUP:=autoreconf
  18. include $(INCLUDE_DIR)/package.mk
  19. include $(INCLUDE_DIR)/nls.mk
  20. define Package/zabbix/Default
  21. SECTION:=admin
  22. CATEGORY:=Administration
  23. TITLE:=Zabbix
  24. URL:=http://www.zabbix.com/
  25. SUBMENU:=zabbix
  26. MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com>
  27. USERID:=zabbix=53:zabbix=53
  28. endef
  29. define Package/zabbix-agent
  30. $(call Package/zabbix/Default)
  31. TITLE+= agent
  32. endef
  33. define Package/zabbix-agentd
  34. $(call Package/zabbix/Default)
  35. TITLE+= agentd
  36. endef
  37. define Package/zabbix-extra-mac80211
  38. $(call Package/zabbix/Default)
  39. TITLE+= discovery/userparameters for mac80211
  40. DEPENDS += +zabbix-agentd @PACKAGE_MAC80211_DEBUGFS @KERNEL_DEBUG_FS
  41. endef
  42. define Package/zabbix-extra-network
  43. $(call Package/zabbix/Default)
  44. TITLE+= discovery/userparameters for network
  45. DEPENDS += +zabbix-agentd +libuci-lua +lua
  46. endef
  47. define Package/zabbix-extra-wifi
  48. $(call Package/zabbix/Default)
  49. TITLE+= discovery/userparameters for wifi
  50. DEPENDS += +zabbix-agentd +libiwinfo-lua +libuci-lua +lua
  51. endef
  52. define Package/zabbix-sender
  53. $(call Package/zabbix/Default)
  54. TITLE+= sender
  55. endef
  56. define Package/zabbix-get
  57. $(call Package/zabbix/Default)
  58. TITLE+= get
  59. endef
  60. define Package/zabbix-server
  61. $(call Package/zabbix/Default)
  62. TITLE+= server
  63. DEPENDS += +libsqlite3
  64. endef
  65. define Package/zabbix-proxy
  66. $(call Package/zabbix/Default)
  67. TITLE+= proxy
  68. DEPENDS += +libsqlite3
  69. endef
  70. define Package/zabbix-extra-mac80211/description
  71. An extra package for zabbix-agentd that adds a discovery rule for mac80211 wifi phy and many userparameters.
  72. It contains an suid helper to allow zabbix-agentd to still run as zabbix user and not as root.
  73. See http://wiki.openwrt.org/doc/howto/zabbix for ready to use zabbix templates.
  74. endef
  75. define Package/zabbix-extra-network/description
  76. An extra package for zabbix-agentd that adds a discovery rule for openwrt network interfaces.
  77. The idea here is to discover only interfaces listed in /etc/config/network (discover br-lan and not eth0.1 and wlan0)
  78. See http://wiki.openwrt.org/doc/howto/zabbix for ready to use zabbix templates.
  79. endef
  80. define Package/zabbix-extra-wifi/description
  81. An extra package for zabbix-agentd that adds a discovery rule for wifi interfaces and many userparameters.
  82. As it uses libiwinfo, it works with all wifi devices supported by openwrt.
  83. See http://wiki.openwrt.org/doc/howto/zabbix for ready to use zabbix templates.
  84. endef
  85. CONFIGURE_ARGS+= \
  86. --enable-agent \
  87. --enable-server \
  88. --enable-proxy \
  89. --disable-java \
  90. --with-sqlite3="$(STAGING_DIR)/usr"
  91. MAKE_FLAGS += ARCH="linux"
  92. define Package/zabbix/install/sbin
  93. $(INSTALL_DIR) \
  94. $(1)/usr/sbin
  95. $(INSTALL_BIN) \
  96. $(PKG_INSTALL_DIR)/usr/sbin/zabbix_$(2) \
  97. $(1)/usr/sbin/
  98. endef
  99. define Package/zabbix/install/bin
  100. $(INSTALL_DIR) \
  101. $(1)/usr/bin
  102. $(INSTALL_BIN) \
  103. $(PKG_INSTALL_DIR)/usr/bin/zabbix_$(2) \
  104. $(1)/usr/bin/
  105. endef
  106. define Package/zabbix/install/etc
  107. $(INSTALL_DIR) \
  108. $(1)/etc
  109. $(INSTALL_CONF) \
  110. $(PKG_INSTALL_DIR)/etc/zabbix_$(2).conf \
  111. $(1)/etc/
  112. endef
  113. define Package/zabbix/install/init.d
  114. $(INSTALL_DIR) \
  115. $(1)/etc/init.d
  116. $(INSTALL_BIN) \
  117. ./files/zabbix_$(2).init \
  118. $(1)/etc/init.d/zabbix_$(2)
  119. endef
  120. define Package/zabbix/install/zabbix.conf.d
  121. $(INSTALL_DIR) \
  122. $(1)/etc/zabbix_agentd.conf.d
  123. $(INSTALL_BIN) \
  124. ./files/$(2) \
  125. $(1)/etc/zabbix_agentd.conf.d/$(2)
  126. endef
  127. define Package/zabbix-agent/conffiles
  128. /etc/zabbix_agent.conf
  129. endef
  130. define Package/zabbix-agentd/conffiles
  131. /etc/zabbix_agentd.conf
  132. endef
  133. define Package/zabbix-server/conffiles
  134. /etc/zabbix_server.conf
  135. endef
  136. define Package/zabbix-proxy/conffiles
  137. /etc/zabbix_proxy.conf
  138. endef
  139. ifdef CONFIG_PACKAGE_zabbix-extra-mac80211
  140. define Build/Prepare/zabbix-extra-mac80211
  141. mkdir -p $(PKG_BUILD_DIR)/zabbix-extra-mac80211
  142. $(CP) ./files/zabbix_helper_mac80211.c $(PKG_BUILD_DIR)/zabbix-extra-mac80211/
  143. endef
  144. define Build/Compile/zabbix-extra-mac80211
  145. $(TARGET_CC) $(TARGET_CFLAGS) $(PKG_BUILD_DIR)/zabbix-extra-mac80211/zabbix_helper_mac80211.c -o $(PKG_BUILD_DIR)/zabbix-extra-mac80211/zabbix_helper_mac80211
  146. endef
  147. endif
  148. define Build/Prepare
  149. $(call Build/Prepare/Default)
  150. $(call Build/Prepare/zabbix-extra-mac80211)
  151. endef
  152. define Build/Compile
  153. $(call Build/Compile/Default)
  154. $(call Build/Compile/zabbix-extra-mac80211)
  155. endef
  156. define Package/zabbix-agent/install
  157. $(call Package/zabbix/install/sbin,$(1),agent)
  158. $(call Package/zabbix/install/etc,$(1),agent)
  159. endef
  160. define Package/zabbix-agentd/install
  161. $(INSTALL_DIR) $(1)/etc/zabbix_agentd.conf.d
  162. $(call Package/zabbix/install/sbin,$(1),agentd)
  163. $(call Package/zabbix/install/etc,$(1),agentd)
  164. $(call Package/zabbix/install/init.d,$(1),agentd)
  165. endef
  166. define Package/zabbix-extra-mac80211/install
  167. $(call Package/zabbix/install/zabbix.conf.d,$(1),mac80211)
  168. $(INSTALL_DIR) $(1)/usr/bin
  169. $(INSTALL_BIN) $(PKG_BUILD_DIR)/zabbix-extra-mac80211/zabbix_helper_mac80211 $(1)/usr/bin/
  170. chmod 4755 $(1)/usr/bin/zabbix_helper_mac80211
  171. endef
  172. define Package/zabbix-extra-network/install
  173. $(call Package/zabbix/install/zabbix.conf.d,$(1),network)
  174. endef
  175. define Package/zabbix-extra-wifi/install
  176. $(call Package/zabbix/install/zabbix.conf.d,$(1),wifi)
  177. endef
  178. define Package/zabbix-sender/install
  179. $(call Package/zabbix/install/bin,$(1),sender)
  180. endef
  181. define Package/zabbix-get/install
  182. $(call Package/zabbix/install/bin,$(1),get)
  183. endef
  184. define Package/zabbix-server/install
  185. $(call Package/zabbix/install/sbin,$(1),server)
  186. $(call Package/zabbix/install/etc,$(1),server)
  187. endef
  188. define Package/zabbix-proxy/install
  189. $(call Package/zabbix/install/sbin,$(1),proxy)
  190. $(call Package/zabbix/install/etc,$(1),proxy)
  191. endef
  192. $(eval $(call BuildPackage,zabbix-agent))
  193. $(eval $(call BuildPackage,zabbix-agentd))
  194. $(eval $(call BuildPackage,zabbix-extra-mac80211))
  195. $(eval $(call BuildPackage,zabbix-extra-network))
  196. $(eval $(call BuildPackage,zabbix-extra-wifi))
  197. $(eval $(call BuildPackage,zabbix-sender))
  198. $(eval $(call BuildPackage,zabbix-server))
  199. $(eval $(call BuildPackage,zabbix-proxy))
  200. $(eval $(call BuildPackage,zabbix-get))