2 # Copyright (C) 2006-2016 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.bz2
15 PKG_SOURCE_URL:=http://collectd.org/files/
16 PKG_MD5SUM:=6f10633d0f73f99ef61472a8e377d4a058de161e80f3353b4b17d394c68f2f44
19 PKG_REMOVE_FILES:=aclocal.m4 libltdl/aclocal.m4
20 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>, Hannu Nyman <hannu.nyman@iki.fi>
26 COLLECTD_PLUGINS_DISABLED:= \
95 COLLECTD_PLUGINS_SELECTED:= \
156 PKG_CONFIG_DEPENDS:= \
157 $(patsubst %,CONFIG_PACKAGE_collectd-mod-%,$(subst _,-,$(COLLECTD_PLUGINS_SELECTED))) \
159 include $(INCLUDE_DIR)/package.mk
160 include $(INCLUDE_DIR)/kernel.mk
162 define Package/collectd/Default
165 TITLE:=Lightweight system statistics collection daemon
166 URL:=http://verplant.org/collectd/
169 define Package/collectd
170 $(call Package/collectd/Default)
171 DEPENDS:= +libpthread +zlib +libltdl +libip4tc
175 define Package/collectd/description
176 collectd is a small daemon which collects system information periodically
177 and provides mechanismns to store the values in a variety of ways.
180 define Package/collectd/config
181 config PACKAGE_COLLECTD_ENCRYPTED_NETWORK
182 bool "Enable ability to use encrypted networking"
184 depends on PACKAGE_collectd
185 select PACKAGE_collectd-mod-network
188 ifneq ($(CONFIG_avr32),)
189 TARGET_CFLAGS += -fsigned-char
192 # common configure args
196 --with-nan-emulation \
197 --without-perl-bindings \
200 ifneq ($(CONFIG_PACKAGE_COLLECTD_ENCRYPTED_NETWORK),)
202 --with-libgcrypt=$(STAGING_DIR)/usr/include
209 CFLAGS="$$$$CFLAGS $(FPIC)" \
210 LDFLAGS="$$$$LDFLAGS -lm -lz" \
211 KERNEL_DIR="$(LINUX_DIR)" \
215 $(if $(CONFIG_PACKAGE_collectd-mod-$(subst _,-,$(m))),--enable-$(m),--disable-$(m)) \
219 $(call CONFIGURE_PLUGIN,$(COLLECTD_PLUGINS_SELECTED)) \
220 $(call CONFIGURE_PLUGIN,$(COLLECTD_PLUGINS_DISABLED)) \
222 # exception: mod-ascent needs libxml2
223 ifneq ($(CONFIG_PACKAGE_collectd-mod-ascent),)
225 CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/libxml2"
228 ifneq ($(CONFIG_BIG_ENDIAN),)
229 CONFIGURE_ARGS+= --with-fp-layout=endianflip
231 CONFIGURE_ARGS+= --with-fp-layout=nothing
234 ifneq ($(CONFIG_PACKAGE_collectd-mod-postgresql),)
235 CONFIGURE_ARGS+= --with-libpq="$(STAGING_DIR)/usr/"
238 ifneq ($(CONFIG_PACKAGE_collectd-mod-mysql),)
239 CONFIGURE_ARGS+= --with-libmysql="$(STAGING_DIR)/usr/"
242 # exception: mod-netlink needs libnetlink from iproute
243 ifneq ($(CONFIG_PACKAGE_collectd-mod-netlink),)
244 CONFIGURE_ARGS+= --with-libnetlink="$(STAGING_DIR)/usr"
247 # exception: mod-modbus needs libmodbus
248 ifneq ($(CONFIG_PACKAGE_collectd-mod-modbus),)
249 CONFIGURE_ARGS+= --with-libmodbus="$(STAGING_DIR)/usr"
252 # exception: mod-onewire needs libow-capi
253 ifneq ($(CONFIG_PACKAGE_collectd-mod-onewire),)
254 CONFIGURE_ARGS+= --with-libowcapi="$(STAGING_DIR)/usr"
257 # exception: mod-rrdtool needs rrdtool-1.0.x
258 ifneq ($(CONFIG_PACKAGE_collectd-mod-rrdtool),)
259 CONFIGURE_ARGS+= --with-librrd="$(STAGING_DIR)/usr/lib/rrdtool-1.0"
262 define Package/collectd/conffiles
266 define Package/collectd/install
267 $(INSTALL_DIR) $(1)/usr/sbin
268 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/collectd $(1)/usr/sbin/
269 $(INSTALL_DIR) $(1)/usr/share/collectd
270 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/collectd/types.db $(1)/usr/share/collectd/
271 $(INSTALL_DIR) $(1)/etc
272 $(INSTALL_CONF) ./files/collectd.conf $(1)/etc/
273 $(INSTALL_DIR) $(1)/etc/init.d
274 $(INSTALL_BIN) ./files/collectd.init $(1)/etc/init.d/collectd
275 $(INSTALL_DIR) $(1)/etc/collectd/conf.d
279 # 2: plugin title/description
281 # 4: extra dependency
284 PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_collectd-mod-$(1)
286 define Package/collectd-mod-$(1)
287 $$(call Package/collectd/Default)
289 DEPENDS:= collectd $(4)
292 define Package/collectd-mod-$(1)/install
293 $(INSTALL_DIR) $$(1)/usr/lib/collectd
296 $(PKG_INSTALL_DIR)/usr/lib/collectd/$$$$$$$${m}.so \
297 $$(1)/usr/lib/collectd/ ; \
301 $$(eval $$(call BuildPackage,collectd-mod-$(1)))
305 $(eval $(call BuildPackage,collectd))
307 #$(eval $(call BuildPlugin,NAME,DESCRIPTION,FILES,DEPENDENCIES))
308 $(eval $(call BuildPlugin,apache,apache status input,apache,+PACKAGE_collectd-mod-apache:libcurl))
309 $(eval $(call BuildPlugin,apcups,apcups status input,apcups,))
310 $(eval $(call BuildPlugin,ascent,ascent status input,ascent,+PACKAGE_collectd-mod-ascent:libcurl +PACKAGE_collectd-mod-ascent:libxml2))
311 $(eval $(call BuildPlugin,bind,BIND server/zone input,bind,+PACKAGE_collectd-mod-bind:libcurl +PACKAGE_collectd-mod-bind:libxml2))
312 $(eval $(call BuildPlugin,conntrack,connection tracking table size input,conntrack,))
313 $(eval $(call BuildPlugin,contextswitch,context switch input,contextswitch,))
314 $(eval $(call BuildPlugin,cpu,CPU input,cpu,))
315 $(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
316 $(eval $(call BuildPlugin,csv,CSV output,csv,))
317 $(eval $(call BuildPlugin,curl,cURL input,curl,+PACKAGE_collectd-mod-curl:libcurl))
318 #$(eval $(call BuildPlugin,dbi,relational database input,dbi,+PACKAGE_collectd-mod-dbi:libdbi))
319 $(eval $(call BuildPlugin,df,disk space input,df,))
320 $(eval $(call BuildPlugin,disk,disk usage/timing input,disk,))
321 $(eval $(call BuildPlugin,dns,DNS traffic input,dns,+PACKAGE_collectd-mod-dns:libpcap))
322 $(eval $(call BuildPlugin,email,email output,email,))
323 $(eval $(call BuildPlugin,entropy,Entropy amount input,entropy,))
324 $(eval $(call BuildPlugin,exec,process exec input,exec,))
325 $(eval $(call BuildPlugin,filecount,file count input,filecount,))
326 $(eval $(call BuildPlugin,fscache,file-system based caching framework input,fscache,))
327 $(eval $(call BuildPlugin,interface,network interfaces input,interface,))
328 $(eval $(call BuildPlugin,iptables,iptables status input,iptables,+PACKAGE_collectd-mod-iptables:iptables +libiptc))
329 $(eval $(call BuildPlugin,irq,interrupt usage input,irq,))
330 $(eval $(call BuildPlugin,iwinfo,libiwinfo wireless statistics,iwinfo,+PACKAGE_collectd-mod-iwinfo:libiwinfo))
331 $(eval $(call BuildPlugin,load,system load input,load,))
332 $(eval $(call BuildPlugin,logfile,log files output,logfile,))
333 $(eval $(call BuildPlugin,madwifi,MadWifi status input,madwifi,))
334 #$(eval $(call BuildPlugin,mysql,MySQL status input,mysql,+PACKAGE_collectd-mod-mysql:libmysqlclient-r))
335 $(eval $(call BuildPlugin,memory,physical memory usage input,memory,))
336 $(eval $(call BuildPlugin,modbus,read variables through libmodbus,modbus,+PACKAGE_collectd-mod-modbus:libmodbus))
337 $(eval $(call BuildPlugin,netlink,netlink input,netlink,+PACKAGE_collectd-mod-netlink:libmnl))
338 $(eval $(call BuildPlugin,network,network input/output,network,+PACKAGE_COLLECTD_ENCRYPTED_NETWORK:libgcrypt))
339 $(eval $(call BuildPlugin,nginx,nginx status input,nginx,+PACKAGE_collectd-mod-nginx:libcurl))
340 $(eval $(call BuildPlugin,ntpd,NTP daemon status input,ntpd,))
341 $(eval $(call BuildPlugin,nut,UPS monitoring input,nut,+PACKAGE_collectd-mod-nut:nut))
342 $(eval $(call BuildPlugin,olsrd,OLSRd status input,olsrd,))
343 $(eval $(call BuildPlugin,onewire,onewire sensor input,onewire,+PACKAGE_collectd-mod-onewire:libow-capi @BROKEN))
344 $(eval $(call BuildPlugin,openvpn,OpenVPN traffic/compression input,openvpn,))
345 $(eval $(call BuildPlugin,ping,ping status input,ping,+PACKAGE_collectd-mod-ping:liboping))
346 $(eval $(call BuildPlugin,postgresql,PostgreSQL status input,postgresql,+PACKAGE_collectd-mod-postgresql:libpq))
347 $(eval $(call BuildPlugin,powerdns,PowerDNS server status input,powerdns,))
348 $(eval $(call BuildPlugin,processes,process status input,processes,))
349 $(eval $(call BuildPlugin,protocols,network protocols input,protocols,))
350 $(eval $(call BuildPlugin,rrdtool,RRDtool output,rrdtool,+PACKAGE_collectd-mod-rrdtool:librrd1))
351 $(eval $(call BuildPlugin,sensors,lm_sensors input,sensors,+PACKAGE_collectd-mod-sensors:libsensors))
352 $(eval $(call BuildPlugin,snmp,SNMP input,snmp,+PACKAGE_collectd-mod-snmp:libnetsnmp))
353 $(eval $(call BuildPlugin,syslog,syslog output,syslog,))
354 $(eval $(call BuildPlugin,tail,tail input,tail,))
355 $(eval $(call BuildPlugin,tail-csv,tail CSV input,tail_csv,))
356 $(eval $(call BuildPlugin,table,table-like structured file input,table,))
357 $(eval $(call BuildPlugin,teamspeak2,TeamSpeak2 input,teamspeak2,))
358 $(eval $(call BuildPlugin,ted,The Energy Detective input,ted,@((!TARGET_avr32)||BROKEN))) # fails on avr32 because of warnings treated as errors
359 $(eval $(call BuildPlugin,tcpconns,TCP connection tracking input,tcpconns,))
360 $(eval $(call BuildPlugin,thermal,system temperatures input,thermal,))
361 $(eval $(call BuildPlugin,unixsock,unix socket output,unixsock,))
362 $(eval $(call BuildPlugin,uptime,uptime status input,uptime,))
363 $(eval $(call BuildPlugin,users,user logged in status input,users,))
364 $(eval $(call BuildPlugin,vmem,virtual memory usage input,vmem,))
365 $(eval $(call BuildPlugin,wireless,wireless status input,wireless,))
366 $(eval $(call BuildPlugin,write-graphite,Carbon/Graphite output,write_graphite,+PACKAGE_collectd-mod-write-graphite:libpthread))
367 $(eval $(call BuildPlugin,write-http,HTTP POST output,write_http,+PACKAGE_collectd-mod-write-http:libcurl))