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.

248 lines
6.3 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:=2
  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. 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. $(call autoconf_bool,CONFIG_IPV6,ipv6) \
  90. --disable-java \
  91. --with-sqlite3="$(STAGING_DIR)/usr"
  92. MAKE_FLAGS += ARCH="linux"
  93. define Package/zabbix/install/sbin
  94. $(INSTALL_DIR) \
  95. $(1)/usr/sbin
  96. $(INSTALL_BIN) \
  97. $(PKG_INSTALL_DIR)/usr/sbin/zabbix_$(2) \
  98. $(1)/usr/sbin/
  99. endef
  100. define Package/zabbix/install/bin
  101. $(INSTALL_DIR) \
  102. $(1)/usr/bin
  103. $(INSTALL_BIN) \
  104. $(PKG_INSTALL_DIR)/usr/bin/zabbix_$(2) \
  105. $(1)/usr/bin/
  106. endef
  107. define Package/zabbix/install/etc
  108. $(INSTALL_DIR) \
  109. $(1)/etc
  110. $(INSTALL_CONF) \
  111. $(PKG_INSTALL_DIR)/etc/zabbix_$(2).conf \
  112. $(1)/etc/
  113. endef
  114. define Package/zabbix/install/init.d
  115. $(INSTALL_DIR) \
  116. $(1)/etc/init.d
  117. $(INSTALL_BIN) \
  118. ./files/zabbix_$(2).init \
  119. $(1)/etc/init.d/zabbix_$(2)
  120. endef
  121. define Package/zabbix/install/zabbix.conf.d
  122. $(INSTALL_DIR) \
  123. $(1)/etc/zabbix_agentd.conf.d
  124. $(INSTALL_BIN) \
  125. ./files/$(2) \
  126. $(1)/etc/zabbix_agentd.conf.d/$(2)
  127. endef
  128. define Package/zabbix-agent/conffiles
  129. /etc/zabbix_agent.conf
  130. endef
  131. define Package/zabbix-agentd/conffiles
  132. /etc/zabbix_agentd.conf
  133. endef
  134. define Package/zabbix-server/conffiles
  135. /etc/zabbix_server.conf
  136. endef
  137. define Package/zabbix-proxy/conffiles
  138. /etc/zabbix_proxy.conf
  139. endef
  140. ifdef CONFIG_PACKAGE_zabbix-extra-mac80211
  141. define Build/Prepare/zabbix-extra-mac80211
  142. mkdir -p $(PKG_BUILD_DIR)/zabbix-extra-mac80211
  143. $(CP) ./files/zabbix_helper_mac80211.c $(PKG_BUILD_DIR)/zabbix-extra-mac80211/
  144. endef
  145. define Build/Compile/zabbix-extra-mac80211
  146. $(TARGET_CC) $(TARGET_CFLAGS) $(PKG_BUILD_DIR)/zabbix-extra-mac80211/zabbix_helper_mac80211.c -o $(PKG_BUILD_DIR)/zabbix-extra-mac80211/zabbix_helper_mac80211
  147. endef
  148. endif
  149. define Build/Prepare
  150. $(call Build/Prepare/Default)
  151. $(call Build/Prepare/zabbix-extra-mac80211)
  152. endef
  153. define Build/Compile
  154. $(call Build/Compile/Default)
  155. $(call Build/Compile/zabbix-extra-mac80211)
  156. endef
  157. define Package/zabbix-agent/install
  158. $(call Package/zabbix/install/sbin,$(1),agent)
  159. $(call Package/zabbix/install/etc,$(1),agent)
  160. endef
  161. define Package/zabbix-agentd/install
  162. $(INSTALL_DIR) $(1)/etc/zabbix_agentd.conf.d
  163. $(call Package/zabbix/install/sbin,$(1),agentd)
  164. $(call Package/zabbix/install/etc,$(1),agentd)
  165. $(call Package/zabbix/install/init.d,$(1),agentd)
  166. endef
  167. define Package/zabbix-extra-mac80211/install
  168. $(call Package/zabbix/install/zabbix.conf.d,$(1),mac80211)
  169. $(INSTALL_DIR) $(1)/usr/bin
  170. $(INSTALL_BIN) $(PKG_BUILD_DIR)/zabbix-extra-mac80211/zabbix_helper_mac80211 $(1)/usr/bin/
  171. chmod 4755 $(1)/usr/bin/zabbix_helper_mac80211
  172. endef
  173. define Package/zabbix-extra-network/install
  174. $(call Package/zabbix/install/zabbix.conf.d,$(1),network)
  175. endef
  176. define Package/zabbix-extra-wifi/install
  177. $(call Package/zabbix/install/zabbix.conf.d,$(1),wifi)
  178. endef
  179. define Package/zabbix-sender/install
  180. $(call Package/zabbix/install/bin,$(1),sender)
  181. endef
  182. define Package/zabbix-get/install
  183. $(call Package/zabbix/install/bin,$(1),get)
  184. endef
  185. define Package/zabbix-server/install
  186. $(call Package/zabbix/install/sbin,$(1),server)
  187. $(call Package/zabbix/install/etc,$(1),server)
  188. endef
  189. define Package/zabbix-proxy/install
  190. $(call Package/zabbix/install/sbin,$(1),proxy)
  191. $(call Package/zabbix/install/etc,$(1),proxy)
  192. endef
  193. $(eval $(call BuildPackage,zabbix-agent))
  194. $(eval $(call BuildPackage,zabbix-agentd))
  195. $(eval $(call BuildPackage,zabbix-extra-mac80211))
  196. $(eval $(call BuildPackage,zabbix-extra-network))
  197. $(eval $(call BuildPackage,zabbix-extra-wifi))
  198. $(eval $(call BuildPackage,zabbix-sender))
  199. $(eval $(call BuildPackage,zabbix-server))
  200. $(eval $(call BuildPackage,zabbix-proxy))
  201. $(eval $(call BuildPackage,zabbix-get))