mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCHv4 1/4] collectd: add base functionality
@ 2015-02-05 13:18 Robert Schwebel
  2015-02-05 13:18 ` [ptxdist] [PATCHv4 2/5] collectd: add support for rrdtool plugin Robert Schwebel
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Robert Schwebel @ 2015-02-05 13:18 UTC (permalink / raw)
  To: ptxdist; +Cc: Robert Schwebel

This adds collectd, without any further plugin support so far.

The systemd unit file was derived from the example delivered with the
packet; some default options have been removed, and we don't depend
on networking.

Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
---
Changes since v3:
* use $(GLOBAL_LARGE_FILE_OPTION)
* add --without-perl-bindings
* relative link for systemd service files
* install config files

Changes since v2:
* adapted systemd unit according to review feedback

Changes since v1:
* use modern enable/disable method, similar to gstreamer

 generic/etc/collectd.conf                   |  46 ++++++
 generic/lib/systemd/system/collectd.service |   9 ++
 rules/collectd.in                           |  10 ++
 rules/collectd.make                         | 219 ++++++++++++++++++++++++++++
 4 files changed, 284 insertions(+)
 create mode 100644 generic/etc/collectd.conf
 create mode 100644 generic/lib/systemd/system/collectd.service
 create mode 100644 rules/collectd.in
 create mode 100644 rules/collectd.make

diff --git a/generic/etc/collectd.conf b/generic/etc/collectd.conf
new file mode 100644
index 0000000..400ff6d
--- /dev/null
+++ b/generic/etc/collectd.conf
@@ -0,0 +1,46 @@
+#
+# Config file for collectd(1).
+# Please read collectd.conf(5) for a list of options.
+# http://collectd.org/
+#
+
+##############################################################################
+# Global                                                                     #
+#----------------------------------------------------------------------------#
+# Global settings for the daemon.                                            #
+##############################################################################
+
+Hostname    "localhost"
+FQDNLookup  true
+BaseDir     "/var/lib/collectd"
+PIDFile     "/var/run/collectd.pid"
+PluginDir   "/usr/lib/collectd"
+TypesDB     "/usr/share/collectd/types.db"
+
+#----------------------------------------------------------------------------#
+# When enabled, plugins are loaded automatically with the default options    #
+# when an appropriate <Plugin ...> block is encountered.                     #
+# Disabled by default.                                                       #
+#----------------------------------------------------------------------------#
+AutoLoadPlugin false
+
+#----------------------------------------------------------------------------#
+# Interval at which to query values. This may be overwritten on a per-plugin #
+# base by using the 'Interval' option of the LoadPlugin block:               #
+#   <LoadPlugin foo>                                                         #
+#       Interval 60                                                          #
+#   </LoadPlugin>                                                            #
+#----------------------------------------------------------------------------#
+Interval     10
+
+Timeout      2
+ReadThreads  2
+WriteThreads 2
+
+# Limit the size of the write queue. Default is no limit. Setting up a limit is
+# recommended for servers handling a high volume of traffic.
+#WriteQueueLimitHigh 1000000
+#WriteQueueLimitLow   800000
+
+Include "/etc/collectd.d/*.conf"
+
diff --git a/generic/lib/systemd/system/collectd.service b/generic/lib/systemd/system/collectd.service
new file mode 100644
index 0000000..752245c
--- /dev/null
+++ b/generic/lib/systemd/system/collectd.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=statistics collection daemon
+
+[Service]
+ExecStart=/usr/sbin/collectd -f
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
diff --git a/rules/collectd.in b/rules/collectd.in
new file mode 100644
index 0000000..c5a29d0
--- /dev/null
+++ b/rules/collectd.in
@@ -0,0 +1,10 @@
+## SECTION=shell_and_console
+
+menuconfig COLLECTD
+	tristate
+	prompt "collectd                      "
+	help
+	  collectd is a daemon which collects system performance statistics
+	  periodically and provides mechanisms to store the values in a
+	  variety of ways, for example in RRD files.
+
diff --git a/rules/collectd.make b/rules/collectd.make
new file mode 100644
index 0000000..ec20230
--- /dev/null
+++ b/rules/collectd.make
@@ -0,0 +1,219 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2014 by Markus Pargmann <mpa@pengutronix.de>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_COLLECTD) += collectd
+
+#
+# Paths and names
+#
+COLLECTD_VERSION	:= 5.4.1
+COLLECTD		:= collectd-$(COLLECTD_VERSION)
+COLLECTD_SUFFIX		:= tar.bz2
+COLLECTD_URL		:= http://collectd.org/files/${COLLECTD}.${COLLECTD_SUFFIX}
+COLLECTD_MD5		:= 6f56c71c96573a7f4f7fb3bfab185974
+COLLECTD_DIR		:= $(BUILDDIR)/$(COLLECTD)
+COLLECTD_SOURCE		:= $(SRCDIR)/$(COLLECTD).$(COLLECTD_SUFFIX)
+COLLECTD_LICENSE	:= GPL2
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+#
+# autoconf
+#
+COLLECTD_CONF_TOOL	:= autoconf
+COLLECTD_CONF_OPT	:= $(CROSS_AUTOCONF_USR) \
+	$(GLOBAL_LARGE_FILE_OPTION) \
+	--disable-standards \
+	--disable-glibtest \
+	--disable-debug \
+	--enable-daemon \
+	--disable-getifaddrs \
+	--disable-all-plugins \
+	--with-included-ltdl \
+	--with-nan-emulation \
+	--with-fp-layout=nothing \
+	\
+	--disable-aggregation \
+	--disable-amqp \
+	--disable-apache \
+	--disable-apcups \
+	--disable-apple_sensors \
+	--disable-aquaero \
+	--disable-ascent \
+	--disable-battery \
+	--disable-bind \
+	--disable-conntrack \
+	--disable-contextswitch \
+	--disable-cpufreq \
+	--disable-cpu \
+	--disable-csv \
+	--disable-curl \
+	--disable-curl_json \
+	--disable-curl_xml \
+	--disable-cgroups \
+	--disable-dbi \
+	--disable-df \
+	--disable-disk \
+	--disable-dns \
+	--disable-email \
+	--disable-entropy \
+	--disable-ethstat \
+	--disable-exec \
+	--disable-filecount \
+	--disable-fscache \
+	--disable-gmond \
+	--disable-hddtemp \
+	--disable-interface \
+	--disable-ipmi \
+	--disable-iptables \
+	--disable-ipvs \
+	--disable-irq \
+	--disable-java \
+	--disable-libvirt \
+	--disable-load \
+	--disable-logfile \
+	--disable-lpar \
+	--disable-lvm \
+	--disable-madwifi \
+	--disable-match_empty_counter \
+	--disable-match_hashed \
+	--disable-match_regex \
+	--disable-match_timediff \
+	--disable-match_value \
+	--disable-mbmon \
+	--disable-md \
+	--disable-memcachec \
+	--disable-memcached \
+	--disable-memory \
+	--disable-mic \
+	--disable-modbus \
+	--disable-multimeter \
+	--disable-mysql \
+	--disable-netapp \
+	--disable-netlink \
+	--disable-network \
+	--disable-nfs \
+	--disable-nginx \
+	--disable-notify_desktop \
+	--disable-notify_email \
+	--disable-ntpd \
+	--disable-numa \
+	--disable-nut \
+	--disable-olsrd \
+	--disable-onewire \
+	--disable-openvpn \
+	--disable-oracle \
+	--disable-perl \
+	--disable-pf \
+	--disable-pinba \
+	--disable-ping \
+	--disable-postgresql \
+	--disable-powerdns \
+	--disable-processes \
+	--disable-protocols \
+	--disable-python \
+	--disable-redis \
+	--disable-routeros \
+	--disable-rrdcached \
+	--disable-rrdtool \
+	--disable-sensors \
+	--disable-serial \
+	--disable-sigrok \
+	--disable-snmp \
+	--disable-statsd \
+	--disable-swap \
+	--disable-syslog \
+	--disable-table \
+	--disable-tail \
+	--disable-tail_csv \
+	--disable-tape \
+	--disable-target_notification \
+	--disable-target_replace \
+	--disable-target_scale \
+	--disable-target_set \
+	--disable-target_v5upgrade \
+	--disable-tcpconns \
+	--disable-teamspeak2 \
+	--disable-ted \
+	--disable-thermal \
+	--disable-threshold \
+	--disable-tokyotyrant \
+	--disable-unixsock \
+	--disable-uptime \
+	--disable-users \
+	--disable-uuid \
+	--disable-varnish \
+	--disable-vmem \
+	--disable-vserver \
+	--disable-wireless \
+	--disable-write_graphite \
+	--disable-write_http \
+	--disable-write_mongodb \
+	--disable-write_redis \
+	--disable-write_riemann \
+	--disable-xmms \
+	--disable-zfs_arc \
+	--without-perl-bindings
+
+ifneq ($(call remove_quotes,$(COLLECTD_ENABLE-y)),)
+COLLECTD_CONF_OPT += --enable-$(subst $(space),$(space)--enable-,$(strip $(COLLECTD_ENABLE-y)))
+endif
+
+ifneq ($(call remove_quotes,$(COLLECTD_ENABLE-)),)
+COLLECTD_CONF_OPT += --disable-$(subst $(space),$(space)--disable-,$(strip $(COLLECTD_ENABLE-)))
+endif
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/collectd.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, collectd)
+	@$(call install_fixup, collectd, PRIORITY, optional)
+	@$(call install_fixup, collectd, SECTION, base)
+	@$(call install_fixup, collectd, AUTHOR, "Markus Pargmann <mpa@pengutronix.de>")
+	@$(call install_fixup, collectd, DESCRIPTION, missing)
+
+#	# base files + directories
+	@$(call install_lib, collectd, 0, 0, 0644, libcollectdclient)
+	@$(call install_copy, collectd, 0, 0, 0755, -, /usr/sbin/collectd)
+	@$(call install_alternative, collectd, 0, 0, 0644, /etc/collectd.conf)
+	@$(call install_copy, collectd, 0, 0, 0644, /etc/collectd)
+	@$(call install_copy, collectd, 0, 0, 0644, -, /usr/share/collectd/types.db)
+	@$(call install_copy, collectd, 0, 0, 0755, /usr/lib/collectd)
+
+
+ifdef PTXCONF_INITMETHOD_SYSTEMD
+	@$(call install_alternative, collectd, 0, 0, 0644, /lib/systemd/system/collectd.service)
+	@$(call install_link, collectd, \
+		../../../../lib/systemd/system/collectd.service, \
+		/etc/systemd/system/multi-user.target.wants/collectd.service \
+	)
+endif
+	# Plugins
+	@for plugin in $(COLLECTD_ENABLE-y); do \
+		$(call install_copy, collectd, 0, 0, 0644, -, \
+			/usr/lib/collectd/$${plugin}.so); \
+		$(call install_alternative, collectd, 0, 0, 0644, \
+			/etc/collectd.d/$${plugin}.conf); \
+	done
+
+	@$(call install_finish, collectd)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.1.4


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ptxdist] [PATCHv4 2/5] collectd: add support for rrdtool plugin
  2015-02-05 13:18 [ptxdist] [PATCHv4 1/4] collectd: add base functionality Robert Schwebel
@ 2015-02-05 13:18 ` Robert Schwebel
  2015-02-05 13:18 ` [ptxdist] [PATCHv4 3/5] collectd: add support for syslog plugin Robert Schwebel
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Robert Schwebel @ 2015-02-05 13:18 UTC (permalink / raw)
  To: ptxdist; +Cc: Robert Schwebel

Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
---
Changes since v3:
* none

Changes since v2:
* none

Changes since v1:
* use modern enable/disable method, similar to gstreamer

 generic/etc/collectd.d/rrdtool.conf | 10 ++++++++++
 rules/collectd.in                   | 13 +++++++++++++
 rules/collectd.make                 |  3 ++-
 3 files changed, 25 insertions(+), 1 deletion(-)
 create mode 100644 generic/etc/collectd.d/rrdtool.conf

diff --git a/generic/etc/collectd.d/rrdtool.conf b/generic/etc/collectd.d/rrdtool.conf
new file mode 100644
index 0000000..1f1190e
--- /dev/null
+++ b/generic/etc/collectd.d/rrdtool.conf
@@ -0,0 +1,10 @@
+LoadPlugin rrdtool
+
+<Plugin rrdtool>
+  DataDir "/var/lib/collectd/rrd"
+  CreateFilesAsync false
+  CacheTimeout 120
+  CacheFlush 900
+  WritesPerSecond 50
+</Plugin>
+
diff --git a/rules/collectd.in b/rules/collectd.in
index c5a29d0..7d2d090 100644
--- a/rules/collectd.in
+++ b/rules/collectd.in
@@ -2,9 +2,22 @@
 
 menuconfig COLLECTD
 	tristate
+	select RRDTOOL if COLLECTD_RRDTOOL
 	prompt "collectd                      "
 	help
 	  collectd is a daemon which collects system performance statistics
 	  periodically and provides mechanisms to store the values in a
 	  variety of ways, for example in RRD files.
 
+if COLLECTD
+
+comment "Write Plugins"
+
+config COLLECTD_RRDTOOL
+	bool
+	prompt "rrdtool"
+	help
+	  With the RRDtool plugin, collectd writes values into a
+	  round-robin database, using librrd.
+
+endif
diff --git a/rules/collectd.make b/rules/collectd.make
index 855cfef..37bfef0 100644
--- a/rules/collectd.make
+++ b/rules/collectd.make
@@ -29,6 +29,8 @@ COLLECTD_LICENSE	:= GPL2
 # Prepare
 # ----------------------------------------------------------------------------
 
+COLLECTD_ENABLE-$(PTXCONF_COLLECTD_RRDTOOL)	+= rrdtool
+
 #
 # autoconf
 #
@@ -127,7 +129,6 @@ COLLECTD_CONF_OPT	:= $(CROSS_AUTOCONF_USR) \
 	--disable-redis \
 	--disable-routeros \
 	--disable-rrdcached \
-	--disable-rrdtool \
 	--disable-sensors \
 	--disable-serial \
 	--disable-sigrok \
-- 
2.1.4


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ptxdist] [PATCHv4 3/5] collectd: add support for syslog plugin
  2015-02-05 13:18 [ptxdist] [PATCHv4 1/4] collectd: add base functionality Robert Schwebel
  2015-02-05 13:18 ` [ptxdist] [PATCHv4 2/5] collectd: add support for rrdtool plugin Robert Schwebel
