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.

237 lines
6.2 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:=3.4.10
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_HASH:=cdee0fd44e11ae214b2cc252974da22f3627c326ea2c61a0315af95165c52d1b
  13. PKG_SOURCE_URL:=@SF/zabbix
  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) +libpcre
  29. endef
  30. define Package/zabbix-agentd
  31. $(call Package/zabbix/Default)
  32. TITLE+= agentd
  33. endef
  34. define Package/zabbix-extra-mac80211
  35. $(call Package/zabbix/Default)
  36. TITLE+= discovery/userparameters for mac80211
  37. DEPENDS = +zabbix-agentd @PACKAGE_MAC80211_DEBUGFS @KERNEL_DEBUG_FS
  38. endef
  39. define Package/zabbix-extra-network
  40. $(call Package/zabbix/Default)
  41. TITLE+= discovery/userparameters for network
  42. DEPENDS = +zabbix-agentd +libuci-lua +lua
  43. endef
  44. define Package/zabbix-extra-wifi
  45. $(call Package/zabbix/Default)
  46. TITLE+= discovery/userparameters for wifi
  47. DEPENDS = +zabbix-agentd +libiwinfo-lua +libuci-lua +lua
  48. endef
  49. define Package/zabbix-sender
  50. $(call Package/zabbix/Default)
  51. TITLE+= sender
  52. endef
  53. define Package/zabbix-get
  54. $(call Package/zabbix/Default)
  55. TITLE+= get
  56. endef
  57. define Package/zabbix-server
  58. $(call Package/zabbix/Default)
  59. TITLE+= server
  60. DEPENDS += +pgsql-cli +libevent2
  61. endef
  62. define Package/zabbix-proxy
  63. $(call Package/zabbix/Default)
  64. TITLE+= proxy
  65. DEPENDS += +pgsql-cli
  66. endef
  67. define Package/zabbix-extra-mac80211/description
  68. An extra package for zabbix-agentd that adds a discovery rule for mac80211 wifi phy and many userparameters.
  69. It contains an suid helper to allow zabbix-agentd to still run as zabbix user and not as root.
  70. See https://openwrt.org/docs/guide-user/services/network_monitoring/zabbix for ready to use zabbix templates.
  71. endef
  72. define Package/zabbix-extra-network/description
  73. An extra package for zabbix-agentd that adds a discovery rule for openwrt network interfaces.
  74. The idea here is to discover only interfaces listed in /etc/config/network (discover br-lan and not eth0.1 and wlan0)
  75. See https://openwrt.org/docs/guide-user/services/network_monitoring/zabbix for ready to use zabbix templates.
  76. endef
  77. define Package/zabbix-extra-wifi/description
  78. An extra package for zabbix-agentd that adds a discovery rule for wifi interfaces and many userparameters.
  79. As it uses libiwinfo, it works with all wifi devices supported by openwrt.
  80. See https://openwrt.org/docs/guide-user/services/network_monitoring/zabbix for ready to use zabbix templates.
  81. endef
  82. CONFIGURE_ARGS+= \
  83. --enable-agent \
  84. --enable-server \
  85. --enable-proxy \
  86. $(call autoconf_bool,CONFIG_IPV6,ipv6) \
  87. --disable-java \
  88. --with-postgresql \
  89. --with-libevent=$(STAGING_DIR)/usr/include/libevent \
  90. --with-libpcre=$(STAGING_DIR)/usr/include
  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-agentd/conffiles
  128. /etc/zabbix_agentd.conf
  129. endef
  130. define Package/zabbix-server/conffiles
  131. /etc/zabbix_server.conf
  132. endef
  133. define Package/zabbix-proxy/conffiles
  134. /etc/zabbix_proxy.conf
  135. endef
  136. ifdef CONFIG_PACKAGE_zabbix-extra-mac80211
  137. define Build/Prepare/zabbix-extra-mac80211
  138. mkdir -p $(PKG_BUILD_DIR)/zabbix-extra-mac80211
  139. $(CP) ./files/zabbix_helper_mac80211.c $(PKG_BUILD_DIR)/zabbix-extra-mac80211/
  140. endef
  141. define Build/Compile/zabbix-extra-mac80211
  142. $(TARGET_CC) $(TARGET_CFLAGS) $(PKG_BUILD_DIR)/zabbix-extra-mac80211/zabbix_helper_mac80211.c -o $(PKG_BUILD_DIR)/zabbix-extra-mac80211/zabbix_helper_mac80211
  143. endef
  144. endif
  145. define Build/Prepare
  146. $(call Build/Prepare/Default)
  147. $(call Build/Prepare/zabbix-extra-mac80211)
  148. endef
  149. define Build/Compile
  150. $(call Build/Compile/Default)
  151. $(call Build/Compile/zabbix-extra-mac80211)
  152. endef
  153. define Package/zabbix-agentd/install
  154. $(INSTALL_DIR) $(1)/etc/zabbix_agentd.conf.d
  155. $(call Package/zabbix/install/sbin,$(1),agentd)
  156. $(call Package/zabbix/install/etc,$(1),agentd)
  157. $(call Package/zabbix/install/init.d,$(1),agentd)
  158. endef
  159. define Package/zabbix-extra-mac80211/install
  160. $(call Package/zabbix/install/zabbix.conf.d,$(1),mac80211)
  161. $(INSTALL_DIR) $(1)/usr/bin
  162. $(INSTALL_BIN) $(PKG_BUILD_DIR)/zabbix-extra-mac80211/zabbix_helper_mac80211 $(1)/usr/bin/
  163. chmod 4755 $(1)/usr/bin/zabbix_helper_mac80211
  164. endef
  165. define Package/zabbix-extra-network/install
  166. $(call Package/zabbix/install/zabbix.conf.d,$(1),network)
  167. endef
  168. define Package/zabbix-extra-wifi/install
  169. $(call Package/zabbix/install/zabbix.conf.d,$(1),wifi)
  170. endef
  171. define Package/zabbix-sender/install
  172. $(call Package/zabbix/install/bin,$(1),sender)
  173. endef
  174. define Package/zabbix-get/install
  175. $(call Package/zabbix/install/bin,$(1),get)
  176. endef
  177. define Package/zabbix-server/install
  178. $(call Package/zabbix/install/sbin,$(1),server)
  179. $(call Package/zabbix/install/etc,$(1),server)
  180. endef
  181. define Package/zabbix-proxy/install
  182. $(call Package/zabbix/install/sbin,$(1),proxy)
  183. $(call Package/zabbix/install/etc,$(1),proxy)
  184. endef
  185. $(eval $(call BuildPackage,zabbix-agentd))
  186. $(eval $(call BuildPackage,zabbix-extra-mac80211))
  187. $(eval $(call BuildPackage,zabbix-extra-network))
  188. $(eval $(call BuildPackage,zabbix-extra-wifi))
  189. $(eval $(call BuildPackage,zabbix-sender))
  190. $(eval $(call BuildPackage,zabbix-server))
  191. $(eval $(call BuildPackage,zabbix-proxy))
  192. $(eval $(call BuildPackage,zabbix-get))