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.

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