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.

249 lines
6.4 KiB

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