(address . guix-patches@gnu.org)(name . Léo Le Bouter)(address . lle-bout@zaclys.net)
* gnu/packages/monitoring.scm (netdata): New variable.
* gnu/packages/patches/netdata-0001-use-system-python.patch,
gnu/packages/patches/netdata-0002-use-system-exim4.patch,
gnu/packages/patches/netdata-0003-use-python3.patch,
gnu/packages/patches/netdata-0004-use-sh.patch,
gnu/packages/patches/netdata-0005-use-bash.patch,
gnu/packages/patches/netdata-no-files-in-etc-and-var.patch,
gnu/packages/patches/netdata-web-remove-antifeatures-spyware.patch: New
patches.
* gnu/local.mk (dist_patch_DATA): Register them.
---
gnu/local.mk | 7 +
gnu/packages/monitoring.scm | 106 +
.../netdata-0001-use-system-python.patch | 131 +
.../netdata-0002-use-system-exim4.patch | 12 +
.../patches/netdata-0003-use-python3.patch | 29 +
.../patches/netdata-0004-use-sh.patch | 12 +
.../patches/netdata-0005-use-bash.patch | 13 +
.../netdata-no-files-in-etc-and-var.patch | 129 +
...data-web-remove-antifeatures-spyware.patch | 4466 +++++++++++++++++
9 files changed, 4905 insertions(+)
create mode 100644 gnu/packages/patches/netdata-0001-use-system-python.patch
create mode 100644 gnu/packages/patches/netdata-0002-use-system-exim4.patch
create mode 100644 gnu/packages/patches/netdata-0003-use-python3.patch
create mode 100644 gnu/packages/patches/netdata-0004-use-sh.patch
create mode 100644 gnu/packages/patches/netdata-0005-use-bash.patch
create mode 100644 gnu/packages/patches/netdata-no-files-in-etc-and-var.patch
create mode 100644 gnu/packages/patches/netdata-web-remove-antifeatures-spyware.patch
Toggle diff (455 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 8a31bfef64..8d1e6a6fa5 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1388,6 +1388,13 @@ dist_patch_DATA = \
%D%/packages/patches/m4-gnulib-libio.patch \
%D%/packages/patches/ncompress-fix-softlinks.patch \
%D%/packages/patches/netcdf-date-time.patch \
+ %D%/packages/patches/netdata-0001-use-system-python.patch \
+ %D%/packages/patches/netdata-0002-use-system-exim4.patch \
+ %D%/packages/patches/netdata-0003-use-python3.patch \
+ %D%/packages/patches/netdata-0004-use-sh.patch \
+ %D%/packages/patches/netdata-0005-use-bash.patch \
+ %D%/packages/patches/netdata-no-files-in-etc-and-var.patch \
+ %D%/packages/patches/netdata-web-remove-antifeatures-spyware.patch
%D%/packages/patches/netpbm-CVE-2017-2586.patch \
%D%/packages/patches/netpbm-CVE-2017-2587.patch \
%D%/packages/patches/netsurf-message-timestamp.patch \
diff --git a/gnu/packages/monitoring.scm b/gnu/packages/monitoring.scm
index 75a422921c..b0673c8321 100644
--- a/gnu/packages/monitoring.scm
+++ b/gnu/packages/monitoring.scm
@@ -41,24 +41,31 @@
#:use-module (gnu packages curl)
#:use-module (gnu packages check)
#:use-module (gnu packages compression)
+ #:use-module (gnu packages cups)
#:use-module (gnu packages databases)
+ #:use-module (gnu packages disk)
#:use-module (gnu packages django)
+ #:use-module (gnu packages gawk)
#:use-module (gnu packages gd)
#:use-module (gnu packages gettext)
#:use-module (gnu packages image)
#:use-module (gnu packages mail)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages networking)
+ #:use-module (gnu packages node)
#:use-module (gnu packages libevent)
+ #:use-module (gnu packages linux)
#:use-module (gnu packages pcre)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
+ #:use-module (gnu packages protobuf)
#: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 version-control)
#:use-module (gnu packages web))
(define-public nagios
@@ -575,3 +582,102 @@ future system load (i.e., capacity planning).")
;; license:gpl2 for other plugins
(license (list license:expat license:gpl2))))
+(define-public netdata
+ ;; TODO: Support go plugins, if not more.
+ (package
+ (name "netdata")
+ (version "1.29.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/netdata/netdata")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "137qx7m9h2qk1pcy3i8rf7yk744zi7ps3867psy2r45l7k3flrss"))
+ (patches
+ (search-patches
+ ;; Remove Google Analytics, Google Tag Manager, update popups,
+ ;; global default registry and Netdata Cloud support (nonfree
+ ;; service).
+ "netdata-web-remove-antifeatures-spyware.patch"
+ ;; From Nix
+ "netdata-no-files-in-etc-and-var.patch"
+ ;; From Debian
+ "netdata-0001-use-system-python.patch"
+ "netdata-0002-use-system-exim4.patch"
+ "netdata-0003-use-python3.patch"
+ "netdata-0004-use-sh.patch"
+ "netdata-0005-use-bash.patch"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:configure-flags (list "--localstatedir=/var"
+ "--sysconfdir=/etc"
+ "--disable-cloud")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'install 'wrap-netdata
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (wrap-program
+ (string-append (assoc-ref outputs "out") "/sbin/netdata")
+ `("DO_NOT_TRACK" = (,"1"))
+ `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
+ `("PATH" ":" prefix ,(map
+ (lambda (input)
+ (string-append
+ (assoc-ref inputs input)
+ "/bin"))
+ '("coreutils" "grep" "findutils" "sed"
+ "dmidecode" "hddtemp" "iproute2"
+ "iw" "lm-sensors" "netcat" "curl"
+ "fping" "procps" "which" "gawk"
+ "node"))))
+ #t)))))
+ (native-inputs
+ `(("git" ,git-minimal)
+ ("pkg-config" ,pkg-config)
+ ("protobuf-c" ,protobuf-c)
+ ("autoconf" ,autoconf)
+ ("automake" ,automake)))
+ (inputs
+ ;; TODO: Add optional libnetfilter-acct
+ `(("util-linux:lib" ,util-linux "lib") ;; for libuuid
+ ("libuv" ,libuv)
+ ("zlib" ,zlib)
+ ("openssl" ,openssl)
+ ("lz4" ,lz4)
+ ("libcap" ,libcap)
+ ("libmnl" ,libmnl)
+ ("snappy" ,snappy)
+ ("cups" ,cups-minimal)
+ ("python" ,python)
+ ("python-pyyaml" ,python-pyyaml)
+ ("python-urllib3" ,python-urllib3)
+ ("python-six" ,python-six)
+ ("python-psycopg2" ,python-psycopg2)
+ ("python-pymysql" ,python-pymysql)
+ ("python-requests" ,python-requests)
+ ;; TODO: Add apcupsd
+ ("coreutils" ,coreutils)
+ ("grep" ,grep)
+ ("findutils" ,findutils)
+ ("sed" ,sed)
+ ("dmidecode" ,dmidecode)
+ ("hddtemp" ,hddtemp)
+ ("iproute2" ,iproute)
+ ("iw" ,iw)
+ ("lm-sensors" ,lm-sensors)
+ ("netcat" ,netcat-openbsd)
+ ("curl" ,curl)
+ ("fping" ,fping)
+ ("procps" ,procps)
+ ("which" ,which)
+ ("gawk" ,gawk)
+ ("node" ,node)))
+ (home-page "https://www.netdata.cloud/")
+ (synopsis "Zero-configuration real-time performance monitoring")
+ (description "Netdata's distributed, real-time monitoring Agent collects
+thousands of metrics from systems, hardware, containers, and applications with
+zero configuration.")
+ (license license:gpl3)))
diff --git a/gnu/packages/patches/netdata-0001-use-system-python.patch b/gnu/packages/patches/netdata-0001-use-system-python.patch
new file mode 100644
index 0000000000..5a14159d52
--- /dev/null
+++ b/gnu/packages/patches/netdata-0001-use-system-python.patch
@@ -0,0 +1,131 @@
+Author: Lennart Weller <lhw@ring0.de>
+Description: Ignore embedded python modules.
+
+diff -Naurp netdata.orig/collectors/python.d.plugin/Makefile.am netdata/collectors/python.d.plugin/Makefile.am
+--- netdata.orig/collectors/python.d.plugin/Makefile.am
++++ netdata/collectors/python.d.plugin/Makefile.am
+@@ -145,109 +145,3 @@ dist_third_party_DATA = \
+ python_modules/third_party/monotonic.py \
+ python_modules/third_party/filelock.py \
+ $(NULL)
+-
+-pythonyaml2dir=$(pythonmodulesdir)/pyyaml2
+-dist_pythonyaml2_DATA = \
+- python_modules/pyyaml2/__init__.py \
+- python_modules/pyyaml2/composer.py \
+- python_modules/pyyaml2/constructor.py \
+- python_modules/pyyaml2/cyaml.py \
+- python_modules/pyyaml2/dumper.py \
+- python_modules/pyyaml2/emitter.py \
+- python_modules/pyyaml2/error.py \
+- python_modules/pyyaml2/events.py \
+- python_modules/pyyaml2/loader.py \
+- python_modules/pyyaml2/nodes.py \
+- python_modules/pyyaml2/parser.py \
+- python_modules/pyyaml2/reader.py \
+- python_modules/pyyaml2/representer.py \
+- python_modules/pyyaml2/resolver.py \
+- python_modules/pyyaml2/scanner.py \
+- python_modules/pyyaml2/serializer.py \
+- python_modules/pyyaml2/tokens.py \
+- $(NULL)
+-
+-pythonyaml3dir=$(pythonmodulesdir)/pyyaml3
+-dist_pythonyaml3_DATA = \
+- python_modules/pyyaml3/__init__.py \
+- python_modules/pyyaml3/composer.py \
+- python_modules/pyyaml3/constructor.py \
+- python_modules/pyyaml3/cyaml.py \
+- python_modules/pyyaml3/dumper.py \
+- python_modules/pyyaml3/emitter.py \
+- python_modules/pyyaml3/error.py \
+- python_modules/pyyaml3/events.py \
+- python_modules/pyyaml3/loader.py \
+- python_modules/pyyaml3/nodes.py \
+- python_modules/pyyaml3/parser.py \
+- python_modules/pyyaml3/reader.py \
+- python_modules/pyyaml3/representer.py \
+- python_modules/pyyaml3/resolver.py \
+- python_modules/pyyaml3/scanner.py \
+- python_modules/pyyaml3/serializer.py \
+- python_modules/pyyaml3/tokens.py \
+- $(NULL)
+-
+-python_urllib3dir=$(pythonmodulesdir)/urllib3
+-dist_python_urllib3_DATA = \
+- python_modules/urllib3/__init__.py \
+- python_modules/urllib3/_collections.py \
+- python_modules/urllib3/connection.py \
+- python_modules/urllib3/connectionpool.py \
+- python_modules/urllib3/exceptions.py \
+- python_modules/urllib3/fields.py \
+- python_modules/urllib3/filepost.py \
+- python_modules/urllib3/response.py \
+- python_modules/urllib3/poolmanager.py \
+- python_modules/urllib3/request.py \
+- $(NULL)
+-
+-python_urllib3_utildir=$(python_urllib3dir)/util
+-dist_python_urllib3_util_DATA = \
+- python_modules/urllib3/util/__init__.py \
+- python_modules/urllib3/util/connection.py \
+- python_modules/urllib3/util/request.py \
+- python_modules/urllib3/util/response.py \
+- python_modules/urllib3/util/retry.py \
+- python_modules/urllib3/util/selectors.py \
+- python_modules/urllib3/util/ssl_.py \
+- python_modules/urllib3/util/timeout.py \
+- python_modules/urllib3/util/url.py \
+- python_modules/urllib3/util/wait.py \
+- $(NULL)
+-
+-python_urllib3_packagesdir=$(python_urllib3dir)/packages
+-dist_python_urllib3_packages_DATA = \
+- python_modules/urllib3/packages/__init__.py \
+- python_modules/urllib3/packages/ordered_dict.py \
+- python_modules/urllib3/packages/six.py \
+- $(NULL)
+-
+-python_urllib3_backportsdir=$(python_urllib3_packagesdir)/backports
+-dist_python_urllib3_backports_DATA = \
+- python_modules/urllib3/packages/backports/__init__.py \
+- python_modules/urllib3/packages/backports/makefile.py \
+- $(NULL)
+-
+-python_urllib3_ssl_match_hostnamedir=$(python_urllib3_packagesdir)/ssl_match_hostname
+-dist_python_urllib3_ssl_match_hostname_DATA = \
+- python_modules/urllib3/packages/ssl_match_hostname/__init__.py \
+- python_modules/urllib3/packages/ssl_match_hostname/_implementation.py \
+- $(NULL)
+-
+-python_urllib3_contribdir=$(python_urllib3dir)/contrib
+-dist_python_urllib3_contrib_DATA = \
+- python_modules/urllib3/contrib/__init__.py \
+- python_modules/urllib3/contrib/appengine.py \
+- python_modules/urllib3/contrib/ntlmpool.py \
+- python_modules/urllib3/contrib/pyopenssl.py \
+- python_modules/urllib3/contrib/securetransport.py \
+- python_modules/urllib3/contrib/socks.py \
+- $(NULL)
+-
+-python_urllib3_securetransportdir=$(python_urllib3_contribdir)/_securetransport
+-dist_python_urllib3_securetransport_DATA = \
+- python_modules/urllib3/contrib/_securetransport/__init__.py \
+- python_modules/urllib3/contrib/_securetransport/bindings.py \
+- python_modules/urllib3/contrib/_securetransport/low_level.py \
+- $(NULL)
+diff -Naurp netdata.orig/collectors/python.d.plugin/python_modules/bases/loaders.py netdata/collectors/python.d.plugin/python_modules/bases/loaders.py
+--- netdata.orig/collectors/python.d.plugin/python_modules/bases/loaders.py
++++ netdata/collectors/python.d.plugin/python_modules/bases/loaders.py
+@@ -9,10 +9,7 @@ from sys import version_info
+ PY_VERSION = version_info[:2]
+
+ try:
+- if PY_VERSION > (3, 1):
+- from pyyaml3 import SafeLoader as YamlSafeLoader
+- else:
+- from pyyaml2 import SafeLoader as YamlSafeLoader
++ from yaml import SafeLoader as YamlSafeLoader
+ except ImportError:
+ from yaml import SafeLoader as YamlSafeLoader
+
diff --git a/gnu/packages/patches/netdata-0002-use-system-exim4.patch b/gnu/packages/patches/netdata-0002-use-system-exim4.patch
new file mode 100644
index 0000000000..0e23618399
--- /dev/null
+++ b/gnu/packages/patches/netdata-0002-use-system-exim4.patch
@@ -0,0 +1,12 @@
+Author: Sven Hartge <sven@svenhartge.de>
+Description: Debian has exim in /usr/sbin which is not in the default path.
+
+diff -Naurp netdata.orig/collectors/python.d.plugin/exim/exim.conf netdata/collectors/python.d.plugin/exim/exim.conf
+--- netdata.orig/collectors/python.d.plugin/exim/exim.conf
++++ netdata/collectors/python.d.plugin/exim/exim.conf
+@@ -88,4 +88,4 @@ update_every: 10
+ # AUTO-DETECTION JOBS
+
+ local:
+- command: 'exim -bpc'
++ command: '/usr/sbin/exim -bpc'
diff --git a/gnu/packages/patches/netdata-0003-use-python3.patch b/gnu/packages/patches/netdata-0003-use-python3.patch
new file mode 100644
index 0000000000..e55089271a
--- /dev/null
+++ b/gnu/packages/patches/netdata-0003-use-python3.patch
@@ -0,0 +1,29 @@
+Author: Sander Klein <debian-bugs@roedie.nl>
+Description: Debian uses by default python 2 instead of python3.
+
+diff -Naurp netdata.orig/collectors/python.d.plugin/python.d.plugin.in netdata/collectors/python.d.plugin/python.d.plugin.in
+--- netdata.orig/collectors/python.d.plugin/python.d.plugin.in
++++ netdata/collectors/python.d.plugin/python.d.plugin.in
+@@ -1,21 +1,4 @@
+-#!/usr/bin/env bash
+-'''':;
+-pybinary=$(which python || which python3 || which python2)
+-filtered=()
+-for arg in "$@"
+-do
+- case $arg in
+- -p*) pybinary=${arg:2}
+- shift 1 ;;
+- *) filtered+=("$arg") ;;
+- esac
+-done
+-if [ "$pybinary" = "" ]
+-then
+- echo "ERROR python IS NOT AVAILABLE IN THIS SYSTEM"
+- exit 1
+-fi
+-exec "$pybinary" "$0" "${filtered[@]}" # '''
++#!/usr/bin/python3
+
+ # -*- coding: utf-8 -*-
+ # Description:
diff --git a/gnu/packages/patches/netdata-0004-use-sh.patch b/gnu/packages/patches/netdata-0004-use-sh.patch
new file mode 100644
index 0000000000..6c8e93bfba
--- /dev/null
+++ b/gnu/packages/patches/netdata-0004-use-sh.patch
@@ -0,0 +1,12 @@
+Author: Daniel Baumann <daniel.baumann@progress-linux.org>
+Description: Fix shebang hack to not depend on bash.
+
+diff -Naurp netdata.orig/collectors/node.d.plugin/node.d.plugin.in netdata/collectors/node.d.plugin/node.d.plugin.in
+--- netdata.orig/collectors/node.d.plugin/node.d.plugin.in
++++ netdata/collectors/node.d.plugin/node.d.plugin.in
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env bash
++#!/bin/sh
+ ':' //; exec "$(command -v nodejs || command -v node || echo "ERROR node IS NOT AVAILABLE IN THIS SYSTEM")" "$0" "$@"
+
+ // shebang hack from:
diff --git a/gnu/packages/patches/netdata-0005-use-bash.patch b/gnu/packages/patches/netdata-0005-use-bash.patch
new file mode 100644
index 0000000000..53b7fc5b31
--- /dev/null
+++ b/gnu/packages/patches/netdata-0005-use-bash.patch
@@ -0,0 +1,13 @@
+Author: Daniel Baumann <daniel.baumann@progress-linux.org>
+Description: Using bash instead of sh for edit-config.
+ It reads /etc/profile which often contains bash specific configuration.
+
+diff -Naurp netdata.orig/system/edit-config.in netdata/system/edit-config.in
+--- netdata.orig/system/edit-config.in
++++ netdata/system/edit-config.in
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env sh
++#!/bin/bash
+
+ [ -f /etc/profile ] && . /etc/profile
+
diff --git a/gnu/packages/patches/netdata-no-files-in-etc-and-var.patch b/gnu/packages/patches/netdata-no-files-in-etc-and-var.patch
new file mode 100644
index 0000000000..594805fdf1
--- /dev/null
+++ b/gnu/packages/patches/netdata-no-files-in-etc-and-var.patch
@@ -0,0 +1,129 @@
+From 4ecc1475be94a384c122594b5f7d455beb64a2f0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
+Date: Sat, 22 Feb 2020 06:42:14 +0000
+Subject: [PATCH] no files in etc and var
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+---
+ collectors/Makefile.am | 2 +-
+ collectors/charts.d.plugin/Makefile.am | 2 +-
+ collectors/node.d.plugin/Makefile.am | 2 +-
+ collectors/python.d.plugin/Makefile.am | 2 +-
+ collectors/statsd.plugin/Makefile.am | 2 +-
+ health/Makefile.am | 2 +-
+ system/Makefile.am | 3 +--
+ web/Makefile.am | 2 +-
+ 8 files changed, 8 insertions(+), 9 deletions(-)
+
+diff --git a/collectors/Makefile.am b/collectors/Makefile.am
+index 9bb52958..c9799165 100644
+--- a/collectors/Makefile.am
++++ b/collectors/Makefile.am
+@@ -32,7 +32,7 @@ usercustompluginsconfigdir=$(configdir)/custom-plugins.d
+ usergoconfigdir=$(configdir)/go.d
+
+ # Explicitly install directories to avoid permission issues due to umask
+-install-exec-local:
++no-install-exec-local:
+ $(INSTALL) -d $(DESTDIR)$(usercustompluginsconfigdir)
+ $(INSTALL) -d $(DESTDIR)$(usergoconfigdir)
+
+diff --git a/collectors/charts.d.plugin/Makefile.am b/collectors/charts.d.plugin/Makefile.am
+index 03c7f0a9..01985db0 100644
+--- a/collectors/charts.d.plugin/Makefile.am
++++ b/collectors/charts.d.plugin/Makefile.am
+@@ -34,7 +34,7 @@ dist_userchartsconfig_DATA = \
+ $(NULL)
+
+ # Explicitly install directories to avoid permission issues due to umask
+-install-exec-local:
++no-install-exec-local:
+ $(INSTALL) -d $(DESTDIR)$(userchartsconfigdir)
+
+ chartsconfigdir=$(libconfigdir)/charts.d
+diff --git a/collectors/node.d.plugin/Makefile.am b/collectors/node.d.plugin/Makefile.am
+index c3142d43..95e32445 100644
+--- a/collectors/node.d.plugin/Makefile.am
++++ b/collectors/node.d.plugin/Makefile.am
+@@ -26,7 +26,7 @@ dist_usernodeconfig_DATA = \
+ $(NULL)
+
+ # Explicitly install directories to avoid permission issues due to umask
+-install-exec-local:
++no-install-exec-local:
+ $(INSTALL) -d $(DESTDIR)$(usernodeconfigdir)
+
+ nodeconfigdir=$(libconfigdir)/node.d
+diff --git a/collectors/python.d.plugin/Makefile.am b/collectors/python.d.plugin/Makefile.am
+index e678f86a..29a319da 100644
+--- a/collectors/python.d.plugin/Makefile.am
++++ b/collectors/python.d.plugin/Makefile.am
+@@ -32,7 +32,7 @@ dist_userpythonconfig_DATA = \
+ $(NULL
This message was truncated. Download the full message here.