@ 2015-02-05 13:18 ` Robert Schwebel
  2015-02-05 13:18 ` [ptxdist] [PATCHv4 4/5] collectd: add support for cpu plugin Robert Schwebel
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Robert Schwebel @ 2015-02-05 13:18 UTC (permalink / raw)
  To: ptxdist; +Cc: Robert Schwebel

Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
---
Changes since v3:
* none

Changes since v2:
* none

Changes since v1:
* use modern enable/disable method, similar to gstreamer

 generic/etc/collectd.d/syslog.conf | 6 ++++++
 rules/collectd.in                  | 8 ++++++++
 rules/collectd.make                | 2 +-
 3 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 generic/etc/collectd.d/syslog.conf

diff --git a/generic/etc/collectd.d/syslog.conf b/generic/etc/collectd.d/syslog.conf
new file mode 100644
index 0000000..bd78ae0
--- /dev/null
+++ b/generic/etc/collectd.d/syslog.conf
@@ -0,0 +1,6 @@
+LoadPlugin syslog
+
+<Plugin syslog>
+  LogLevel info
+</Plugin>
+
diff --git a/rules/collectd.in b/rules/collectd.in
index 7d2d090..a93fc56 100644
--- a/rules/collectd.in
+++ b/rules/collectd.in
@@ -11,6 +11,14 @@ menuconfig COLLECTD
 
 if COLLECTD
 
