[PATCH] Add collectd

DoneSubmitted by Lars-Dominik Braun.
Details
2 participants
  • Lars-Dominik Braun
  • Ludovic Courtès
Owner
unassigned
Severity
normal
L
L
Lars-Dominik Braun wrote on 28 Apr 10:57 +0200
(address . guix-patches@gnu.org)
20200428085719.GA3395@zpidnp36
Hi,
the attached patch adds the monitoring software “collectd”. Its configurationis quite minimal right now. A lot of plugins are not enabled, because theyintroduce many external dependencies. I’m sure that can be fixed easily ifthere’s demand though.
I’ve been running the package in production for a week now without any problems(via systemd on a foreign distribution, thus no herd service).
Cheers,Lars
-----BEGIN PGP SIGNATURE-----
iQGzBAABCgAdFiEEyk+M9DfXR4/aBV/UQhN3ARo3hEYFAl6n7+sACgkQQhN3ARo3hEZ65Av/adGsMX28YmCrKFZgexCAvcuPBwyiRelGiVztVTHh0B/idip0S+cBHP0YGoE6pyPKOWc6EELgbSvrWhUVGC7zQXVaTAablN/9oBFu+J2egbxpneYv2ujLIqdwiWZ/iZLBVdCDRWBpwvHmL4Q0OK0sbNpAEzxBkXsO/4iW+NGQXc2dseCuOprtBg/K889AC5ZroTHV5iCzTL8z8lZvwM3XSK67cb8ptCaGwlcQpOC6TdP8s9CUe3gZRKVj+9jCfF5TUoE8TJBJ1z4mfaEUKuE7+jSGfUrUeqtvSG4Wl6TDL0wQPgjTuzhMFGgXuO6LYU3ED+OGyfzf5gTtQ7twUs82sypX1tXGq3qx08dNW4XpYj+W4n0vSy6KY0qlVS69awldJUwxUknqv76RuAZ4dWs5FjPdUU+4PWlQuyV/ntarW0sp91OduvHkx18znncSbaQkjdQ9nTF2ztobzSXdgNbcV3rhKCDg9LXPXnahLyU6eU9lVvFGXZzc6e9UJPC0Z1A4=eaZL-----END PGP SIGNATURE-----

