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.

263 lines
6.9 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.14
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_HASH:=7443873cc970672d3c884230d3aeb082f2d8afcc2b757506c2d684ffdd12d77e
  13. PKG_SOURCE_URL:=@SF/zabbix
  14. PKG_LICENSE:=GPL-2.0
  15. PKG_LICENSE_FILES:=COPYING
  16. PKG_CPE_ID:=cpe:/a:zabbix:zabbix
  17. PKG_INSTALL:=1
  18. PKG_FIXUP:=autoreconf
  19. PKG_CONFIG_DEPENDS:= \
  20. CONFIG_ZABBIX_GNUTLS \
  21. CONFIG_ZABBIX_OPENSSL
  22. include $(INCLUDE_DIR)/package.mk
  23. include $(INCLUDE_DIR)/nls.mk
  24. define Package/zabbix-agentd/config
  25. comment "SSL support"
  26. choice
  27. prompt "Selected SSL library"
  28. default ZABBIX_NOSSL
  29. config ZABBIX_OPENSSL
  30. bool "OpenSSL"
  31. config ZABBIX_GNUTLS
  32. bool "GnuTLS"
  33. config ZABBIX_NOSSL
  34. bool "No SSL support"
  35. endchoice
  36. endef
  37. define Package/zabbix/Default
  38. SECTION:=admin
  39. CATEGORY:=Administration
  40. TITLE:=Zabbix
  41. URL:=https://www.zabbix.com/
  42. SUBMENU:=zabbix
  43. MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com>
  44. USERID:=zabbix=53:zabbix=53
  45. DEPENDS += $(ICONV_DEPENDS) +libpcre +ZABBIX_GNUTLS:libgnutls +ZABBIX_OPENSSL:libopenssl
  46. endef
  47. define Package/zabbix-agentd
  48. $(call Package/zabbix/Default)
  49. TITLE+= agentd
  50. endef
  51. define Package/zabbix-extra-mac80211
  52. $(call Package/zabbix/Default)
  53. TITLE+= discovery/userparameters for mac80211
  54. DEPENDS = +zabbix-agentd @PACKAGE_MAC80211_DEBUGFS @KERNEL_DEBUG_FS
  55. endef
  56. define Package/zabbix-extra-network
  57. $(call Package/zabbix/Default)
  58. TITLE+= discovery/userparameters for network
  59. DEPENDS = +zabbix-agentd +libuci-lua +lua
  60. endef
  61. define Package/zabbix-extra-wifi
  62. $(call Package/zabbix/Default)
  63. TITLE+= discovery/userparameters for wifi
  64. DEPENDS = +zabbix-agentd +libiwinfo-lua +libuci-lua +lua
  65. endef
  66. define Package/zabbix-sender
  67. $(call Package/zabbix/Default)
  68. TITLE+= sender
  69. endef
  70. define Package/zabbix-get
  71. $(call Package/zabbix/Default)
  72. TITLE+= get
  73. endef
  74. define Package/zabbix-server
  75. $(call Package/zabbix/Default)
  76. TITLE+= server
  77. DEPENDS += +pgsql-cli +libevent2
  78. endef
  79. define Package/zabbix-proxy
  80. $(call Package/zabbix/Default)
  81. TITLE+= proxy
  82. DEPENDS += +pgsql-cli
  83. endef
  84. define Package/zabbix-extra-mac80211/description
  85. An extra package for zabbix-agentd that adds a discovery rule for mac80211 wifi phy and many userparameters.
  86. It contains an suid helper to allow zabbix-agentd to still run as zabbix user and not as root.
  87. See https://openwrt.org/docs/guide-user/services/network_monitoring/zabbix for ready to use zabbix templates.
  88. endef
  89. define Package/zabbix-extra-network/description
  90. An extra package for zabbix-agentd that adds a discovery rule for openwrt network interfaces.
  91. The idea here is to discover only interfaces listed in /etc/config/network (discover br-lan and not eth0.1 and wlan0)
  92. See https://openwrt.org/docs/guide-user/services/network_monitoring/zabbix for ready to use zabbix templates.
  93. endef
  94. define Package/zabbix-extra-wifi/description
  95. An extra package for zabbix-agentd that adds a discovery rule for wifi interfaces and many userparameters.
  96. As it uses libiwinfo, it works with all wifi devices supported by openwrt.
  97. See https://openwrt.org/docs/guide-user/services/network_monitoring/zabbix for ready to use zabbix templates.
  98. endef
  99. CONFIGURE_ARGS+= \
  100. --enable-agent \
  101. --enable-server \
  102. --enable-proxy \
  103. $(call autoconf_bool,CONFIG_IPV6,ipv6) \
  104. --disable-java \
  105. --with-postgresql \
  106. --with-libevent=$(STAGING_DIR)/usr/include/libevent \
  107. --with-libpcre=$(STAGING_DIR)/usr/include \
  108. $(if $(CONFIG_ZABBIX_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr") \
  109. $(if $(CONFIG_ZABBIX_OPENSSL),--with-openssl="$(STAGING_DIR)/usr")
  110. MAKE_FLAGS += ARCH="linux"
  111. define Package/zabbix/install/sbin
  112. $(INSTALL_DIR) \
  113. $(1)/usr/sbin
  114. $(INSTALL_BIN) \
  115. $(PKG_INSTALL_DIR)/usr/sbin/zabbix_$(2) \
  116. $(1)/usr/sbin/
  117. endef
  118. define Package/zabbix/install/bin
  119. $(INSTALL_DIR) \
  120. $(1)/usr/bin
  121. $(INSTALL_BIN) \
  122. $(PKG_INSTALL_DIR)/usr/bin/zabbix_$(2) \
  123. $(1)/usr/bin/
  124. endef
  125. define Package/zabbix/install/etc
  126. $(INSTALL_DIR) \
  127. $(1)/etc
  128. $(INSTALL_CONF) \
  129. $(PKG_INSTALL_DIR)/etc/zabbix_$(2).conf \
  130. $(1)/etc/
  131. endef
  132. define Package/zabbix/install/init.d
  133. $(INSTALL_DIR) \
  134. $(1)/etc/init.d
  135. $(INSTALL_BIN) \
  136. ./files/zabbix_$(2).init \
  137. $(1)/etc/init.d/zabbix_$(2)
  138. endef
  139. define Package/zabbix/install/zabbix.conf.d
  140. $(INSTALL_DIR) \
  141. $(1)/etc/zabbix_agentd.conf.d
  142. $(INSTALL_BIN) \
  143. ./files/$(2) \
  144. $(1)/etc/zabbix_agentd.conf.d/$(2)
  145. endef
  146. define Package/zabbix-agentd/conffiles
  147. /etc/zabbix_agentd.conf
  148. endef
  149. define Package/zabbix-server/conffiles
  150. /etc/zabbix_server.conf
  151. endef
  152. define Package/zabbix-proxy/conffiles
  153. /etc/zabbix_proxy.conf
  154. endef
  155. ifdef CONFIG_PACKAGE_zabbix-extra-mac80211
  156. define Build/Prepare/zabbix-extra-mac80211
  157. mkdir -p $(PKG_BUILD_DIR)/zabbix-extra-mac80211
  158. $(CP) ./files/zabbix_helper_mac80211.c $(PKG_BUILD_DIR)/zabbix-extra-mac80211/
  159. endef
  160. define Build/Compile/zabbix-extra-mac80211
  161. $(TARGET_CC) $(TARGET_CFLAGS) $(PKG_BUILD_DIR)/zabbix-extra-mac80211/zabbix_helper_mac80211.c -o $(PKG_BUILD_DIR)/zabbix-extra-mac80211/zabbix_helper_mac80211
  162. endef
  163. endif
  164. define Build/Prepare
  165. $(call Build/Prepare/Default)
  166. $(call Build/Prepare/zabbix-extra-mac80211)
  167. endef
  168. define Build/Compile
  169. $(call Build/Compile/Default)
  170. $(call Build/Compile/zabbix-extra-mac80211)
  171. endef
  172. define Package/zabbix-agentd/install
  173. $(INSTALL_DIR) $(1)/etc/zabbix_agentd.conf.d
  174. $(call Package/zabbix/install/sbin,$(1),agentd)
  175. $(call Package/zabbix/install/etc,$(1),agentd)
  176. $(call Package/zabbix/install/init.d,$(1),agentd)
  177. endef
  178. define Package/zabbix-extra-mac80211/install
  179. $(call Package/zabbix/install/zabbix.conf.d,$(1),mac80211)
  180. $(INSTALL_DIR) $(1)/usr/bin
  181. $(INSTALL_BIN) $(PKG_BUILD_DIR)/zabbix-extra-mac80211/zabbix_helper_mac80211 $(1)/usr/bin/
  182. chmod 4755 $(1)/usr/bin/zabbix_helper_mac80211
  183. endef
  184. define Package/zabbix-extra-network/install
  185. $(call Package/zabbix/install/zabbix.conf.d,$(1),network)
  186. endef
  187. define Package/zabbix-extra-wifi/install
  188. $(call Package/zabbix/install/zabbix.conf.d,$(1),wifi)
  189. endef
  190. define Package/zabbix-sender/install
  191. $(call Package/zabbix/install/bin,$(1),sender)
  192. endef
  193. define Package/zabbix-get/install
  194. $(call Package/zabbix/install/bin,$(1),get)
  195. endef
  196. define Package/zabbix-server/install
  197. $(call Package/zabbix/install/sbin,$(1),server)
  198. $(call Package/zabbix/install/etc,$(1),server)
  199. endef
  200. define Package/zabbix-proxy/install
  201. $(call Package/zabbix/install/sbin,$(1),proxy)
  202. $(call Package/zabbix/install/etc,$(1),proxy)
  203. endef
  204. $(eval $(call BuildPackage,zabbix-agentd))
  205. $(eval $(call BuildPackage,zabbix-extra-mac80211))
  206. $(eval $(call BuildPackage,zabbix-extra-network))
  207. $(eval $(call BuildPackage,zabbix-extra-wifi))
  208. $(eval $(call BuildPackage,zabbix-sender))
  209. $(eval $(call BuildPackage,zabbix-server))
  210. $(eval $(call BuildPackage,zabbix-proxy))
  211. $(eval $(call BuildPackage,zabbix-get))