udptunnel: new package
[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:=3
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 fhcount \
43 genericjmx \
44 gmond \
45 gps \
46 grpc \
47 hddtemp \
48 hugepages \
49 intel_pmu \
50 intel_rdt \
51 ipc \
52 ipmi \
53 ipvs \
54 java \
55 log_logstash \
56 lua \
57 lvm \
58 lpar \
59 madwifi \
60 mbmon \
61 mcelog \
62 md \
63 memcachec \
64 memcached \
65 mic \
66 monitorus \
67 multimeter \
68 netapp \
69 nfs \
70 notify_desktop \
71 notify_email \
72 notify_nagios \
73 numa \
74 openldap \
75 openvz \
76 oracle \
77 ovs_events \
78 ovs_stats \
79 perl \
80 pf \
81 pinba \
82 python \
83 redis \
84 routeros \
85 rrdcached \
86 serial \
87 sigrok \
88 smart \
89 snmp_agent \
90 statsd \
91 swap \
92 synproxy \
93 tape \
94 tokyotyrant \
95 turbostat \
96 uuid \
97 varnish \
98 virt \
99 vserver \
100 write_kafka \
101 write_log \
102 write_mongodb \
103 write_prometheus \
104 write_redis \
105 write_riemann \
106 write_sensu \
107 write_tsdb \
108 xencpu \
109 xmms \
110 zfs_arc \
111 zone \
112 zookeeper
113
114 COLLECTD_PLUGINS_SELECTED:= \
115 apache \
116 apcups \
117 ascent \
118 bind \
119 chrony \
120 conntrack \
121 contextswitch \
122 cpu \
123 cpufreq \
124 csv \
125 curl \
126 df \
127 disk \
128 dns \
129 email \
130 entropy \
131 ethstat \
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,ethstat,Ethernet adapter statistics input,ethstat,))
354 $(eval $(call BuildPlugin,exec,process exec input,exec,))
355 $(eval $(call BuildPlugin,filecount,file count input,filecount,))
356 $(eval $(call BuildPlugin,fscache,file-system based caching framework input,fscache,))
357 $(eval $(call BuildPlugin,interface,network interfaces input,interface,))
358 $(eval $(call BuildPlugin,iptables,iptables status input,iptables,+PACKAGE_collectd-mod-iptables:iptables +libiptc))
359 $(eval $(call BuildPlugin,irq,interrupt usage input,irq,))
360 $(eval $(call BuildPlugin,iwinfo,libiwinfo wireless statistics,iwinfo,+PACKAGE_collectd-mod-iwinfo:libiwinfo))
361 $(eval $(call BuildPlugin,load,system load input,load,))
362 $(eval $(call BuildPlugin,logfile,log files output,logfile,))
363 $(eval $(call BuildPlugin,match-empty-counter,empty-counter match,match_empty_counter,))
364 $(eval $(call BuildPlugin,match-hashed,hashed match,match_hashed,))
365 $(eval $(call BuildPlugin,match-regex,regex match,match_regex,))
366 $(eval $(call BuildPlugin,match-timediff,timediff match,match_timediff,))
367 $(eval $(call BuildPlugin,match-value,value match,match_value,))
368 $(eval $(call BuildPlugin,mysql,MySQL status input,mysql,+PACKAGE_collectd-mod-mysql:libmysqlclient-r))
369 $(eval $(call BuildPlugin,memory,physical memory usage input,memory,))
370 $(eval $(call BuildPlugin,modbus,read variables through libmodbus,modbus,+PACKAGE_collectd-mod-modbus:libmodbus))
371 $(eval $(call BuildPlugin,mqtt,transmit data with MQTT,mqtt,+PACKAGE_collectd-mod-mqtt:libmosquitto))
372 $(eval $(call BuildPlugin,netlink,netlink input,netlink,+PACKAGE_collectd-mod-netlink:libmnl))
373 $(eval $(call BuildPlugin,network,network input/output,network,+PACKAGE_COLLECTD_ENCRYPTED_NETWORK:libgcrypt))
374 $(eval $(call BuildPlugin,nginx,nginx status input,nginx,+PACKAGE_collectd-mod-nginx:libcurl))
375 $(eval $(call BuildPlugin,ntpd,NTP daemon status input,ntpd,))
376 $(eval $(call BuildPlugin,nut,UPS monitoring input,nut,+PACKAGE_collectd-mod-nut:nut-common))
377 $(eval $(call BuildPlugin,olsrd,OLSRd status input,olsrd,))
378 $(eval $(call BuildPlugin,onewire,onewire sensor input,onewire,+PACKAGE_collectd-mod-onewire:libow-capi @BROKEN))
379 $(eval $(call BuildPlugin,openvpn,OpenVPN traffic/compression input,openvpn,))
380 $(eval $(call BuildPlugin,ping,ping status input,ping,+PACKAGE_collectd-mod-ping:liboping))
381 $(eval $(call BuildPlugin,postgresql,PostgreSQL status input,postgresql,+PACKAGE_collectd-mod-postgresql:libpq))
382 $(eval $(call BuildPlugin,powerdns,PowerDNS server status input,powerdns,))
383 $(eval $(call BuildPlugin,processes,process status input,processes,))
384 $(eval $(call BuildPlugin,protocols,network protocols input,protocols,))
385 $(eval $(call BuildPlugin,rrdtool,RRDtool output,rrdtool,+PACKAGE_collectd-mod-rrdtool:librrd1))
386 $(eval $(call BuildPlugin,sensors,lm_sensors input,sensors,+PACKAGE_collectd-mod-sensors:libsensors))
387 $(eval $(call BuildPlugin,snmp,SNMP input,snmp,+PACKAGE_collectd-mod-snmp:libnetsnmp))
388 $(eval $(call BuildPlugin,syslog,syslog output,syslog,))
389 $(eval $(call BuildPlugin,tail,tail input,tail,))
390 $(eval $(call BuildPlugin,tail-csv,tail CSV input,tail_csv,))
391 $(eval $(call BuildPlugin,table,table-like structured file input,table,))
392 $(eval $(call BuildPlugin,teamspeak2,TeamSpeak2 input,teamspeak2,))
393 $(eval $(call BuildPlugin,ted,The Energy Detective input,ted,))
394 $(eval $(call BuildPlugin,tcpconns,TCP connection tracking input,tcpconns,))
395 $(eval $(call BuildPlugin,thermal,system temperatures input,thermal,))
396 $(eval $(call BuildPlugin,unixsock,unix socket output,unixsock,))
397 $(eval $(call BuildPlugin,uptime,uptime status input,uptime,))
398 $(eval $(call BuildPlugin,users,user logged in status input,users,))
399 $(eval $(call BuildPlugin,vmem,virtual memory usage input,vmem,))
400 $(eval $(call BuildPlugin,wireless,wireless status input,wireless,))
401 $(eval $(call BuildPlugin,write-graphite,Carbon/Graphite output,write_graphite,+PACKAGE_collectd-mod-write-graphite:libpthread))
402 $(eval $(call BuildPlugin,write-http,HTTP POST output,write_http,+PACKAGE_collectd-mod-write-http:libcurl))