2 # Copyright (C) 2006-2015 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
15 PKG_SOURCE_URL
:=https
://cdn.zabbix.com
/zabbix
/sources
/stable
/5.0/
16 PKG_HASH
:=20a19e5cf2354ffcbbe24521b04becfc9875e57289c00da71999de60c4a853b6
18 PKG_MAINTAINER
:=Etienne CHAMPETIER
<champetier.etienne@gmail.com
>
20 PKG_LICENSE_FILES
:=COPYING
21 PKG_CPE_ID
:=cpe
:/a
:zabbix
:zabbix
26 PKG_CONFIG_DEPENDS
:= \
27 CONFIG_ZABBIX_GNUTLS \
28 CONFIG_ZABBIX_OPENSSL \
30 CONFIG_ZABBIX_POSTGRESQL
32 include $(INCLUDE_DIR
)/package.mk
33 include $(INCLUDE_DIR
)/nls.mk
35 define Package
/zabbix-agentd
/config
39 prompt
"Selected SSL library"
54 define Package
/zabbix-server
/config
55 comment
"Database Software"
58 prompt
"Selected Database Software"
59 default ZABBIX_POSTGRESQL
64 config ZABBIX_POSTGRESQL
70 define Package
/zabbix
/Default
72 CATEGORY
:=Administration
75 URL
:=https
://www.zabbix.com
/
76 USERID
:=zabbix
=53:zabbix
=53
77 DEPENDS
+= $(ICONV_DEPENDS
) +libpcre
+zlib
+ZABBIX_GNUTLS
:libgnutls
+ZABBIX_OPENSSL
:libopenssl @
!USE_UCLIBC
80 define Package
/zabbix-agentd
81 $(call Package
/zabbix
/Default
)
85 define Package
/zabbix-extra-mac80211
86 $(call Package
/zabbix
/Default
)
87 TITLE
+= discovery
/userparameters for mac80211
88 DEPENDS
= +zabbix-agentd @PACKAGE_MAC80211_DEBUGFS @KERNEL_DEBUG_FS
91 define Package
/zabbix-extra-network
92 $(call Package
/zabbix
/Default
)
93 TITLE
+= discovery
/userparameters for network
94 DEPENDS
= +zabbix-agentd
+libubus-lua
+lua
97 define Package
/zabbix-extra-wifi
98 $(call Package
/zabbix
/Default
)
99 TITLE
+= discovery
/userparameters for wifi
100 DEPENDS
= +zabbix-agentd
+libiwinfo-lua
+libubus-lua
+lua
103 define Package
/zabbix-sender
104 $(call Package
/zabbix
/Default
)
108 define Package
/zabbix-get
109 $(call Package
/zabbix
/Default
)
113 define Package
/zabbix-server
114 $(call Package
/zabbix
/Default
)
116 DEPENDS
+= +ZABBIX_POSTGRESQL
:libpq
+ZABBIX_MYSQL
:libmariadbclient
+libevent2
119 define Package
/zabbix-server-frontend
120 $(call Package
/zabbix
/Default
)
121 TITLE
+= server-frontend
122 DEPENDS
+= +php7
+php7-cgi
+ZABBIX_POSTGRESQL
:php7-mod-pgsql
+ZABBIX_MYSQL
:php7-mod-mysqli \
123 +php7-mod-gd
+php7-mod-bcmath
+php7-mod-ctype
+php7-mod-xmlreader
+php7-mod-xmlwriter \
124 +php7-mod-session
+php7-mod-sockets
+php7-mod-mbstring
+php7-mod-gettext
127 define Package
/zabbix-proxy
128 $(call Package
/zabbix
/Default
)
130 DEPENDS
+= +ZABBIX_POSTGRESQL
:libpq
+ZABBIX_MYSQL
:libmariadbclient
+libevent2
133 define Package
/zabbix-extra-mac80211
/description
134 An extra package for zabbix-agentd that adds a discovery rule for mac80211 wifi phy and many userparameters.
135 It contains an suid helper to allow zabbix-agentd to still run
as zabbix user and not
as root.
136 See https
://openwrt.org
/docs
/guide-user
/services
/network_monitoring
/zabbix for ready to use zabbix templates.
139 define Package
/zabbix-extra-network
/description
140 An extra package for zabbix-agentd that adds a discovery rule for openwrt network interfaces.
141 The idea here is to discover only interfaces listed in
/etc
/config
/network
(discover br-lan and not eth0.1 and wlan0
)
142 See https
://openwrt.org
/docs
/guide-user
/services
/network_monitoring
/zabbix for ready to use zabbix templates.
145 define Package
/zabbix-extra-wifi
/description
146 An extra package for zabbix-agentd that adds a discovery rule for wifi interfaces and many userparameters.
147 As it uses libiwinfo
, it works with
all wifi devices supported by openwrt.
148 See https
://openwrt.org
/docs
/guide-user
/services
/network_monitoring
/zabbix for ready to use zabbix templates.
155 $(call autoconf_bool
,CONFIG_IPV6
,ipv6
) \
157 $(if
$(CONFIG_ZABBIX_MYSQL
),--with-mysql
) \
158 $(if
$(CONFIG_ZABBIX_POSTGRESQL
),--with-postgresql
) \
159 --with-libevent
=$(STAGING_DIR
)/usr
/include/libevent \
160 --with-libpcre
=$(STAGING_DIR
)/usr
/include \
161 --with-zlib
=$(STAGING_DIR
)/usr
/include \
162 $(if
$(CONFIG_ZABBIX_GNUTLS
),--with-gnutls
="$(STAGING_DIR)/usr") \
163 $(if
$(CONFIG_ZABBIX_OPENSSL
),--with-openssl
="$(STAGING_DIR)/usr")
166 ac_cv_header_sys_sysinfo_h
=no
168 MAKE_FLAGS
+= ARCH
="linux"
170 define Package
/zabbix
/install/sbin
175 $(PKG_INSTALL_DIR
)/usr
/sbin
/zabbix_
$(2) \
179 define Package
/zabbix
/install/bin
184 $(PKG_INSTALL_DIR
)/usr
/bin
/zabbix_
$(2) \
188 define Package
/zabbix
/install/etc
193 $(PKG_INSTALL_DIR
)/etc
/zabbix_
$(2).conf \
197 define Package
/zabbix
/install/init.d
202 .
/files
/zabbix_
$(2).init \
203 $(1)/etc
/init.d
/zabbix_
$(2)
206 define Package
/zabbix
/install/zabbix.conf.d
208 $(1)/etc
/zabbix_agentd.conf.d
212 $(1)/etc
/zabbix_agentd.conf.d
/$(2)
215 define Package
/zabbix-agentd
/conffiles
216 /etc
/zabbix_agentd.conf
218 define Package
/zabbix-server
/conffiles
219 /etc
/zabbix_server.conf
221 define Package
/zabbix-proxy
/conffiles
222 /etc
/zabbix_proxy.conf
225 ifdef CONFIG_PACKAGE_zabbix-extra-mac80211
226 define Build
/Prepare
/zabbix-extra-mac80211
227 mkdir
-p
$(PKG_BUILD_DIR
)/zabbix-extra-mac80211
228 $(CP
) .
/files
/zabbix_helper_mac80211.c
$(PKG_BUILD_DIR
)/zabbix-extra-mac80211
/
231 define Build
/Compile
/zabbix-extra-mac80211
232 $(TARGET_CC
) $(TARGET_CFLAGS
) $(PKG_BUILD_DIR
)/zabbix-extra-mac80211
/zabbix_helper_mac80211.c
-o
$(PKG_BUILD_DIR
)/zabbix-extra-mac80211
/zabbix_helper_mac80211
237 $(call Build
/Prepare
/Default
)
238 $(call Build
/Prepare
/zabbix-extra-mac80211
)
242 $(call Build
/Compile
/Default
)
243 $(call Build
/Compile
/zabbix-extra-mac80211
)
246 define Package
/zabbix-agentd
/install
247 $(INSTALL_DIR
) $(1)/etc
/zabbix_agentd.conf.d
248 $(call Package
/zabbix
/install/sbin
,$(1),agentd
)
249 $(call Package
/zabbix
/install/etc
,$(1),agentd
)
250 $(call Package
/zabbix
/install/init.d
,$(1),agentd
)
253 define Package
/zabbix-extra-mac80211
/install
254 $(call Package
/zabbix
/install/zabbix.conf.d
,$(1),mac80211
)
255 $(INSTALL_DIR
) $(1)/usr
/bin
256 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/zabbix-extra-mac80211
/zabbix_helper_mac80211
$(1)/usr
/bin
/
257 chmod
4755 $(1)/usr
/bin
/zabbix_helper_mac80211
260 define Package
/zabbix-extra-network
/install
261 $(call Package
/zabbix
/install/zabbix.conf.d
,$(1),network
)
262 $(INSTALL_DIR
) $(1)/usr
/share
/acl.d
263 $(INSTALL_DATA
) .
/files
/zabbix-network-ubus-acl.json
$(1)/usr
/share
/acl.d
/zabbix-network.json
266 define Package
/zabbix-extra-network
/postinst
268 if
[ -z
"$${IPKG_INSTROOT}" ]; then
273 define Package
/zabbix-extra-wifi
/install
274 $(call Package
/zabbix
/install/zabbix.conf.d
,$(1),wifi
)
275 $(INSTALL_DIR
) $(1)/usr
/share
/acl.d
276 $(INSTALL_DATA
) .
/files
/zabbix-wifi-ubus-acl.json
$(1)/usr
/share
/acl.d
/zabbix-wifi.json
279 define Package
/zabbix-extra-wifi
/postinst
281 if
[ -z
"$${IPKG_INSTROOT}" ]; then
286 define Package
/zabbix-sender
/install
287 $(call Package
/zabbix
/install/bin
,$(1),sender
)
290 define Package
/zabbix-get
/install
291 $(call Package
/zabbix
/install/bin
,$(1),get)
294 define Package
/zabbix-server
/install
295 $(call Package
/zabbix
/install/sbin
,$(1),server
)
296 $(call Package
/zabbix
/install/etc
,$(1),server
)
299 define Package
/zabbix-server-frontend
/install
300 $(INSTALL_DIR
) $(1)/www
/zabbix
301 $(CP
) $(PKG_BUILD_DIR
)/ui
/* $(1)/www
/zabbix
304 define Package
/zabbix-proxy
/install
305 $(call Package
/zabbix
/install/sbin
,$(1),proxy
)
306 $(call Package
/zabbix
/install/etc
,$(1),proxy
)
309 $(eval
$(call BuildPackage
,zabbix-agentd
))
310 $(eval
$(call BuildPackage
,zabbix-extra-mac80211
))
311 $(eval
$(call BuildPackage
,zabbix-extra-network
))
312 $(eval
$(call BuildPackage
,zabbix-extra-wifi
))
313 $(eval
$(call BuildPackage
,zabbix-sender
))
314 $(eval
$(call BuildPackage
,zabbix-server
))
315 $(eval
$(call BuildPackage
,zabbix-server-frontend
))
316 $(eval
$(call BuildPackage
,zabbix-proxy
))
317 $(eval
$(call BuildPackage
,zabbix-get
))