Merge pull request #7213 from gladiac1337/feature-haproxy-v1.8.14-updates
[feed/packages.git] / utils / collectd / Makefile
1 #
2 # Copyright (C) 2006-2016 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=collectd
11 PKG_VERSION:=5.8.1
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=https://collectd.org/files/ \
16 https://github.com/collectd/collectd/releases/download/collectd-$(PKG_VERSION)
17 PKG_HASH:=e796fda27ce06377f491ad91aa286962a68c2b54076aa77a29673d53204453da
18
19 PKG_FIXUP:=autoreconf
20 PKG_REMOVE_FILES:=aclocal.m4 libltdl/aclocal.m4
21 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>, Hannu Nyman <hannu.nyman@iki.fi>
22
23 PKG_INSTALL:=1
24 PKG_BUILD_PARALLEL:=1
25 PKG_USE_MIPS16:=0
26
27 COLLECTD_PLUGINS_DISABLED:= \
28 amqp \
29 apple_sensors \
30 aquaero \
31 barometer \
32 battery \
33 ceph \
34 cgroups \
35 cpusleep \
36 curl_json \
37 curl_xml \
38 dbi \
39 dpdkevents \
40 dpdkstat \
41 drbd \
42 ethstat \
43 fhcount \
44 genericjmx \
45 gmond \
46 gps \
47 grpc \
48 hddtemp \
49 hugepages \
50 intel_pmu \
51 intel_rdt \
52 ipc \
53 ipmi \
54 ipvs \
55 java \
56 log_logstash \
57 lua \
58 lvm \
59 lpar \
60 madwifi \
61 mbmon \
62 mcelog \
63 md \
64 memcachec \
65 memcached \
66 mic \
67 monitorus \
68 multimeter \
69 netapp \
70 nfs \
71 notify_desktop \
72 notify_email \
73 notify_nagios \
74 numa \
75 openldap \
76 openvz \
77 oracle \
78 ovs_events \
79 ovs_stats \
80 perl \
81 pf \
82 pinba \
83 python \
84 redis \
85 routeros \
86 rrdcached \
87 serial \
88 sigrok \
89 smart \
90 snmp_agent \
91 statsd \
92 swap \
93 synproxy \
94 tape \
95 tokyotyrant \
96 turbostat \
97 uuid \
98 varnish \
99 virt \
100 vserver \
101 write_kafka \
102 write_log \
103 write_mongodb \
104 write_prometheus \
105 write_redis \
106 write_riemann \
107 write_sensu \
108 write_tsdb \
109 xencpu \
110 xmms \
111 zfs_arc \
112 zone \
113 zookeeper
114
115 COLLECTD_PLUGINS_SELECTED:= \
116 apache \
117 apcups \
118 ascent \
119 bind \
120 chrony \
121 conntrack \
122 contextswitch \
123 cpu \
124 cpufreq \
125 csv \
126 curl \
127 df \
128 disk \
129 dns \
130 email \
131 entropy \
132 exec \
133 filecount \
134 fscache \
135 interface \
136 iptables \
137 irq \
138 iwinfo \
139 load \
140 logfile \
141 match_empty_counter \
142 match_hashed \
143 match_regex \
144 match_timediff \
145 match_value \
146 memory \
147 modbus \
148 mqtt \
149 mysql \
150 netlink \
151 network \
152 nginx \
153 ntpd \
154 nut \
155 olsrd \
156 onewire \
157 openvpn \
158 ping \
159 postgresql \
160 powerdns \
161 processes \
162 protocols \
163 rrdtool \
164 sensors \
165 snmp \
166 syslog \
167 table \
168 tail \
169 tail_csv \
170 tcpconns \
171 teamspeak2 \
172 ted \
173 thermal \
174 unixsock \
175 uptime \
176 users \
177 vmem \
178 wireless \
179 write_graphite \
180 write_http \
181
182 PKG_CONFIG_DEPENDS:= \
183 $(patsubst %,CONFIG_PACKAGE_collectd-mod-%,$(subst _,-,$(COLLECTD_PLUGINS_SELECTED))) \
184
185 include $(INCLUDE_DIR)/package.mk
186 include $(INCLUDE_DIR)/kernel.mk
187 # collectd-mod-mysql needs iconv
188 include $(INCLUDE_DIR)/nls.mk
189
190 define Package/collectd/Default
191 SECTION:=utils
192 CATEGORY:=Utilities
193 TITLE:=Lightweight system statistics collection daemon
194 URL:=https://collectd.org/
195 endef
196
197 define Package/collectd
198 $(call Package/collectd/Default)
199 DEPENDS:= +libpthread +zlib +libltdl +libip4tc
200 MENU:=1
201 endef
202
203 define Package/collectd/description
204 collectd is a small daemon which collects system information periodically
205 and provides mechanismns to store the values in a variety of ways.
206 endef
207
208 define Package/collectd/config
209 config PACKAGE_COLLECTD_ENCRYPTED_NETWORK
210 bool "Enable ability to use encrypted networking"
211 default n
212 depends on PACKAGE_collectd
213 select PACKAGE_collectd-mod-network
214 endef
215
216 # common configure args
217 CONFIGURE_ARGS+= \
218 --disable-werror \
219 --disable-debug \
220 --enable-daemon \
221 --with-nan-emulation \
222 --with-libyajl=no \
223 --without-perl-bindings \
224 --without-libudev
225
226 CONFIGURE_VARS+= \
227 CFLAGS="$$$$CFLAGS $(FPIC)" \
228 LDFLAGS="$$$$LDFLAGS -lm -lz" \
229 KERNEL_DIR="$(LINUX_DIR)" \
230
231 ifneq ($(CONFIG_PACKAGE_COLLECTD_ENCRYPTED_NETWORK),)
232 CONFIGURE_ARGS+= \
233 --with-libgcrypt=$(STAGING_DIR)/usr
234 CONFIGURE_VARS+= \
235 GCRYPT_LIBS="-lgcrypt"
236 else
237 CONFIGURE_ARGS+= \
238 --without-libgcrypt
239 endif
240
241 CONFIGURE_PLUGIN= \
242 $(foreach m, $(1), \
243 $(if $(CONFIG_PACKAGE_collectd-mod-$(subst _,-,$(m))),--enable-$(m),--disable-$(m)) \
244 )
245
246 CONFIGURE_ARGS+= \
247 $(call CONFIGURE_PLUGIN,$(COLLECTD_PLUGINS_SELECTED)) \
248 $(call CONFIGURE_PLUGIN,$(COLLECTD_PLUGINS_DISABLED)) \
249
250 # exception: mod-ascent needs libxml2
251 ifneq ($(CONFIG_PACKAGE_collectd-mod-ascent),)
252 CONFIGURE_VARS+= \
253 CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/libxml2"
254 endif
255
256 ifneq ($(CONFIG_BIG_ENDIAN),)
257 CONFIGURE_ARGS+= --with-fp-layout=endianflip
258 else
259 CONFIGURE_ARGS+= --with-fp-layout=nothing
260 endif
261
262 ifneq ($(CONFIG_PACKAGE_collectd-mod-postgresql),)
263 CONFIGURE_ARGS+= --with-libpq="$(STAGING_DIR)/usr/"
264 endif
265
266 ifneq ($(CONFIG_PACKAGE_collectd-mod-mysql),)
267 CONFIGURE_ARGS+= --with-libmysql="$(STAGING_DIR)/usr/"
268 endif
269
270 # exception: mod-netlink needs libnetlink from iproute
271 ifneq ($(CONFIG_PACKAGE_collectd-mod-netlink),)
272 CONFIGURE_ARGS+= --with-libnetlink="$(STAGING_DIR)/usr"
273 endif
274
275 # exception: mod-modbus needs libmodbus
276 ifneq ($(CONFIG_PACKAGE_collectd-mod-modbus),)
277 CONFIGURE_ARGS+= --with-libmodbus="$(STAGING_DIR)/usr"
278 endif
279
280 # exception: mod-onewire needs libow-capi
281 ifneq ($(CONFIG_PACKAGE_collectd-mod-onewire),)
282 CONFIGURE_ARGS+= --with-libowcapi="$(STAGING_DIR)/usr"
283 endif
284
285 # exception: mod-rrdtool needs rrdtool-1.0.x
286 ifneq ($(CONFIG_PACKAGE_collectd-mod-rrdtool),)
287 CONFIGURE_ARGS+= --with-librrd="$(STAGING_DIR)/usr/lib/rrdtool-1.0"
288 endif
289
290 define Package/collectd/conffiles
291 /etc/collectd.conf
292 endef
293
294 define Package/collectd/install
295 $(INSTALL_DIR) $(1)/usr/sbin
296 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/collectd $(1)/usr/sbin/
297 $(INSTALL_DIR) $(1)/usr/share/collectd
298 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/collectd/types.db $(1)/usr/share/collectd/
299 $(INSTALL_DIR) $(1)/etc
300 $(INSTALL_CONF) ./files/collectd.conf $(1)/etc/
301 $(INSTALL_DIR) $(1)/etc/init.d
302 $(INSTALL_BIN) ./files/collectd.init $(1)/etc/init.d/collectd
303 $(INSTALL_DIR) $(1)/etc/collectd/conf.d
304 endef
305
306 # 1: plugin name
307 # 2: plugin title/description
308 # 3: files
309 # 4: extra dependency
310 define BuildPlugin
311
312 PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_collectd-mod-$(1)
313
314 define Package/collectd-mod-$(1)
315 $$(call Package/collectd/Default)
316 TITLE:=$(2) plugin
317 DEPENDS:= collectd $(4)
318 endef
319
320 define Package/collectd-mod-$(1)/install
321 $(INSTALL_DIR) $$(1)/usr/lib/collectd
322 for m in $(3); do \
323 $(CP) \
324 $(PKG_INSTALL_DIR)/usr/lib/collectd/$$$$$$$${m}.so \
325 $$(1)/usr/lib/collectd/ ; \
326 done
327 endef
328
329 $$(eval $$(call BuildPackage,collectd-mod-$(1)))
330
331 endef
332
333 $(eval $(call BuildPackage,collectd))
334
335 #$(eval $(call BuildPlugin,NAME,DESCRIPTION,FILES,DEPENDENCIES))
336 $(eval $(call BuildPlugin,apache,apache status input,apache,+PACKAGE_collectd-mod-apache:libcurl))
337 $(eval $(call BuildPlugin,apcups,apcups status input,apcups,))
338 $(eval $(call BuildPlugin,ascent,ascent status input,ascent,+PACKAGE_collectd-mod-ascent:libcurl +PACKAGE_collectd-mod-ascent:libxml2))
339 $(eval $(call BuildPlugin,bind,BIND server/zone input,bind,+PACKAGE_collectd-mod-bind:libcurl +PACKAGE_collectd-mod-bind:libxml2))
340 $(eval $(call BuildPlugin,chrony,chrony status input,chrony,))
341 $(eval $(call BuildPlugin,conntrack,connection tracking table size input,conntrack,))
342 $(eval $(call BuildPlugin,contextswitch,context switch input,contextswitch,))
343 $(eval $(call BuildPlugin,cpu,CPU input,cpu,))
344 $(eval $(call BuildPlugin,cpufreq,CPU Freq input,cpufreq,@(TARGET_x86||TARGET_x86_64||TARGET_mvebu||TARGET_ipq806x||TARGET_armvirt))) # Only enable on x86 mvebu ipq806x armvirt
345 $(eval $(call BuildPlugin,csv,CSV output,csv,))
346 $(eval $(call BuildPlugin,curl,cURL input,curl,+PACKAGE_collectd-mod-curl:libcurl))
347 #$(eval $(call BuildPlugin,dbi,relational database input,dbi,+PACKAGE_collectd-mod-dbi:libdbi))
348 $(eval $(call BuildPlugin,df,disk space input,df,))
349 $(eval $(call BuildPlugin,disk,disk usage/timing input,disk,))
350 $(eval $(call BuildPlugin,dns,DNS traffic input,dns,+PACKAGE_collectd-mod-dns:libpcap))
351 $(eval $(call BuildPlugin,email,email output,email,))
352 $(eval $(call BuildPlugin,entropy,Entropy amount input,entropy,))
353 $(eval $(call BuildPlugin,exec,process exec input,exec,))
354 $(eval $(call BuildPlugin,filecount,file count input,filecount,))
355 $(eval $(call BuildPlugin,fscache,file-system based caching framework input,fscache,))
356 $(eval $(call BuildPlugin,interface,network interfaces input,interface,))
357 $(eval $(call BuildPlugin,iptables,iptables status input,iptables,+PACKAGE_collectd-mod-iptables:iptables +libiptc))
358 $(eval $(call BuildPlugin,irq,interrupt usage input,irq,))
359 $(eval $(call BuildPlugin,iwinfo,libiwinfo wireless statistics,iwinfo,+PACKAGE_collectd-mod-iwinfo:libiwinfo))
360 $(eval $(call BuildPlugin,load,system load input,load,))
361 $(eval $(call BuildPlugin,logfile,log files output,logfile,))
362 $(eval $(call BuildPlugin,match-empty-counter,empty-counter match,match_empty_counter,))
363 $(eval $(call BuildPlugin,match-hashed,hashed match,match_hashed,))
364 $(eval $(call BuildPlugin,match-regex,regex match,match_regex,))
365 $(eval $(call BuildPlugin,match-timediff,timediff match,match_timediff,))
366 $(eval $(call BuildPlugin,match-value,value match,match_value,))
367 $(eval $(call BuildPlugin,mysql,MySQL status input,mysql,+PACKAGE_collectd-mod-mysql:libmysqlclient-r))
368 $(eval $(call BuildPlugin,memory,physical memory usage input,memory,))
369 $(eval $(call BuildPlugin,modbus,read variables through libmodbus,modbus,+PACKAGE_collectd-mod-modbus:libmodbus))
370 $(eval $(call BuildPlugin,mqtt,transmit data with MQTT,mqtt,+PACKAGE_collectd-mod-mqtt:libmosquitto))
371 $(eval $(call BuildPlugin,netlink,netlink input,netlink,+PACKAGE_collectd-mod-netlink:libmnl))
372 $(eval $(call BuildPlugin,network,network input/output,network,+PACKAGE_COLLECTD_ENCRYPTED_NETWORK:libgcrypt))
373 $(eval $(call BuildPlugin,nginx,nginx status input,nginx,+PACKAGE_collectd-mod-nginx:libcurl))
374 $(eval $(call BuildPlugin,ntpd,NTP daemon status input,ntpd,))
375 $(eval $(call BuildPlugin,nut,UPS monitoring input,nut,+PACKAGE_collectd-mod-nut:nut-common))
376 $(eval $(call BuildPlugin,olsrd,OLSRd status input,olsrd,))
377 $(eval $(call BuildPlugin,onewire,onewire sensor input,onewire,+PACKAGE_collectd-mod-onewire:libow-capi @BROKEN))
378 $(eval $(call BuildPlugin,openvpn,OpenVPN traffic/compression input,openvpn,))
379 $(eval $(call BuildPlugin,ping,ping status input,ping,+PACKAGE_collectd-mod-ping:liboping))
380 $(eval $(call BuildPlugin,postgresql,PostgreSQL status input,postgresql,+PACKAGE_collectd-mod-postgresql:libpq))
381 $(eval $(call BuildPlugin,powerdns,PowerDNS server status input,powerdns,))
382 $(eval $(call BuildPlugin,processes,process status input,processes,))
383 $(eval $(call BuildPlugin,protocols,network protocols input,protocols,))
384 $(eval $(call BuildPlugin,rrdtool,RRDtool output,rrdtool,+PACKAGE_collectd-mod-rrdtool:librrd1))
385 $(eval $(call BuildPlugin,sensors,lm_sensors input,sensors,+PACKAGE_collectd-mod-sensors:libsensors))
386 $(eval $(call BuildPlugin,snmp,SNMP input,snmp,+PACKAGE_collectd-mod-snmp:libnetsnmp))
387 $(eval $(call BuildPlugin,syslog,syslog output,syslog,))
388 $(eval $(call BuildPlugin,tail,tail input,tail,))
389 $(eval $(call BuildPlugin,tail-csv,tail CSV input,tail_csv,))
390 $(eval $(call BuildPlugin,table,table-like structured file input,table,))
391 $(eval $(call BuildPlugin,teamspeak2,TeamSpeak2 input,teamspeak2,))
392 $(eval $(call BuildPlugin,ted,The Energy Detective input,ted,))
393 $(eval $(call BuildPlugin,tcpconns,TCP connection tracking input,tcpconns,))
394 $(eval $(call BuildPlugin,thermal,system temperatures input,thermal,))
395 $(eval $(call BuildPlugin,unixsock,unix socket output,unixsock,))
396 $(eval $(call BuildPlugin,uptime,uptime status input,uptime,))
397 $(eval $(call BuildPlugin,users,user logged in status input,users,))
398 $(eval $(call BuildPlugin,vmem,virtual memory usage input,vmem,))
399 $(eval $(call BuildPlugin,wireless,wireless status input,wireless,))
400 $(eval $(call BuildPlugin,write-graphite,Carbon/Graphite output,write_graphite,+PACKAGE_collectd-mod-write-graphite:libpthread))
401 $(eval $(call BuildPlugin,write-http,HTTP POST output,write_http,+PACKAGE_collectd-mod-write-http:libcurl))