+comment "Logging Plugins"
+
+config COLLECTD_SYSLOG
+	bool
+	prompt "syslog"
+	help
+	  Syslog support for collectd.
+
 comment "Write Plugins"
 
 config COLLECTD_RRDTOOL
diff --git a/rules/collectd.make b/rules/collectd.make
index 37bfef0..8018ecf 100644
--- a/rules/collectd.make
+++ b/rules/collectd.make
@@ -29,6 +29,7 @@ COLLECTD_LICENSE	:= GPL2
 # Prepare
 # ----------------------------------------------------------------------------
 
+COLLECTD_ENABLE-$(PTXCONF_COLLECTD_SYSLOG)	+= syslog
 COLLECTD_ENABLE-$(PTXCONF_COLLECTD_RRDTOOL)	+= rrdtool
 
 #
@@ -135,7 +136,6 @@ COLLECTD_CONF_OPT	:= $(CROSS_AUTOCONF_USR) \
 	--disable-snmp \
 	--disable-statsd \
 	--disable-swap \
-	--disable-syslog \
 	--disable-table \
 	--disable-tail \
 	--disable-tail_csv \
-- 
2.1.4


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ptxdist] [PATCHv4 4/5] collectd: add support for cpu plugin
  2015-02-05 13:18 [ptxdist] [PATCHv4 1/4] collectd: add base functionality Robert Schwebel
  2015-02-05 13:18 ` [ptxdist] [PATCHv4 2/5] collectd: add support for rrdtool plugin Robert Schwebel
  2015-02-05 13:18 ` [ptxdist] [PATCHv4 3/5] collectd: add support for syslog plugin Robert Schwebel
