* [bug#40925] [PATCH] Add collectd
@ 2020-04-28 8:57 Lars-Dominik Braun
2020-04-28 9:29 ` Lars-Dominik Braun
0 siblings, 1 reply; 6+ messages in thread
From: Lars-Dominik Braun @ 2020-04-28 8:57 UTC (permalink / raw)
To: 40925
[-- Attachment #1: Type: text/plain, Size: 438 bytes --]
Hi,
the attached patch adds the monitoring software “collectd”. Its configuration
is quite minimal right now. A lot of plugins are not enabled, because they
introduce many external dependencies. I’m sure that can be fixed easily if
there’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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [bug#40925] [PATCH] Add collectd
2020-04-28 8:57 [bug#40925] [PATCH] Add collectd Lars-Dominik Braun
@ 2020-04-28 9:29 ` Lars-Dominik Braun
2020-04-30 23:08 ` Ludovic Courtès
2020-04-30 23:10 ` [bug#40925] " Ludovic Courtès
0 siblings, 2 replies; 6+ messages in thread
From: Lars-Dominik Braun @ 2020-04-28 9:29 UTC (permalink / raw)
To: 40925
[-- Attachment #1.1: Type: text/plain, Size: 60 bytes --]
Hi,
totally forgot to attach the patch. Here it is.
Lars
[-- Attachment #1.2: 0001-gnu-Add-collectd.patch --]
[-- Type: text/x-diff, Size: 5620 bytes --]
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
---
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
diff --git a/gnu/local.mk b/gnu/local.mk
index 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.scm
index 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.patch
new file mode 100644
index 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [bug#40925] [PATCH] Add collectd
2020-04-28 9:29 ` Lars-Dominik Braun
@ 2020-04-30 23:08 ` Ludovic Courtès
2020-05-04 6:06 ` Lars-Dominik Braun
2020-04-30 23:10 ` [bug#40925] " Ludovic Courtès
1 sibling, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2020-04-30 23:08 UTC (permalink / raw)
To: Lars-Dominik Braun; +Cc: 40925
Hi,
Lars-Dominik Braun <ldb@leibniz-psychology.org> skribis:
> 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
[...]
> + (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 on
Autoconf/Automake/Libool + this phase.
> + (license '(licenses:expat licenses:gpl2))))
This is incorrect (see patch below, which also includes indentation
fixes and minor changes to the description to placate ‘guix lint’.)
Also, could you add a comment stating whether it’s dual-licensing or
just that there’s code in both licenses?
> 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’.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [bug#40925] [PATCH] Add collectd
2020-04-28 9:29 ` Lars-Dominik Braun
2020-04-30 23:08 ` Ludovic Courtès
@ 2020-04-30 23:10 ` Ludovic Courtès
1 sibling, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2020-04-30 23:10 UTC (permalink / raw)
To: Lars-Dominik Braun; +Cc: 40925
[-- Attachment #1: Type: text/plain, Size: 30 bytes --]
I too forgot the patch. :-)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 2045 bytes --]
diff --git a/gnu/packages/monitoring.scm b/gnu/packages/monitoring.scm
index 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))))
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [bug#40925] [PATCH] Add collectd
2020-04-30 23:08 ` Ludovic Courtès
@ 2020-05-04 6:06 ` Lars-Dominik Braun
2020-05-04 9:52 ` bug#40925: " Ludovic Courtès
0 siblings, 1 reply; 6+ messages in thread
From: Lars-Dominik Braun @ 2020-05-04 6:06 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 40925
[-- Attachment #1.1: Type: text/plain, Size: 719 bytes --]
Hi Ludo,
> 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?
> 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 :(
> Also, could you add a comment stating whether it’s dual-licensing or
> just that there’s code in both licenses?
Done.
> A one-line comment at the top explaining what it does would be great.
Done.
> Otherwise LGTM. Could you send an updated patch?
See attachment. I’ve also enabled the plugin curl_json, which depends on
libyajl.
Cheers,
Lars
[-- Attachment #1.2: 0001-gnu-Add-collectd.patch --]
[-- Type: text/x-diff, Size: 5887 bytes --]
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
---
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
diff --git a/gnu/local.mk b/gnu/local.mk
index 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.scm
index 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.patch
new file mode 100644
index 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* bug#40925: [PATCH] Add collectd
2020-05-04 6:06 ` Lars-Dominik Braun
@ 2020-05-04 9:52 ` Ludovic Courtès
0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2020-05-04 9:52 UTC (permalink / raw)
To: Lars-Dominik Braun; +Cc: 40925-done
Hi,
Lars-Dominik Braun <ldb@leibniz-psychology.org> skribis:
> 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’.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-05-04 9:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-28 8:57 [bug#40925] [PATCH] Add collectd Lars-Dominik Braun
2020-04-28 9:29 ` Lars-Dominik Braun
2020-04-30 23:08 ` Ludovic Courtès
2020-05-04 6:06 ` Lars-Dominik Braun
2020-05-04 9:52 ` bug#40925: " Ludovic Courtès
2020-04-30 23:10 ` [bug#40925] " Ludovic Courtès
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).