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
:=https
://collectd.org
/files
/ \
16 https
://github.com
/collectd
/collectd
/releases
/download
/collectd-
$(PKG_VERSION
)
17 PKG_HASH
:=5bae043042c19c31f77eb8464e56a01a5454e0b39fa07cf7ad0f1bfc9c3a09d6
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 PKG_CPE_ID
:=cpe
:/a
:collectd
:collectd
28 PKG_CONFIG_DEPENDS
:= \
29 PACKAGE_COLLECTD_ENCRYPTED_NETWORK \
30 PACKAGE_COLLECTD_DEBUG_OUTPUT_ENABLE
32 COLLECTD_PLUGINS_DISABLED
:= \
136 COLLECTD_PLUGINS_SELECTED
:= \
166 match_empty_counter \
212 PKG_CONFIG_DEPENDS
:= \
213 $(patsubst %,CONFIG_PACKAGE_collectd-mod-
%,$(subst _
,-,$(COLLECTD_PLUGINS_SELECTED
))) \
215 include $(INCLUDE_DIR
)/package.mk
216 include $(INCLUDE_DIR
)/kernel.mk
217 # collectd-mod-mysql needs iconv
218 include $(INCLUDE_DIR
)/nls.mk
220 define Package
/collectd
/Default
223 TITLE
:=Lightweight system statistics collection daemon
224 URL
:=https
://collectd.org
/
227 define Package
/collectd
228 $(call Package
/collectd
/Default
)
229 DEPENDS
:= +libpthread \
234 +PACKAGE_collectd-mod-lua
:liblua
238 define Package
/collectd
/description
239 collectd is a small daemon which collects system information periodically
240 and provides mechanismns to store the values in a variety of ways.
243 define Package
/collectd
/config
244 config PACKAGE_COLLECTD_ENCRYPTED_NETWORK
245 bool
"Enable ability to use encrypted networking"
247 depends on PACKAGE_collectd
248 select PACKAGE_collectd-mod-network
250 config PACKAGE_COLLECTD_DEBUG_OUTPUT_ENABLE
251 bool
"Enable debug output"
253 depends on PACKAGE_collectd
255 Enables the compiler option that collectd is compiled with
256 debugging support. This is used at development stages to
get
257 more messages from the collectd during development.
260 # common configure args
264 --with-nan-emulation \
266 --without-perl-bindings
269 CFLAGS
="$$$$CFLAGS $(FPIC)" \
270 LDFLAGS
="$$$$LDFLAGS -lm -lz" \
271 KERNEL_DIR
="$(LINUX_DIR)"
273 ifneq ($(CONFIG_PACKAGE_collectd-mod-lua
),)
275 LDFLAGS
="$$$$LDFLAGS -llua"
278 ifneq ($(CONFIG_PACKAGE_COLLECTD_ENCRYPTED_NETWORK
),)
280 --with-libgcrypt
=$(STAGING_DIR
)/usr
282 GCRYPT_LIBS
="-lgcrypt"
288 ifeq ($(CONFIG_PACKAGE_COLLECTD_DEBUG_OUTPUT_ENABLE
),y
)
298 $(if
$(CONFIG_PACKAGE_collectd-mod-
$(subst _
,-,$(m
))),--enable-
$(m
),--disable-
$(m
)) \
302 $(call CONFIGURE_PLUGIN
,$(COLLECTD_PLUGINS_SELECTED
)) \
303 $(call CONFIGURE_PLUGIN
,$(COLLECTD_PLUGINS_DISABLED
)) \
305 # exception: mod-ascent needs libxml2
306 ifneq ($(CONFIG_PACKAGE_collectd-mod-ascent
),)
308 CPPFLAGS
="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/libxml2"
311 ifneq ($(CONFIG_BIG_ENDIAN
),)
312 CONFIGURE_ARGS
+= --with-fp-layout
=endianflip
314 CONFIGURE_ARGS
+= --with-fp-layout
=nothing
317 ifneq ($(CONFIG_PACKAGE_collectd-mod-postgresql
),)
318 CONFIGURE_ARGS
+= --with-libpq
="$(STAGING_DIR)/usr/"
321 ifneq ($(CONFIG_PACKAGE_collectd-mod-mysql
),)
322 CONFIGURE_ARGS
+= --with-libmysql
="$(STAGING_DIR)/usr/"
325 # exception: mod-netlink needs libnetlink from iproute
326 ifneq ($(CONFIG_PACKAGE_collectd-mod-netlink
),)
327 CONFIGURE_ARGS
+= --with-libnetlink
="$(STAGING_DIR)/usr"
330 # exception: mod-modbus needs libmodbus
331 ifneq ($(CONFIG_PACKAGE_collectd-mod-modbus
),)
332 CONFIGURE_ARGS
+= --with-libmodbus
="$(STAGING_DIR)/usr"
335 # exception: mod-rrdtool needs rrdtool-1.0.x
336 ifneq ($(CONFIG_PACKAGE_collectd-mod-rrdtool
),)
337 CONFIGURE_ARGS
+= --with-librrd
="$(STAGING_DIR)/usr/lib/rrdtool-1.0"
340 # exception: mod-smart needs libatasmart
341 ifneq ($(CONFIG_PACKAGE_collectd-mod-smart
),)
343 --with-libatasmart
="$(STAGING_DIR)/usr" \
344 --with-libudev
="$(STAGING_DIR)/usr"
346 CONFIGURE_ARGS
+= --without-libudev
349 define Package
/collectd
/conffiles
354 define Package
/collectd
/install
355 $(INSTALL_DIR
) $(1)/usr
/sbin
356 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/collectd
$(1)/usr
/sbin
/
358 $(INSTALL_DIR
) $(1)/usr
/share
/collectd
359 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/share
/collectd
/types.db
$(1)/usr
/share
/collectd
/
361 $(INSTALL_DIR
) $(1)/etc
/init.d
362 $(INSTALL_BIN
) .
/files
/collectd.init
$(1)/etc
/init.d
/collectd
364 $(INSTALL_DIR
) $(1)/etc
/config
365 $(INSTALL_CONF
) files
/collectd.uci
$(1)/etc
/config
/collectd
369 # 2: plugin title/description
371 # 4: extra dependency
374 PKG_CONFIG_DEPENDS
+= CONFIG_PACKAGE_collectd-mod-
$(1)
376 define Package
/collectd-mod-
$(1)
377 $$(call Package
/collectd
/Default
)
379 DEPENDS
:= collectd
$(4)
382 define Package
/collectd-mod-
$(1)/install
383 $(INSTALL_DIR
) $$(1)/usr
/lib
/collectd
386 $(PKG_INSTALL_DIR
)/usr
/lib
/collectd
/$$$$$$$${m}.so \
387 $$(1)/usr
/lib
/collectd
/ ; \
389 if
[ -f .
/files
/usr
/share
/collectd
/plugin
/$(1).json
]; then \
390 $(INSTALL_DIR
) $$(1)/usr
/share
/collectd
/plugin
; \
391 $(INSTALL_DATA
) .
/files
/usr
/share
/collectd
/plugin
/$(1).json \
392 $$(1)/usr
/share
/collectd
/plugin
/$(1).json
; \
396 $$(eval
$$(call BuildPackage
,collectd-mod-
$(1)))
400 define BuildScriptPlugin
401 PKG_CONFIG_DEPENDS
+= CONFIG_PACKAGE_collectd-mod-
$(1)
403 define Package
/collectd-mod-
$(1)
404 $$(call Package
/collectd
/Default
)
409 define Package
/collectd-mod-
$(1)/install
410 $(INSTALL_DIR
) $$(1)/usr
/libexec
/collectd
413 .
/files
/exec-scripts
/$$$$$$$${m}.sh
$$(1)/usr
/libexec
/collectd
/ ; \
415 if
[ -f .
/files
/usr
/share
/collectd
/plugin
/$(1).json
]; then \
416 $(INSTALL_DIR
) $$(1)/usr
/share
/collectd
/plugin
; \
417 $(INSTALL_DATA
) .
/files
/usr
/share
/collectd
/plugin
/$(1).json \
418 $$(1)/usr
/share
/collectd
/plugin
/$(1).json
; \
422 $$(eval
$$(call BuildPackage
,collectd-mod-
$(1)))
426 $(eval
$(call BuildPackage
,collectd
))
428 #$(eval $(call BuildPlugin,NAME,DESCRIPTION,FILES,DEPENDENCIES))
429 $(eval
$(call BuildPlugin
,apache
,apache status input
,apache
,+PACKAGE_collectd-mod-apache
:libcurl
))
430 $(eval
$(call BuildPlugin
,apcups
,apcups status input
,apcups
,))
431 $(eval
$(call BuildPlugin
,ascent
,ascent status input
,ascent
,+PACKAGE_collectd-mod-ascent
:libcurl
+PACKAGE_collectd-mod-ascent
:libxml2
))
432 $(eval
$(call BuildPlugin
,bind
,BIND server
/zone input
,bind
,+PACKAGE_collectd-mod-bind
:libcurl
+PACKAGE_collectd-mod-bind
:libxml2
))
433 $(eval
$(call BuildPlugin
,chrony
,chrony status input
,chrony
,))
434 $(eval
$(call BuildPlugin
,conntrack
,connection tracking table size input
,conntrack
,))
435 $(eval
$(call BuildPlugin
,contextswitch
,context switch input
,contextswitch
,))
436 $(eval
$(call BuildPlugin
,cpu
,CPU input
,cpu
,))
437 $(eval
$(call BuildPlugin
,cpufreq
,CPU Freq input
,cpufreq
,@
(TARGET_x86||TARGET_x86_64||TARGET_mvebu||TARGET_ipq806x||TARGET_armvirt||TARGET_ipq40xx||TARGET_bcm27xx_bcm2709||TARGET_rockchip||TARGET_mediatek||TARGET_ipq807x
))) # Only enable on targets with CPUs supporting frequency scaling
438 $(eval
$(call BuildPlugin
,csv
,CSV output
,csv
,))
439 $(eval
$(call BuildPlugin
,curl
,cURL input
,curl
,+PACKAGE_collectd-mod-curl
:libcurl
))
440 #$(eval $(call BuildPlugin,dbi,relational database input,dbi,+PACKAGE_collectd-mod-dbi:libdbi))
441 $(eval
$(call BuildPlugin
,df
,disk space input
,df
,))
442 $(eval
$(call BuildPlugin
,dhcpleases
,show dhcpleases
,dhcpleases
,))
443 $(eval
$(call BuildPlugin
,disk
,disk usage
/timing input
,disk
,+PACKAGE_collectd-mod-smart
:libudev
))
444 $(eval
$(call BuildPlugin
,dns
,DNS traffic input
,dns
,+PACKAGE_collectd-mod-dns
:libpcap
))
445 $(eval
$(call BuildPlugin
,email
,email output
,email
,))
446 $(eval
$(call BuildPlugin
,entropy
,Entropy amount input
,entropy
,))
447 $(eval
$(call BuildPlugin
,ethstat
,Ethernet adapter statistics input
,ethstat
,))
448 $(eval
$(call BuildPlugin
,exec
,process exec input
,exec
,))
449 $(eval
$(call BuildPlugin
,filecount
,file count input
,filecount
,))
450 $(eval
$(call BuildPlugin
,fscache
,file-system based caching framework input
,fscache
,))
451 $(eval
$(call BuildPlugin
,interface
,network interfaces input
,interface
,))
452 $(eval
$(call BuildPlugin
,ipstatistics
,ipstatistics input
,ipstatistics
,))
453 $(eval
$(call BuildPlugin
,iptables
,iptables status input
,iptables
,+PACKAGE_collectd-mod-iptables
:iptables
+libip4tc
+libip6tc
))
454 $(eval
$(call BuildPlugin
,irq
,interrupt usage input
,irq
,))
455 $(eval
$(call BuildPlugin
,iwinfo
,libiwinfo wireless statistics
,iwinfo
,+PACKAGE_collectd-mod-iwinfo
:libiwinfo
))
456 $(eval
$(call BuildPlugin
,load
,system load input
,load
,))
457 $(eval
$(call BuildPlugin
,logfile
,log files output
,logfile
,))
458 $(eval
$(call BuildPlugin
,lua
,lua input
/output
,lua
,+PACKAGE_collectd-mod-lua
:liblua
))
459 $(eval
$(call BuildPlugin
,match-empty-counter
,empty-counter match
,match_empty_counter
,))
460 $(eval
$(call BuildPlugin
,match-hashed
,hashed match
,match_hashed
,))
461 $(eval
$(call BuildPlugin
,match-regex
,regex match
,match_regex
,))
462 $(eval
$(call BuildPlugin
,match-timediff
,timediff match
,match_timediff
,))
463 $(eval
$(call BuildPlugin
,match-value
,value match
,match_value
,))
464 $(eval
$(call BuildPlugin
,mysql
,MySQL status input
,mysql
,+PACKAGE_collectd-mod-mysql
:libmysqlclient-r
))
465 $(eval
$(call BuildPlugin
,memory
,physical memory usage input
,memory
,))
466 $(eval
$(call BuildPlugin
,modbus
,read variables through libmodbus
,modbus
,+PACKAGE_collectd-mod-modbus
:libmodbus
))
467 $(eval
$(call BuildPlugin
,mqtt
,transmit data with MQTT
,mqtt
,+PACKAGE_collectd-mod-mqtt
:libmosquitto
))
468 $(eval
$(call BuildPlugin
,netlink
,netlink input
,netlink
,+PACKAGE_collectd-mod-netlink
:libmnl
))
469 $(eval
$(call BuildPlugin
,network
,network input
/output
,network
,+PACKAGE_COLLECTD_ENCRYPTED_NETWORK
:libgcrypt
))
470 $(eval
$(call BuildPlugin
,nginx
,nginx status input
,nginx
,+PACKAGE_collectd-mod-nginx
:libcurl
))
471 $(eval
$(call BuildPlugin
,ntpd
,NTP daemon status input
,ntpd
,))
472 $(eval
$(call BuildPlugin
,nut
,UPS monitoring input
,nut
,+PACKAGE_collectd-mod-nut
:nut-common
))
473 $(eval
$(call BuildPlugin
,olsrd
,OLSRd status input
,olsrd
,))
474 $(eval
$(call BuildPlugin
,openvpn
,OpenVPN traffic
/compression input
,openvpn
,))
475 $(eval
$(call BuildPlugin
,ping
,ping status input
,ping
,+PACKAGE_collectd-mod-ping
:liboping
))
476 $(eval
$(call BuildPlugin
,postgresql
,PostgreSQL status input
,postgresql
,+PACKAGE_collectd-mod-postgresql
:libpq
))
477 $(eval
$(call BuildPlugin
,powerdns
,PowerDNS server status input
,powerdns
,))
478 $(eval
$(call BuildPlugin
,processes
,process status input
,processes
,+PACKAGE_collectd-mod-processes
:libmnl
))
479 $(eval
$(call BuildPlugin
,protocols
,network protocols input
,protocols
,))
480 $(eval
$(call BuildPlugin
,routeros
,MikroTik RouterOS input
,routeros
,+PACKAGE_collectd-mod-routeros
:librouteros
))
481 $(eval
$(call BuildPlugin
,rrdtool
,RRDtool output
,rrdtool
,+PACKAGE_collectd-mod-rrdtool
:librrd1
))
482 $(eval
$(call BuildPlugin
,sensors
,lm_sensors input
,sensors
,+PACKAGE_collectd-mod-sensors
:libsensors
))
483 $(eval
$(call BuildPlugin
,smart
,smart input
,smart
,+PACKAGE_collectd-mod-smart
:libatasmart
))
484 $(eval
$(call BuildPlugin
,snmp
,SNMP input
,snmp
,+PACKAGE_collectd-mod-snmp
:libnetsnmp
))
485 $(eval
$(call BuildPlugin
,snmp6
,snmp6 input
,snmp6
,))
486 $(eval
$(call BuildPlugin
,swap
,swap input
,swap
,))
487 $(eval
$(call BuildPlugin
,syslog
,syslog output
,syslog
,))
488 $(eval
$(call BuildPlugin
,tail
,tail input
,tail
,))
489 $(eval
$(call BuildPlugin
,tail-csv
,tail CSV input
,tail_csv
,))
490 $(eval
$(call BuildPlugin
,table
,table-like structured file input
,table
,))
491 $(eval
$(call BuildPlugin
,teamspeak2
,TeamSpeak2 input
,teamspeak2
,))
492 $(eval
$(call BuildPlugin
,ted
,The Energy Detective input
,ted
,))
493 $(eval
$(call BuildPlugin
,tcpconns
,TCP connection tracking input
,tcpconns
,))
494 $(eval
$(call BuildPlugin
,thermal
,system temperatures input
,thermal
,))
495 $(eval
$(call BuildPlugin
,threshold
,Notifications and thresholds
,threshold
,))
496 $(eval
$(call BuildPlugin
,ubi
,Unsorted block images
,ubi
,@NAND_SUPPORT
))
497 $(eval
$(call BuildPlugin
,unixsock
,unix socket output
,unixsock
,))
498 $(eval
$(call BuildPlugin
,uptime
,uptime status input
,uptime
,))
499 $(eval
$(call BuildPlugin
,users
,user logged in status input
,users
,))
500 $(eval
$(call BuildPlugin
,vmem
,virtual memory usage input
,vmem
,))
501 $(eval
$(call BuildPlugin
,wireless
,wireless status input
,wireless
,))
502 $(eval
$(call BuildPlugin
,write-graphite
,Carbon
/Graphite output
,write_graphite
,+PACKAGE_collectd-mod-write-graphite
:libpthread
))
503 $(eval
$(call BuildPlugin
,write-http
,HTTP POST output
,write_http
,+PACKAGE_collectd-mod-write-http
:libcurl
))
505 $(eval
$(call BuildScriptPlugin
,sqm
,SQM
/qdisc collection
,sqm_collectd
,+PACKAGE_collectd-mod-sqm
:collectd-mod-exec
))