@ 2015-02-05 13:18 ` Robert Schwebel
  2015-02-05 13:18 ` [ptxdist] [PATCHv4 5/5] collectd: add support for logfile plugin Robert Schwebel
  2015-02-06  9:10 ` [ptxdist] [PATCHv4 1/4] collectd: add base functionality Michael Olbrich
  4 siblings, 0 replies; 6+ messages in thread
From: Robert Schwebel @ 2015-02-05 13:18 UTC (permalink / raw)
  To: ptxdist; +Cc: Robert Schwebel

Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
---
Changes since v3:
* none

Changes since v2:
* none

Changes since v1:
* use modern enable/disable method, similar to gstreamer

 generic/etc/collectd.d/cpu.conf | 1 +
 rules/collectd.in               | 9 +++++++++
 rules/collectd.make             | 2 +-
 3 files changed, 11 insertions(+), 1 deletion(-)
 create mode 100644 generic/etc/collectd.d/cpu.conf

diff --git a/generic/etc/collectd.d/cpu.conf b/generic/etc/collectd.d/cpu.conf
new file mode 100644
index 0000000..30fcc38
--- /dev/null
+++ b/generic/etc/collectd.d/cpu.conf
@@ -0,0 +1 @@
+LoadPlugin cpu
diff --git a/rules/collectd.in b/rules/collectd.in
index a93fc56..1039c21 100644
--- a/rules/collectd.in
+++ b/rules/collectd.in
@@ -28,4 +28,13 @@ config COLLECTD_RRDTOOL
 	  With the RRDtool plugin, collectd writes values into a
 	  round-robin database, using librrd.
 
+comment "Read Plugins"
+
+config COLLECTD_CPU
+	bool
+	prompt "cpu"
+	help
+	  The CPU plugin collects data about what your CPU is actually doing,
+	  and if it is being idle or in the various states.
+
 endif
diff --git a/rules/collectd.make b/rules/collectd.make
index 8018ecf..a233047 100644
--- a/rules/collectd.make
+++ b/rules/collectd.make
@@ -31,6 +31,7 @@ COLLECTD_LICENSE	:= GPL2
 
 COLLECTD_ENABLE-$(PTXCONF_COLLECTD_SYSLOG)	+= syslog
 COLLECTD_ENABLE-$(PTXCONF_COLLECTD_RRDTOOL)	+= rrdtool
+COLLECTD_ENABLE-$(PTXCONF_COLLECTD_CPU)		+= cpu
 
 #
 # autoconf
@@ -60,7 +61,6 @@ COLLECTD_CONF_OPT	:= $(CROSS_AUTOCONF_USR) \
 	--disable-conntrack \
 	--disable-contextswitch \
 	--disable-cpufreq \
-	--disable-cpu \
 	--disable-csv \
 	--disable-curl \
 	--disable-curl_json \
-- 
2.1.4


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ptxdist] [PATCHv4 5/5] collectd: add support for logfile plugin
  2015-02-05 13:18 [ptxdist] [PATCHv4 1/4] collectd: add base functionality Robert Schwebel
                   ` (2 preceding siblings ...)
  2015-02-05 13:18 ` [ptxdist] [PATCHv4 4/5] collectd: add support for cpu plugin Robert Schwebel
@ 2015-02-05 13:18 ` Robert Schwebel
  2015-02-06  9:10 ` [ptxdist] [PATCHv4 1/4] collectd: add base functionality Michael Olbrich
  4 siblings, 0 replies; 6+ messages in thread
From: Robert Schwebel @ 2015-02-05 13:18 UTC (permalink / raw)
  To: ptxdist; +Cc: Robert Schwebel

Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
---
Changes since v3:
* none

Changes since v2:
* none

Changes since v1:
* use modern enable/disable method, similar to gstreamer

 generic/etc/collectd.d/logfile.conf | 9 +++++++++
 rules/collectd.in                   | 6 ++++++
 rules/collectd.make                 | 2 +-
 3 files changed, 16 insertions(+), 1 deletion(-)
 create mode 100644 generic/etc/collectd.d/logfile.conf

diff --git a/generic/etc/collectd.d/logfile.conf b/generic/etc/collectd.d/logfile.conf
new file mode 100644
index 0000000..2c7549b
--- /dev/null
+++ b/generic/etc/collectd.d/logfile.conf
@@ -0,0 +1,9 @@
+LoadPlugin logfile
+
+<Plugin logfile>
+  LogLevel info
+  File "/var/log/collectd.log"
+  Timestamp true
+  PrintSeverity false
+</Plugin>
+
diff --git a/rules/collectd.in b/rules/collectd.in
index 1039c21..bff2cb5 100644
--- a/rules/collectd.in
+++ b/rules/collectd.in
@@ -13,6 +13,12 @@ if COLLECTD
 
 comment "Logging Plugins"
 
+config COLLECTD_LOGFILE
+	bool
+	prompt "logfile"
+	help
+	  logfile support for collectd.
+
 config COLLECTD_SYSLOG
 	bool
 	prompt "syslog"
diff --git a/rules/collectd.make b/rules/collectd.make
index a233047..bb0b4e1 100644
--- a/rules/collectd.make
+++ b/rules/collectd.make
@@ -29,6 +29,7 @@ COLLECTD_LICENSE	:= GPL2
 # Prepare
 # ----------------------------------------------------------------------------
 
+COLLECTD_ENABLE-$(PTXCONF_COLLECTD_LOGFILE)	+= logfile
 COLLECTD_ENABLE-$(PTXCONF_COLLECTD_SYSLOG)	+= syslog
 COLLECTD_ENABLE-$(PTXCONF_COLLECTD_RRDTOOL)	+= rrdtool
 COLLECTD_ENABLE-$(PTXCONF_COLLECTD_CPU)		+= cpu
@@ -86,7 +87,6 @@ COLLECTD_CONF_OPT	:= $(CROSS_AUTOCONF_USR) \
 	--disable-java \
 	--disable-libvirt \
 	--disable-load \
-	--disable-logfile \
 	--disable-lpar \
 	--disable-lvm \
 	--disable-madwifi \
-- 
2.1.4


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ptxdist] [PATCHv4 1/4] collectd: add base functionality
  2015-02-05 13:18 [ptxdist] [PATCHv4 1/4] collectd: add base functionality Robert Schwebel
                   ` (3 preceding siblings ...)
  2015-02-05 13:18 ` [ptxdist] [PATCHv4 5/5] collectd: add support for logfile plugin Robert Schwebel
@ 2015-02-06  9:10 ` Michael Olbrich
  4 siblings, 0 replies; 6+ messages in thread
