From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0] ident=Debian-exim) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1YG0oT-0001lL-RE for ptxdist@pengutronix.de; Tue, 27 Jan 2015 08:43:53 +0100 Received: from mol by ptx.hi.pengutronix.de with local (Exim 4.80) (envelope-from ) id 1YG0oT-0004qy-Pa for ptxdist@pengutronix.de; Tue, 27 Jan 2015 08:43:53 +0100 Date: Tue, 27 Jan 2015 08:43:53 +0100 From: Michael Olbrich Message-ID: <20150127074353.GB5565@pengutronix.de> References: <1422310392-18538-1-git-send-email-r.schwebel@pengutronix.de> <1422310392-18538-6-git-send-email-r.schwebel@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1422310392-18538-6-git-send-email-r.schwebel@pengutronix.de> Subject: Re: [ptxdist] [PATCHv2 06/10] collectd: add base functionality Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de On Mon, Jan 26, 2015 at 11:13:08PM +0100, Robert Schwebel wrote: > This adds collectd, without any further plugin support so far. > > Signed-off-by: Robert Schwebel > --- > Changes since v1: > * use modern enable/disable method, similar to gstreamer > > generic/etc/collectd.conf | 46 ++++++ > generic/lib/systemd/system/collectd.service | 15 ++ > rules/collectd.in | 10 ++ > rules/collectd.make | 216 ++++++++++++++++++++++++++++ > 4 files changed, 287 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 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: # > +# # > +# Interval 60 # > +# # > +#----------------------------------------------------------------------------# > +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..53eb5db > --- /dev/null > +++ b/generic/lib/systemd/system/collectd.service > @@ -0,0 +1,15 @@ > +[Unit] > +Description=statistics collection daemon > +Documentation=man:collectd(1) > +After=local-fs.target network.target > +Requires=local-fs.target network.target > + > +[Service] > +ExecStart=/usr/sbin/collectd -C /etc/collectd.conf -f > +Restart=always > +RestartSec=10 > +StandardOutput=syslog > +StandardError=syslog > + > +[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..5ee4e7c > --- /dev/null > +++ b/rules/collectd.make > @@ -0,0 +1,216 @@ > +# -*-makefile-*- > +# > +# Copyright (C) 2014 by Markus Pargmann > +# > +# 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) \ > + --enable-largefile \ > + --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 > + > +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 ") > + @$(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); \ What about the config files? The first version of your patch series installed those. Michael > + 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