L
L
Lars-Dominik Braun wrote on 28 Apr 11:29 +0200
(address . 40925@debbugs.gnu.org)
20200428092938.GB3395@zpidnp36
Hi,
totally forgot to attach the patch. Here it is.
Lars
From 05110cd7f0af5f870daa48a1e32bff56efb2676a Mon Sep 17 00:00:00 2001From: Lars-Dominik Braun <ldb@leibniz-psychology.org>Date: Tue, 28 Apr 2020 10:50:10 +0200Subject: [PATCH] gnu: Add collectd
* gnu/packages/monitoring.scm (collectd): New variable* gnu/local.mk (dist_patch_DATA): Add new patch* gnu/packages/patches/collectd-5.11.0-noinstallvar.patch: New file--- gnu/local.mk | 1 + gnu/packages/monitoring.scm | 45 +++++++++++++++++++ .../collectd-5.11.0-noinstallvar.patch | 19 ++++++++ 3 files changed, 65 insertions(+) create mode 100644 gnu/packages/patches/collectd-5.11.0-noinstallvar.patch
Toggle diff (116 lines)diff --git a/gnu/local.mk b/gnu/local.mkindex 9f212434a9..dea50618b0 100644--- a/gnu/local.mk+++ b/gnu/local.mk@@ -816,6 +816,7 @@ dist_patch_DATA = \ %D%/packages/patches/clucene-pkgconfig.patch \ %D%/packages/patches/cmake-curl-certificates.patch \ %D%/packages/patches/coda-use-system-libs.patch \+ %D%/packages/patches/collectd-5.11.0-noinstallvar.patch \ %D%/packages/patches/combinatorial-blas-awpm.patch \ %D%/packages/patches/combinatorial-blas-io-fix.patch \ %D%/packages/patches/containerd-test-with-go1.13.patch \diff --git a/gnu/packages/monitoring.scm b/gnu/packages/monitoring.scmindex 8da31d6a84..5a37b14328 100644--- a/gnu/packages/monitoring.scm+++ b/gnu/packages/monitoring.scm@@ -6,6 +6,7 @@ ;;; Copyright © 2018 Gábor Boskovits <boskovits@gmail.com> ;;; Copyright © 2018, 2019 Oleg Pykhalov <go.wigust@gmail.com> ;;; Copyright © 2020 Alex ter Weele <alex.ter.weele@gmail.com>+;;; Copyright © 2020 Lars-Dominik Braun <ldb@leibniz-psychology.org> ;;; ;;; This file is part of GNU Guix. ;;;@@ -32,6 +33,7 @@ #:use-module (guix build-system gnu) #:use-module (guix build-system go) #:use-module (guix utils)+ #:use-module (gnu packages) #:use-module (gnu packages admin) #:use-module (gnu packages autotools) #:use-module (gnu packages base)@@ -48,9 +50,11 @@ #:use-module (gnu packages libevent) #:use-module (gnu packages pcre) #:use-module (gnu packages perl)+ #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz)+ #:use-module (gnu packages rrdtool) #:use-module (gnu packages time) #:use-module (gnu packages tls)) @@ -445,3 +449,44 @@ written in Go with pluggable metric collectors.") (description "This package provides a file system monitor.") (home-page "https://github.com/emcrisostomo/fswatch") (license license:gpl3+)))++(define-public collectd+ (package+ (name "collectd")+ (version "5.11.0")+ (source (origin+ (method url-fetch)+ (uri (string-append+ "https://storage.googleapis.com/collectd-tarballs/collectd-"+ version+ ".tar.bz2"))+ (sha256+ (base32+ "1cjxksxdqcqdccz1nbnc2fp6yy84qq361ynaq5q8bailds00mc9p"))+ (patches (search-patches "collectd-5.11.0-noinstallvar.patch"))))+ (build-system gnu-build-system)+ (arguments+ `(#:configure-flags (list "--localstatedir=/var" "--sysconfdir=/etc")+ #:phases+ (modify-phases %standard-phases+ ;; Required because of patched sources.+ (add-before 'configure 'autoreconf+ (lambda _ (invoke "autoreconf" "-vfi") #t)))))+ (inputs+ `(("rrdtool" ,rrdtool)+ ("curl" ,curl)))+ (native-inputs+ `(("autoconf" ,autoconf)+ ("automake" ,automake)+ ("libtool" ,libtool)+ ("pkg-config" ,pkg-config)))+ (home-page "https://collectd.org/")+ (synopsis "Collect system and application performance metrics periodically")+ (description+ "collectd gathers metrics from various sources, e.g. the operating system,+applications, logfiles and external devices, and stores this information or+makes it available over the network. Those statistics can be used to monitor+systems, find performance bottlenecks (i.e. performance analysis) and predict+future system load (i.e. capacity planning).")+ (license '(licenses:expat licenses:gpl2))))+diff --git a/gnu/packages/patches/collectd-5.11.0-noinstallvar.patch b/gnu/packages/patches/collectd-5.11.0-noinstallvar.patchnew file mode 100644index 0000000000..a8ca142147--- /dev/null+++ b/gnu/packages/patches/collectd-5.11.0-noinstallvar.patch@@ -0,0 +1,19 @@+--- a/Makefile.am 2020-03-08 16:57:09.511535600 +0100++++ b/Makefile.am 2020-04-21 11:36:49.827182272 +0200+@@ -2376,16 +2376,6 @@+ endif+ + install-exec-hook:+- $(mkinstalldirs) $(DESTDIR)$(localstatedir)/run+- $(mkinstalldirs) $(DESTDIR)$(localstatedir)/lib/$(PACKAGE_NAME)+- $(mkinstalldirs) $(DESTDIR)$(localstatedir)/log+- $(mkinstalldirs) $(DESTDIR)$(sysconfdir)+- if test -e $(DESTDIR)$(sysconfdir)/collectd.conf; \+- then \+- $(INSTALL) -m 0640 $(builddir)/src/collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf.pkg-orig; \+- else \+- $(INSTALL) -m 0640 $(builddir)/src/collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf; \+- fi; \+ $(mkinstalldirs) $(DESTDIR)$(cpkgdatadir)+ $(INSTALL) -m 0644 $(srcdir)/src/types.db $(DESTDIR)$(cpkgdatadir)/types.db;+ $(INSTALL) -m 0644 $(srcdir)/src/postgresql_default.conf \-- 2.20.1
-----BEGIN PGP SIGNATURE-----
iQGzBAABCgAdFiEEyk+M9DfXR4/aBV/UQhN3ARo3hEYFAl6n938ACgkQQhN3ARo3hEaLsgv9GEw/3pNRAqgA01KWS7qwDaEbLoOQtvcafAJOr4hacO5WiTAzEon4wi6HinOkDrQgZ53n+QijEtUMUdwrYlXzM4m8od8J5cMO0BKmv35ke3ROODwXbqZwW/39WI3HMaxF7CgfhJNHXZEvPfVObpT8+jFEiOMz37oT1RWnoc+7kMrSoUDiGdFH8OhD1Vks/Gkdijq7EWD5Aif6PGrxpfl7EOgkuUyGDH3Cj+/nmk+Sa4u5U7wiFwolfxAEdC2poLtHSfIFPiXLPyTTmyo3rAFO61fPn33bgyuXELr77a2oLKPzy5HOEPCh4hKKRG+zFIUZDQ6ZfcQbCecZHni/KBGab13I+/vcdJpj4JnaB8c+wShXik1UYkO/TTYDpj7q6OO760zwpTHvy9RPQmtG1Dmsx5g5cxKzK8ay23Xj9B2eIWQCWTtJbRhDxEU72PnOh5an5Ig7o4E6c4QTPDz80YZEDM1gFIKClZem4M0lrtqy8oAAglBoNKCEoOJmozgr3u8i=M20o-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 1 May 01:08 +0200
Re: [bug#40925] [PATCH] Add collectd
(name . Lars-Dominik Braun)(address . ldb@leibniz-psychology.org)(address . 40925@debbugs.gnu.org)
87wo5winax.fsf@gnu.org
Hi,
Lars-Dominik Braun <ldb@leibniz-psychology.org> skribis:
Toggle quote (9 lines)> From 05110cd7f0af5f870daa48a1e32bff56efb2676a Mon Sep 17 00:00:00 2001> From: Lars-Dominik Braun <ldb@leibniz-psychology.org>> Date: Tue, 28 Apr 2020 10:50:10 +0200> Subject: [PATCH] gnu: Add collectd>> * gnu/packages/monitoring.scm (collectd): New variable> * gnu/local.mk (dist_patch_DATA): Add new patch> * gnu/packages/patches/collectd-5.11.0-noinstallvar.patch: New file
[...]
Toggle quote (8 lines)> + (arguments> + `(#:configure-flags (list "--localstatedir=/var" "--sysconfdir=/etc")> + #:phases> + (modify-phases %standard-phases> + ;; Required because of patched sources.> + (add-before 'configure 'autoreconf> + (lambda _ (invoke "autoreconf" "-vfi") #t)))))
Another option is to patch Makefile.in to avoid the dependency onAutoconf/Automake/Libool + this phase.
Toggle quote (2 lines)> + (license '(licenses:expat licenses:gpl2))))
This is incorrect (see patch below, which also includes indentationfixes and minor changes to the description to placate ‘guix lint’.)
Also, could you add a comment stating whether it’s dual-licensing orjust that there’s code in both licenses?
Toggle quote (6 lines)> diff --git a/gnu/packages/patches/collectd-5.11.0-noinstallvar.patch b/gnu/packages/patches/collectd-5.11.0-noinstallvar.patch> new file mode 100644> index 0000000000..a8ca142147> --- /dev/null> +++ b/gnu/packages/patches/collectd-5.11.0-noinstallvar.patch
A one-line comment at the top explaining what it does would be great.
Otherwise LGTM. Could you send an updated patch?
Thanks in advance!
Ludo’.
L
L
Ludovic Courtès wrote on 1 May 01:10 +0200
(name . Lars-Dominik Braun)(address . ldb@leibniz-psychology.org)(address . 40925@debbugs.gnu.org)
87sggkin8y.fsf@gnu.org
I too forgot the patch. :-)
Toggle diff (37 lines)diff --git a/gnu/packages/monitoring.scm b/gnu/packages/monitoring.scmindex 5a37b14328..7ee58f0d0c 100644--- a/gnu/packages/monitoring.scm+++ b/gnu/packages/monitoring.scm@@ -467,11 +467,11 @@ written in Go with pluggable metric collectors.") (build-system gnu-build-system) (arguments `(#:configure-flags (list "--localstatedir=/var" "--sysconfdir=/etc")- #:phases- (modify-phases %standard-phases- ;; Required because of patched sources.- (add-before 'configure 'autoreconf- (lambda _ (invoke "autoreconf" "-vfi") #t)))))+ #:phases (modify-phases %standard-phases+ (add-before 'configure 'autoreconf+ (lambda _+ ;; Required because of patched sources.+ (invoke "autoreconf" "-vfi")))))) (inputs `(("rrdtool" ,rrdtool) ("curl" ,curl)))@@ -483,10 +483,10 @@ written in Go with pluggable metric collectors.") (home-page "https://collectd.org/") (synopsis "Collect system and application performance metrics periodically") (description- "collectd gathers metrics from various sources, e.g. the operating system,-applications, logfiles and external devices, and stores this information or-makes it available over the network. Those statistics can be used to monitor-systems, find performance bottlenecks (i.e. performance analysis) and predict-future system load (i.e. capacity planning).")- (license '(licenses:expat licenses:gpl2))))+ "collectd gathers metrics from various sources such as the operating system,+applications, log files and external devices, and stores this information or+makes it available over the network. Those statistics can be used to monitor+systems, find performance bottlenecks (i.e., performance analysis) and predict+future system load (i.e., capacity planning).")+ (license (list license:expat license:gpl2))))
L
L
Lars-Dominik Braun wrote on 4 May 08:06 +0200
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 40925@debbugs.gnu.org)
20200504060629.GA3179@zpidnp36
Hi Ludo,
Toggle quote (2 lines)> Another option is to patch Makefile.in to avoid the dependency on> Autoconf/Automake/Libool + this phase.
it’s only a native-input, so should be fine?
Toggle quote (2 lines)> This is incorrect (see patch below, which also includes indentation> fixes and minor changes to the description to placate ‘guix lint’.)
My bad, forgot to run it :(
Toggle quote (2 lines)> Also, could you add a comment stating whether it’s dual-licensing or> just that there’s code in both licenses?
Done.
Toggle quote (1 lines)> A one-line comment at the top explaining what it does would be great.
Done.
Toggle quote (1 lines)> Otherwise LGTM. Could you send an updated patch?
See attachment. I’ve also enabled the plugin curl_json, which depends onlibyajl.
Cheers,Lars
From 4f7f52ff168ba63692cf0f73e344847ef1637566 Mon Sep 17 00:00:00 2001From: Lars-Dominik Braun <ldb@leibniz-psychology.org>Date: Tue, 28 Apr 2020 10:50:10 +0200Subject: [PATCH] gnu: Add collectd
* gnu/packages/monitoring.scm (collectd): New variable* gnu/local.mk (dist_patch_DATA): Add new patch* gnu/packages/patches/collectd-5.11.0-noinstallvar.patch: New file--- gnu/local.mk | 1 + gnu/packages/monitoring.scm | 51 ++++++++++++++++++- .../collectd-5.11.0-noinstallvar.patch | 21 ++++++++ 3 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/collectd-5.11.0-noinstallvar.patch
Toggle diff (125 lines)diff --git a/gnu/local.mk b/gnu/local.mkindex 9f212434a9..dea50618b0 100644--- a/gnu/local.mk+++ b/gnu/local.mk@@ -816,6 +816,7 @@ dist_patch_DATA = \ %D%/packages/patches/clucene-pkgconfig.patch \ %D%/packages/patches/cmake-curl-certificates.patch \ %D%/packages/patches/coda-use-system-libs.patch \+ %D%/packages/patches/collectd-5.11.0-noinstallvar.patch \ %D%/packages/patches/combinatorial-blas-awpm.patch \ %D%/packages/patches/combinatorial-blas-io-fix.patch \ %D%/packages/patches/containerd-test-with-go1.13.patch \diff --git a/gnu/packages/monitoring.scm b/gnu/packages/monitoring.scmindex 8da31d6a84..d88bbc3aa3 100644--- a/gnu/packages/monitoring.scm+++ b/gnu/packages/monitoring.scm@@ -6,6 +6,7 @@ ;;; Copyright © 2018 Gábor Boskovits <boskovits@gmail.com> ;;; Copyright © 2018, 2019 Oleg Pykhalov <go.wigust@gmail.com> ;;; Copyright © 2020 Alex ter Weele <alex.ter.weele@gmail.com>+;;; Copyright © 2020 Lars-Dominik Braun <ldb@leibniz-psychology.org> ;;; ;;; This file is part of GNU Guix. ;;;@@ -32,6 +33,7 @@ #:use-module (guix build-system gnu) #:use-module (guix build-system go) #:use-module (guix utils)+ #:use-module (gnu packages) #:use-module (gnu packages admin) #:use-module (gnu packages autotools) #:use-module (gnu packages base)@@ -48,11 +50,14 @@ #:use-module (gnu packages libevent) #:use-module (gnu packages pcre) #:use-module (gnu packages perl)+ #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz)+ #:use-module (gnu packages rrdtool) #:use-module (gnu packages time)- #:use-module (gnu packages tls))+ #:use-module (gnu packages tls)+ #:use-module (gnu packages web)) (define-public nagios (package@@ -445,3 +450,47 @@ written in Go with pluggable metric collectors.") (description "This package provides a file system monitor.") (home-page "https://github.com/emcrisostomo/fswatch") (license license:gpl3+)))++(define-public collectd+ (package+ (name "collectd")+ (version "5.11.0")+ (source (origin+ (method url-fetch)+ (uri (string-append+ "https://storage.googleapis.com/collectd-tarballs/collectd-"+ version+ ".tar.bz2"))+ (sha256+ (base32+ "1cjxksxdqcqdccz1nbnc2fp6yy84qq361ynaq5q8bailds00mc9p"))+ (patches (search-patches "collectd-5.11.0-noinstallvar.patch"))))+ (build-system gnu-build-system)+ (arguments+ `(#:configure-flags (list "--localstatedir=/var" "--sysconfdir=/etc")+ #:phases (modify-phases %standard-phases+ (add-before 'configure 'autoreconf+ (lambda _+ ;; Required because of patched sources.+ (invoke "autoreconf" "-vfi"))))))+ (inputs+ `(("rrdtool" ,rrdtool)+ ("curl" ,curl)+ ("libyajl" ,libyajl)))+ (native-inputs+ `(("autoconf" ,autoconf)+ ("automake" ,automake)+ ("libtool" ,libtool)+ ("pkg-config" ,pkg-config)))+ (home-page "https://collectd.org/")+ (synopsis "Collect system and application performance metrics periodically")+ (description+ "collectd gathers metrics from various sources such as the operating system,+applications, log files and external devices, and stores this information or+makes it available over the network. Those statistics can be used to monitor+systems, find performance bottlenecks (i.e., performance analysis) and predict+future system load (i.e., capacity planning).")+ ;; license:expat for the daemon in src/daemon/ and some plugins,+ ;; license:gpl2 for other plugins+ (license (list license:expat license:gpl2))))+diff --git a/gnu/packages/patches/collectd-5.11.0-noinstallvar.patch b/gnu/packages/patches/collectd-5.11.0-noinstallvar.patchnew file mode 100644index 0000000000..39cd9c763e--- /dev/null+++ b/gnu/packages/patches/collectd-5.11.0-noinstallvar.patch@@ -0,0 +1,21 @@+Disable creation of /var and /etc++--- a/Makefile.am 2020-03-08 16:57:09.511535600 +0100++++ b/Makefile.am 2020-04-21 11:36:49.827182272 +0200+@@ -2376,16 +2376,6 @@+ endif+ + install-exec-hook:+- $(mkinstalldirs) $(DESTDIR)$(localstatedir)/run+- $(mkinstalldirs) $(DESTDIR)$(localstatedir)/lib/$(PACKAGE_NAME)+- $(mkinstalldirs) $(DESTDIR)$(localstatedir)/log+- $(mkinstalldirs) $(DESTDIR)$(sysconfdir)+- if test -e $(DESTDIR)$(sysconfdir)/collectd.conf; \+- then \+- $(INSTALL) -m 0640 $(builddir)/src/collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf.pkg-orig; \+- else \+- $(INSTALL) -m 0640 $(builddir)/src/collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf; \+- fi; \+ $(mkinstalldirs) $(DESTDIR)$(cpkgdatadir)+ $(INSTALL) -m 0644 $(srcdir)/src/types.db $(DESTDIR)$(cpkgdatadir)/types.db;+ $(INSTALL) -m 0644 $(srcdir)/src/postgresql_default.conf \-- 2.20.1
-----BEGIN PGP SIGNATURE-----
iQGzBAABCgAdFiEEyk+M9DfXR4/aBV/UQhN3ARo3hEYFAl6vsOEACgkQQhN3ARo3hEaoHwv/ZeGpGSFCY8alsX3AP8CjzW+iXP1TXd4etXSLiHES8X88oO3X8tDJuNPF///t2U01vHiRiCv6F4yyn+FSUzQUrVBcfOHTOw7OHRmevKh6oBDPtVz37X9ZENYbWw2Dwwx18npr3BJ9xZjI4+zo0VVd5LmqRXEHit5p3MaDppuBGPep9Xbw7P5WsXgH1MDHE3LzhlU3Curgoei60pzs0we4tZH5qDupNiHHbo41sriQedjGqVn1zId6YGTE0ppWnQFCjEyDlc8KVgO9RakFvgtU6JR1SxBpDKG4/+RrAwMRghlGT4hx6kpjSBZPyPfr0Dt4GTGcvjVLq7mf8if/kJ6Pl/6i4k4moCXP04QU9nzfOi19+8MUSE/GVC610WdKnrC/UZw7Zzp015x70bvV9oJmMqbS3rkSWiHXa0KagOkLN6XCcps36Z16wZHyn6aZdM2Dn/tGCIO8WuBgXDADJO9JtbeOz9j4Ilaul/N4xa6oODx3P93OXvRXhMw1P/5lvZuM=WEb1-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 4 May 11:52 +0200
(name . Lars-Dominik Braun)(address . ldb@leibniz-psychology.org)(address . 40925-done@debbugs.gnu.org)
87mu6orpqe.fsf@gnu.org
Hi,
Lars-Dominik Braun <ldb@leibniz-psychology.org> skribis:
Toggle quote (9 lines)> From 4f7f52ff168ba63692cf0f73e344847ef1637566 Mon Sep 17 00:00:00 2001> From: Lars-Dominik Braun <ldb@leibniz-psychology.org>> Date: Tue, 28 Apr 2020 10:50:10 +0200> Subject: [PATCH] gnu: Add collectd>> * gnu/packages/monitoring.scm (collectd): New variable> * gnu/local.mk (dist_patch_DATA): Add new patch> * gnu/packages/patches/collectd-5.11.0-noinstallvar.patch: New file
Applied, thanks!
Ludo’.
Closed
?