From: Michael Olbrich @ 2015-02-06  9:10 UTC (permalink / raw)
  To: ptxdist

On Thu, Feb 05, 2015 at 02:18:15PM +0100, Robert Schwebel wrote:
> This adds collectd, without any further plugin support so far.
> 
> The systemd unit file was derived from the example delivered with the
> packet; some default options have been removed, and we don't depend
> on networking.
> 
> Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>

Thanks, all applied.

Michael

> ---
> Changes since v3:
> * use $(GLOBAL_LARGE_FILE_OPTION)
> * add --without-perl-bindings
> * relative link for systemd service files
> * install config files
> 
> Changes since v2:
> * adapted systemd unit according to review feedback
> 
> Changes since v1:
> * use modern enable/disable method, similar to gstreamer
> 
>  generic/etc/collectd.conf                   |  46 ++++++
>  generic/lib/systemd/system/collectd.service |   9 ++
>  rules/collectd.in                           |  10 ++
>  rules/collectd.make                         | 219 ++++++++++++++++++++++++++++
>  4 files changed, 284 insertions(+)
>  create mode 100644 generic/etc/collectd.conf
>  create mode 100644 generic/lib/systemd/system/collectd.service
>  create mode 100644 rules/collectd.in
>  create mode 100644 rules/collectd.make
> 
> diff --git a/generic/etc/collectd.conf b/generic/etc/collectd.conf
> new file mode 100644
> index 0000000..400ff6d
> --- /dev/null
> +++ b/generic/etc/collectd.conf
> @@ -0,0 +1,46 @@
> +#
> +# Config file for collectd(1).
> +# Please read collectd.conf(5) for a list of options.
> +# http://collectd.org/
> +#
> +
> +##############################################################################
> +# Global                                                                     #
> +#----------------------------------------------------------------------------#
> +# Global settings for the daemon.                                            #
> +##############################################################################
> +
> +Hostname    "localhost"
> +FQDNLookup  true
> +BaseDir     "/var/lib/collectd"
> +PIDFile     "/var/run/collectd.pid"
> +PluginDir   "/usr/lib/collectd"
> +TypesDB     "/usr/share/collectd/types.db"
> +
> +#----------------------------------------------------------------------------#
> +# When enabled, plugins are loaded automatically with the default options    #
> +# when an appropriate <Plugin ...> block is encountered.                     #
> +# Disabled by default.                                                       #
> +#----------------------------------------------------------------------------#
> +AutoLoadPlugin false
> +
> +#----------------------------------------------------------------------------#
> +# Interval at which to query values. This may be overwritten on a per-plugin #
> +# base by using the 'Interval' option of the LoadPlugin block:               #
> +#   <LoadPlugin foo>                                                         #
> +#       Interval 60                                                          #
> +#   </LoadPlugin>                                                            #
> +#----------------------------------------------------------------------------#
> +Interval     10
> +
> +Timeout      2
> +ReadThreads  2
> +WriteThreads 2
> +
> +# Limit the size of the write queue. Default is no limit. Setting up a limit is
> +# recommended for servers handling a high volume of traffic.
> +#WriteQueueLimitHigh 1000000
> +#WriteQueueLimitLow   800000
> +
> +Include "/etc/collectd.d/*.conf"
> +
> diff --git a/generic/lib/systemd/system/collectd.service b/generic/lib/systemd/system/collectd.service
> new file mode 100644
> index 0000000..752245c
> --- /dev/null
> +++ b/generic/lib/systemd/system/collectd.service
> @@ -0,0 +1,9 @@
> +[Unit]
> +Description=statistics collection daemon
> +
> +[Service]
> +ExecStart=/usr/sbin/collectd -f
> +Restart=always
> +
> +[Install]
> +WantedBy=multi-user.target
> diff --git a/rules/collectd.in b/rules/collectd.in
> new file mode 100644
> index 0000000..c5a29d0
> --- /dev/null
> +++ b/rules/collectd.in
> @@ -0,0 +1,10 @@
> +## SECTION=shell_and_console
> +
> +menuconfig COLLECTD
> +	tristate
> +	prompt "collectd                      "
> +	help
> +	  collectd is a daemon which collects system performance statistics
> +	  periodically and provides mechanisms to store the values in a
> +	  variety of ways, for example in RRD files.
> +
> diff --git a/rules/collectd.make b/rules/collectd.make
> new file mode 100644
> index 0000000..ec20230
> --- /dev/null
> +++ b/rules/collectd.make
> @@ -0,0 +1,219 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2014 by Markus Pargmann <mpa@pengutronix.de>
> +#
> +# See CREDITS for details about who has contributed to this project.
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +PACKAGES-$(PTXCONF_COLLECTD) += collectd
> +
> +#
> +# Paths and names
> +#
> +COLLECTD_VERSION	:= 5.4.1
> +COLLECTD		:= collectd-$(COLLECTD_VERSION)
> +COLLECTD_SUFFIX		:= tar.bz2
> +COLLECTD_URL		:= http://collectd.org/files/${COLLECTD}.${COLLECTD_SUFFIX}
> +COLLECTD_MD5		:= 6f56c71c96573a7f4f7fb3bfab185974
> +COLLECTD_DIR		:= $(BUILDDIR)/$(COLLECTD)
> +COLLECTD_SOURCE		:= $(SRCDIR)/$(COLLECTD).$(COLLECTD_SUFFIX)
> +COLLECTD_LICENSE	:= GPL2
> +
> +# ----------------------------------------------------------------------------
> +# Prepare
> +# ----------------------------------------------------------------------------
> +
> +#
> +# autoconf
> +#
> +COLLECTD_CONF_TOOL	:= autoconf
> +COLLECTD_CONF_OPT	:= $(CROSS_AUTOCONF_USR) \
> +	$(GLOBAL_LARGE_FILE_OPTION) \
> +	--disable-standards \
> +	--disable-glibtest \
> +	--disable-debug \
> +	--enable-daemon \
> +	--disable-getifaddrs \
> +	--disable-all-plugins \
> +	--with-included-ltdl \
> +	--with-nan-emulation \
> +	--with-fp-layout=nothing \
> +	\
> +	--disable-aggregation \
> +	--disable-amqp \
> +	--disable-apache \
> +	--disable-apcups \
> +	--disable-apple_sensors \
> +	--disable-aquaero \
> +	--disable-ascent \
> +	--disable-battery \
> +	--disable-bind \
> +	--disable-conntrack \
> +	--disable-contextswitch \
> +	--disable-cpufreq \
> +	--disable-cpu \
> +	--disable-csv \
> +	--disable-curl \
> +	--disable-curl_json \
> +	--disable-curl_xml \
> +	--disable-cgroups \
> +	--disable-dbi \
> +	--disable-df \
> +	--disable-disk \
> +	--disable-dns \
> +	--disable-email \
> +	--disable-entropy \
> +	--disable-ethstat \
> +	--disable-exec \
> +	--disable-filecount \
> +	--disable-fscache \
> +	--disable-gmond \
> +	--disable-hddtemp \
> +	--disable-interface \
> +	--disable-ipmi \
> +	--disable-iptables \
> +	--disable-ipvs \
> +	--disable-irq \
> +	--disable-java \
> +	--disable-libvirt \
> +	--disable-load \
> +	--disable-logfile \
> +	--disable-lpar \
> +	--disable-lvm \
> +	--disable-madwifi \
> +	--disable-match_empty_counter \
> +	--disable-match_hashed \
> +	--disable-match_regex \
> +	--disable-match_timediff \
> +	--disable-match_value \
> +	--disable-mbmon \
> +	--disable-md \
> +	--disable-memcachec \
> +	--disable-memcached \
> +	--disable-memory \
> +	--disable-mic \
> +	--disable-modbus \
> +	--disable-multimeter \
> +	--disable-mysql \
> +	--disable-netapp \
> +	--disable-netlink \
> +	--disable-network \
> +	--disable-nfs \
> +	--disable-nginx \
> +	--disable-notify_desktop \
> +	--disable-notify_email \
> +	--disable-ntpd \
> +	--disable-numa \
> +	--disable-nut \
> +	--disable-olsrd \
> +	--disable-onewire \
> +	--disable-openvpn \
> +	--disable-oracle \
> +	--disable-perl \
> +	--disable-pf \
> +	--disable-pinba \
> +	--disable-ping \
> +	--disable-postgresql \
> +	--disable-powerdns \
> +	--disable-processes \
> +	--disable-protocols \
> +	--disable-python \
> +	--disable-redis \
> +	--disable-routeros \
> +	--disable-rrdcached \
> +	--disable-rrdtool \
> +	--disable-sensors \
> +	--disable-serial \
> +	--disable-sigrok \
> +	--disable-snmp \
> +	--disable-statsd \
> +	--disable-swap \
> +	--disable-syslog \
> +	--disable-table \
> +	--disable-tail \
> +	--disable-tail_csv \
> +	--disable-tape \
> +	--disable-target_notification \
> +	--disable-target_replace \
> +	--disable-target_scale \
> +	--disable-target_set \
> +	--disable-target_v5upgrade \
> +	--disable-tcpconns \
> +	--disable-teamspeak2 \
> +	--disable-ted \
> +	--disable-thermal \
> +	--disable-threshold \
> +	--disable-tokyotyrant \
> +	--disable-unixsock \
> +	--disable-uptime \
> +	--disable-users \
> +	--disable-uuid \
> +	--disable-varnish \
> +	--disable-vmem \
> +	--disable-vserver \
> +	--disable-wireless \
> +	--disable-write_graphite \
> +	--disable-write_http \
> +	--disable-write_mongodb \
> +	--disable-write_redis \
> +	--disable-write_riemann \
> +	--disable-xmms \
> +	--disable-zfs_arc \
> +	--without-perl-bindings
> +
> +ifneq ($(call remove_quotes,$(COLLECTD_ENABLE-y)),)
> +COLLECTD_CONF_OPT += --enable-$(subst $(space),$(space)--enable-,$(strip $(COLLECTD_ENABLE-y)))
> +endif
> +
> +ifneq ($(call remove_quotes,$(COLLECTD_ENABLE-)),)
> +COLLECTD_CONF_OPT += --disable-$(subst $(space),$(space)--disable-,$(strip $(COLLECTD_ENABLE-)))
> +endif
> +
> +# ----------------------------------------------------------------------------
> +# Target-Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/collectd.targetinstall:
> +	@$(call targetinfo)
> +
> +	@$(call install_init, collectd)
> +	@$(call install_fixup, collectd, PRIORITY, optional)
> +	@$(call install_fixup, collectd, SECTION, base)
> +	@$(call install_fixup, collectd, AUTHOR, "Markus Pargmann <mpa@pengutronix.de>")
> +	@$(call install_fixup, collectd, DESCRIPTION, missing)
> +
> +#	# base files + directories
> +	@$(call install_lib, collectd, 0, 0, 0644, libcollectdclient)
> +	@$(call install_copy, collectd, 0, 0, 0755, -, /usr/sbin/collectd)
> +	@$(call install_alternative, collectd, 0, 0, 0644, /etc/collectd.conf)
> +	@$(call install_copy, collectd, 0, 0, 0644, /etc/collectd)
> +	@$(call install_copy, collectd, 0, 0, 0644, -, /usr/share/collectd/types.db)
> +	@$(call install_copy, collectd, 0, 0, 0755, /usr/lib/collectd)
> +
> +
> +ifdef PTXCONF_INITMETHOD_SYSTEMD
> +	@$(call install_alternative, collectd, 0, 0, 0644, /lib/systemd/system/collectd.service)
> +	@$(call install_link, collectd, \
> +		../../../../lib/systemd/system/collectd.service, \
> +		/etc/systemd/system/multi-user.target.wants/collectd.service \
> +	)
> +endif
> +	# Plugins
> +	@for plugin in $(COLLECTD_ENABLE-y); do \
> +		$(call install_copy, collectd, 0, 0, 0644, -, \
> +			/usr/lib/collectd/$${plugin}.so); \
> +		$(call install_alternative, collectd, 0, 0, 0644, \
> +			/etc/collectd.d/$${plugin}.conf); \
> +	done
> +
> +	@$(call install_finish, collectd)
> +
> +	@$(call touch)
> +
> +# vim: syntax=make
> -- 
> 2.1.4
> 
> 
> -- 
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-02-06  9:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-05 13:18 [ptxdist] [PATCHv4 1/4] collectd: add base functionality Robert Schwebel
2015-02-05 13:18 ` [ptxdist] [PATCHv4 2/5] collectd: add support for rrdtool plugin Robert Schwebel
2015-02-05 13:18 ` [ptxdist] [PATCHv4 3/5] collectd: add support for syslog plugin Robert Schwebel
2015-02-05 13:18 ` [ptxdist] [PATCHv4 4/5] collectd: add support for cpu plugin Robert Schwebel
2015-02-05 13:18 ` [ptxdist] [PATCHv4 5/5] collectd: add support for logfile plugin Robert Schwebel
2015-02-06  9:10 ` [ptxdist] [PATCHv4 1/4] collectd: add base functionality Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox