From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id oNCNM6rmJGDSWgAA0tVLHw (envelope-from ) for ; Thu, 11 Feb 2021 08:11:22 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id IHFsL6rmJGAZFgAA1q6Kng (envelope-from ) for ; Thu, 11 Feb 2021 08:11:22 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8A6979403AE for ; Thu, 11 Feb 2021 08:11:21 +0000 (UTC) Received: from localhost ([::1]:34706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lA74K-0002BJ-CG for larch@yhetil.org; Thu, 11 Feb 2021 03:11:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lA742-0002AI-Ui for guix-patches@gnu.org; Thu, 11 Feb 2021 03:11:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:46102) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lA742-0003pX-N1 for guix-patches@gnu.org; Thu, 11 Feb 2021 03:11:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lA742-00024S-GM for guix-patches@gnu.org; Thu, 11 Feb 2021 03:11:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#46435] [PATCH] gnu: Add netdata. Resent-From: =?UTF-8?Q?L=C3=A9o?= Le Bouter Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Feb 2021 08:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 46435 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 46435@debbugs.gnu.org Cc: =?UTF-8?Q?L=C3=A9o?= Le Bouter X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16130310137880 (code B ref -1); Thu, 11 Feb 2021 08:11:02 +0000 Received: (at submit) by debbugs.gnu.org; 11 Feb 2021 08:10:13 +0000 Received: from localhost ([127.0.0.1]:57646 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lA73F-000232-19 for submit@debbugs.gnu.org; Thu, 11 Feb 2021 03:10:13 -0500 Received: from lists.gnu.org ([209.51.188.17]:36288) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lA73D-00022u-KK for submit@debbugs.gnu.org; Thu, 11 Feb 2021 03:10:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lA73D-00021O-EZ for guix-patches@gnu.org; Thu, 11 Feb 2021 03:10:11 -0500 Received: from mail.zaclys.net ([178.33.93.72]:46641) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lA736-0003Go-P1 for guix-patches@gnu.org; Thu, 11 Feb 2021 03:10:10 -0500 Received: from localhost.localdomain (82-64-145-38.subs.proxad.net [82.64.145.38]) (authenticated bits=0) by mail.zaclys.net (8.14.7/8.14.7) with ESMTP id 11B89uEB032246 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Thu, 11 Feb 2021 09:10:00 +0100 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.zaclys.net 11B89uEB032246 Authentication-Results: mail.zaclys.net; spf=fail smtp.mailfrom=lle-bout@zaclys.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zaclys.net; s=default; t=1613031001; bh=KQMCaITECmTK5sDwu0Zk5AA6sdOTY/LS3ceUsWCDDiw=; h=From:To:Cc:Subject:Date:From; b=SAzZ/UkHflkLznAYOWLVEGS6uIhNKn7wBSQmCKGq8VvlsgU8wBZmxUVF9a50ujDAi DvMbo2uSuYrl+N/l1yr/hXJoSYqJ1ou5E0qSsw1tX27qxt7owSDvm8xGcsXr7a+vxx YSm5zeip+Gy15frvDG/lw714LrYrWAkHhLsw0LSI= Date: Thu, 11 Feb 2021 09:09:44 +0100 Message-Id: <20210211080944.11165-1-lle-bout@zaclys.net> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=178.33.93.72; envelope-from=lle-bout@zaclys.net; helo=mail.zaclys.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: =?UTF-8?Q?L=C3=A9o?= Le Bouter X-ACL-Warn: , =?UTF-8?Q?L=C3=A9o?= Le Bouter via Guix-patches From: =?UTF-8?Q?L=C3=A9o?= Le Bouter via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: 3.64 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=zaclys.net header.s=default header.b="SAzZ/UkH"; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 8A6979403AE X-Spam-Score: 3.64 X-Migadu-Scanner: scn0.migadu.com X-TUID: /HkwakDmOyIr * 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.pat= ch 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.pa= tch create mode 100644 gnu/packages/patches/netdata-web-remove-antifeatures-sp= yware.patch 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 =3D \ %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)) =20 (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)))) =20 +(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 pop= ups, + ;; global default registry and Netdata Cloud support (nonf= ree + ;; 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=3D/var" + "--sysconfdir=3D/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" =3D (,"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 collec= ts +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/gn= u/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 +Description: Ignore embedded python modules. + +diff -Naurp netdata.orig/collectors/python.d.plugin/Makefile.am netdata/co= llectors/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 =3D \ + python_modules/third_party/monotonic.py \ + python_modules/third_party/filelock.py \ + $(NULL) +- +-pythonyaml2dir=3D$(pythonmodulesdir)/pyyaml2 +-dist_pythonyaml2_DATA =3D \ +- 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=3D$(pythonmodulesdir)/pyyaml3 +-dist_pythonyaml3_DATA =3D \ +- 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=3D$(pythonmodulesdir)/urllib3 +-dist_python_urllib3_DATA =3D \ +- 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=3D$(python_urllib3dir)/util +-dist_python_urllib3_util_DATA =3D \ +- 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=3D$(python_urllib3dir)/packages +-dist_python_urllib3_packages_DATA =3D \ +- python_modules/urllib3/packages/__init__.py \ +- python_modules/urllib3/packages/ordered_dict.py \ +- python_modules/urllib3/packages/six.py \ +- $(NULL) +- +-python_urllib3_backportsdir=3D$(python_urllib3_packagesdir)/backports +-dist_python_urllib3_backports_DATA =3D \ +- python_modules/urllib3/packages/backports/__init__.py \ +- python_modules/urllib3/packages/backports/makefile.py \ +- $(NULL) +- +-python_urllib3_ssl_match_hostnamedir=3D$(python_urllib3_packagesdir)/ssl_= match_hostname +-dist_python_urllib3_ssl_match_hostname_DATA =3D \ +- python_modules/urllib3/packages/ssl_match_hostname/__init__.py \ +- python_modules/urllib3/packages/ssl_match_hostname/_implementation.py= \ +- $(NULL) +- +-python_urllib3_contribdir=3D$(python_urllib3dir)/contrib +-dist_python_urllib3_contrib_DATA =3D \ +- 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=3D$(python_urllib3_contribdir)/_securet= ransport +-dist_python_urllib3_securetransport_DATA =3D \ +- 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/l= oaders.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 =3D version_info[:2] +=20 + 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 +=20 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 +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 +=20 + local: +- command: 'exim -bpc' ++ command: '/usr/sbin/exim -bpc' diff --git a/gnu/packages/patches/netdata-0003-use-python3.patch b/gnu/pack= ages/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 +Description: Debian uses by default python 2 instead of python3. + +diff -Naurp netdata.orig/collectors/python.d.plugin/python.d.plugin.in net= data/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=3D$(which python || which python3 || which python2) +-filtered=3D() +-for arg in "$@" +-do +- case $arg in +- -p*) pybinary=3D${arg:2} +- shift 1 ;; +- *) filtered+=3D("$arg") ;; +- esac +-done +-if [ "$pybinary" =3D "" ] +-then +- echo "ERROR python IS NOT AVAILABLE IN THIS SYSTEM" +- exit 1 +-fi +-exec "$pybinary" "$0" "${filtered[@]}" # ''' ++#!/usr/bin/python3 +=20 + # -*- 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 +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" "$@" +=20 + // shebang hack from: diff --git a/gnu/packages/patches/netdata-0005-use-bash.patch b/gnu/package= s/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 +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 +=20 + [ -f /etc/profile ] && . /etc/profile +=20 diff --git a/gnu/packages/patches/netdata-no-files-in-etc-and-var.patch b/g= nu/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: =3D?UTF-8?q?J=3DC3=3DB6rg=3D20Thalheim?=3D +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=3DUTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: J=C3=B6rg Thalheim +--- + 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=3D$(configdir)/custom-plugins= .d + usergoconfigdir=3D$(configdir)/go.d +=20 + # 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) +=20 +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 =3D \ + $(NULL) +=20 + # Explicitly install directories to avoid permission issues due to umask +-install-exec-local: ++no-install-exec-local: + $(INSTALL) -d $(DESTDIR)$(userchartsconfigdir) +=20 + chartsconfigdir=3D$(libconfigdir)/charts.d +diff --git a/collectors/node.d.plugin/Makefile.am b/collectors/node.d.plug= in/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 =3D \ + $(NULL) +=20 + # Explicitly install directories to avoid permission issues due to umask +-install-exec-local: ++no-install-exec-local: + $(INSTALL) -d $(DESTDIR)$(usernodeconfigdir) +=20 + nodeconfigdir=3D$(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 =3D \ + $(NULL) +=20 + # Explicitly install directories to avoid permission issues due to umask +-install-exec-local: ++no-install-exec-local: + $(INSTALL) -d $(DESTDIR)$(userpythonconfigdir) +=20 + pythonconfigdir=3D$(libconfigdir)/python.d +diff --git a/collectors/statsd.plugin/Makefile.am b/collectors/statsd.plug= in/Makefile.am +index b01302d1..f5b77da4 100644 +--- a/collectors/statsd.plugin/Makefile.am ++++ b/collectors/statsd.plugin/Makefile.am +@@ -17,5 +17,5 @@ dist_userstatsdconfig_DATA =3D \ + $(NULL) +=20 + # Explicitly install directories to avoid permission issues due to umask +-install-exec-local: ++no-install-exec-local: + $(INSTALL) -d $(DESTDIR)$(userstatsdconfigdir) +diff --git a/health/Makefile.am b/health/Makefile.am +index 853ed0d7..210330a6 100644 +--- a/health/Makefile.am ++++ b/health/Makefile.am +@@ -19,7 +19,7 @@ dist_userhealthconfig_DATA =3D \ + $(NULL) +=20 + # Explicitly install directories to avoid permission issues due to umask +-install-exec-local: ++no-install-exec-local: + $(INSTALL) -d $(DESTDIR)$(userhealthconfigdir) +=20 + healthconfigdir=3D$(libconfigdir)/health.d +diff --git a/system/Makefile.am b/system/Makefile.am +index ad68c655..74f032f9 100644 +--- a/system/Makefile.am ++++ b/system/Makefile.am +@@ -17,11 +17,10 @@ include $(top_srcdir)/build/subst.inc + SUFFIXES =3D .in +=20 + dist_config_SCRIPTS =3D \ +- edit-config \ + $(NULL) +=20 + # Explicitly install directories to avoid permission issues due to umask +-install-exec-local: ++no-install-exec-local: + $(INSTALL) -d $(DESTDIR)$(configdir) +=20 + nodist_noinst_DATA =3D \ +diff --git a/web/Makefile.am b/web/Makefile.am +index ccaccd76..16a2977e 100644 +--- a/web/Makefile.am ++++ b/web/Makefile.am +@@ -12,7 +12,7 @@ SUBDIRS =3D \ + usersslconfigdir=3D$(configdir)/ssl +=20 + # Explicitly install directories to avoid permission issues due to umask +-install-exec-local: ++no-install-exec-local: + $(INSTALL) -d $(DESTDIR)$(usersslconfigdir) +=20 + dist_noinst_DATA =3D \ +--=20 +2.25.0 + diff --git a/gnu/packages/patches/netdata-web-remove-antifeatures-spyware.p= atch b/gnu/packages/patches/netdata-web-remove-antifeatures-spyware.patch new file mode 100644 index 0000000000..0b3be9a5d2 --- /dev/null +++ b/gnu/packages/patches/netdata-web-remove-antifeatures-spyware.patch @@ -0,0 +1,4466 @@ +diff --git a/registry/registry_init.c b/registry/registry_init.c +index ffdb83f3..2d5460fd 100644 +--- a/registry/registry_init.c ++++ b/registry/registry_init.c +@@ -36,7 +36,7 @@ int registry_init(void) { + registry.save_registry_every_entries =3D (unsigned long long)config_g= et_number(CONFIG_SECTION_REGISTRY, "registry save db every new entries", 10= 00000); + registry.persons_expiration =3D config_get_number(CONFIG_SECTION_REGI= STRY, "registry expire idle persons days", 365) * 86400; + registry.registry_domain =3D config_get(CONFIG_SECTION_REGISTRY, "reg= istry domain", ""); +- registry.registry_to_announce =3D config_get(CONFIG_SECTION_REGISTRY,= "registry to announce", "https://registry.my-netdata.io"); ++ registry.registry_to_announce =3D config_get(CONFIG_SECTION_REGISTRY,= "registry to announce", ""); + registry.hostname =3D config_get(CONFIG_SECTION_REGISTRY, "registry h= ostname", netdata_configured_hostname); + registry.verify_cookies_redirects =3D config_get_boolean(CONFIG_SECTI= ON_REGISTRY, "verify browser cookies support", 1); +=20 +diff --git a/web/gui/Makefile.am b/web/gui/Makefile.am +index c69380f9..8a8f01e5 100644 +--- a/web/gui/Makefile.am ++++ b/web/gui/Makefile.am +@@ -46,10 +46,6 @@ dist_noinst_DATA =3D \ + $(NULL) +=20 + dist_web_DATA =3D \ +- demo.html \ +- demo2.html \ +- demosites.html \ +- demosites2.html \ + dashboard.html \ + dashboard.js \ + dashboard_info.js \ +@@ -62,7 +58,6 @@ dist_web_DATA =3D \ + main.css \ + main.js \ + console.html \ +- infographic.html \ + robots.txt \ + refresh-badges.js \ + sitemap.xml \ +diff --git a/web/gui/console.html b/web/gui/console.html +index b85b4ffb..2debd1c5 100644 +--- a/web/gui/console.html ++++ b/web/gui/console.html +@@ -12,18 +12,6 @@ + + + +- +- +- + + +=20 + +- +- +- +
+ + +- +- +- +-
+-
why netdata?
+-
+-
These charts visualize t= he same data...
+- +- +- +- +- +- +-
+-
+- +-
+-
I can trace an issue like this
+-
+-
+-
+-
+-
Can you trace an issue like these?
 
+-
+-
+-
+-
+-
+- +-
+-
I can trace an issue like this
+-
+-
+-
+-
+-
Can you trace an issue like these?
 
+-
+-
+-
+-
+-
+-
Hover on the chart below, to see the= selected value on the charts above!
+-
+-
+- +- +diff --git a/web/gui/demosites.html b/web/gui/demosites.html +deleted file mode 100644 +index e8a310a1..00000000 +--- a/web/gui/demosites.html ++++ /dev/null +@@ -1,1469 +0,0 @@ +- +- +- +- +- +- +- NetData: Get control of your Linux Servers. Simple. Effective.= Awesome. +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-
+-
+- +- +-
+-

Monitor your system= s and applications, the right way!

+-

+- Unparalleled insights, in real-time<= /strong>, +- of everything happening on your systems and = applications, +- with stunning, interactive web dashboards +- and powerful performance and health<= /strong> alarms. +-

+- +-
+-
+-
+-

Enter the world of Netdata!

+-
+-

1s granularity

+-
+-
+-
+-

+- Per second data collection and visualization, = for all metrics! +-

+-

+- Netdata zooms into the problems by providing h= igher resolution information, compared to any other monitoring solution. +-

+-
+-
+-

+- The world goes real-time. +-
 
+- High resolution metrics are required to effectively m= onitor and troubleshoot systems and applications, especially on virtual env= ironments. +-

+-
+-
+-
+- +-
+- +-
+-
+-
+-

Unlimited metrics

+-
+-
+-
+-

+- Use all the metrics, from all available sources! +-

+-

+- Netdata collects all the metrics native console tools= do. It has been designed to kill the console for troubleshooting in= frastructure slowdowns and outages. +-

+-
+-
+-

+- All metrics are important and all should be available= when you need them. +-
 
+- Filtering out most metrics is like reading a book by = skipping most of its pages. +-

+-
+-
+-
+- +-
+-
+-
+-
+-

Meaningful presentatio= n

+-
+-
+-
+-

+- Explore all metrics in a meaningful, easy to understa= nd way! +-

+-

+- Netdata engineers and experts on our community organi= ze metrics in a meaningful way, so that you can learn and understand them r= ight on the job, while troubleshooting issues of your infrastructure. +-

+-
+-
+-

+- Metrics are a lot more than name-value pairs over tim= e. +-

+- It is just not practical to require from all users to= have a deep understanding of all metrics for monitoring their systems and = applications. +-

+-
+-
+-
+- +-
+- +-
+-
+-
+-

Immediate results

+-
+-
+-
+-

+- Install and use immediately! Get fully functional vis= ualization and alarms, in just a couple of seconds after installation! +-

+-

+- Netdata decouples your skills from your monitoring= infrastructure. +- No matter how skillful or novice you are, Netdata wil= l apply all the community knowledge and expertise to your monitoring infras= tructure. +-

+-
+-
+-

+- Most of our infrastructure is based on standardized s= ystems and applications. +-
 
+- It is a tremendous waste of time and effort, in a glo= bal scale, to require from all users to configure their infrastructure dash= boards and alarms metric by metric. +-

+-
+-
+-
+- +-
+- +-
+-

How it works

+-
+-

+- Netdata is a monitoring agent you install on all your sys= tems: +-
+- physical servers, virtual servers, conta= iners, IoT. +-

+-

+- Netdata is lightweight, designed to permanently run on al= l systems without disrupting their core function. +- By default, it needs just 1% CPU of a single core, a few = MB or RAM and no disk I/O at all. +-

+-

+- Each Netdata is (by default) autonomous, taking care of a= ll the following. +-
But all your Netdata are integrated into one large d= istributed application. +-

+-
+-
+-

= Collect

+-

+- Netdata automatically detects data collection sources= on the host it runs. +- It comes with hundreds of plugins for collecting syst= em and application metrics, +- including databases, web servers, and commonly used a= pplication servers. +-

+- Netdata is also a high performance, distributed st= atsd server, allowing custom +- application metrics to be collected and visualized. +-

+-
+-

= Check (alarms)

+-

+- Each Netdata spawns a thread that examines the metric= s as they get collected, +- evaluates pre-configured alarm expressions and trigge= rs alarm notifications. +-

+- Netdata comes with hundreds of alarms to detect commo= n system and application issues, +- that are automatically attached to the collected metr= ics, +- supporting dozens of alarm notification integrations. +-

+-
+-

= Stream

+-

+- Each Netdata can stream its metrics, in real-time, to= any other Netdata. +- Streaming allows Netdata to be used in ephemeral node= s and containers in auto-scaled environments, +- but it also allows building Netdata hierarchies for a= ggregating the metrics of multiple Netdata nodes. +-

+-
+-

= Store

+-

+- Each Netdata has its own internal metrics database. T= his database is optimized +- for minimal memory footprint, and due to its lockless= design allows one writer +- and multiple readers per metric, concurrently, contri= buting significantly to +- the performance of Netdata. +-

+-
+-

= Archive

+-

+- Netdata can archive its metrics to time-series databa= ses (prometheus, graphite, opentsdb, json document dbs, etc) +- so that Netdata can be integrated to existing monitor= ing tool-chains. +-

+-
+-

= Visualize

+-

+- The best part of Netdata is its visualization. Low la= tency, speedy and snazzy. +-

+- Netdata dashboards are optimized for visual anomaly d= etection, a powerful tool to troubleshoot +- performance issues. +-

+-
+-
+-
+-
+- +-
+-   +-
+- +- +-

netdat= a live demo sites

+-
+-
+- +-
+-
+-
+-
+-
+- Enter Londo= n! +-
+- Donated by DigitalOcean.com +-
+-
+-
+-
+-
+-
+-
+-
+- Enter Atl= anta! +-
+- Donated by CDN77.com +-
+-
+-
+-
+-
+-
+-
+-
+- Enter California! +-
+- Donated by DigitalOcean.com +-
+-
+-
+-
+-
+-
+-
+-
+- Enter Can= ada! +-
+- Donated by DigitalOcean.com +-
+-
+-
+-
 
+-
+-
+-
+-
+-
+- Enter= Germany! +-
+- Donated by DigitalOcean.com +-
+-
+-
+-
+-
+-
+-
+-
+- Enter New= York! +-
+- Donated by DigitalOcean.com +-
+-
+-
+-
+-
+-
+-
+-
+- Enter= Singapore! +-
+- Donated by DigitalOcean.com +-
+-
+-
+-
+-
+-
+-
+-
+- Enter= India! +-
+- Donated by DigitalOcean.com +-
+-
+-
+-
+-
+-
+-
+- Israel +-
+-
+-
+- requests/s +-
+-
+-
+-
+-
+-
+-
+- Ent= er Israel! +-
+- Donated by octopuscs.com +-
+-
+-
+- +-
+-
+-
+- EU - Spain +-
+-
+-
+- requests/s +-
+-
+-
+-
+-
+-
+-
+- E= nter Madrid! +-
+- Donated by stackscale.com +-
+-
+-
+-
+-
+-
+-
+-
+-
+- +-
+- Charts are coming from all servers, in parallel. +-
+- The servers are not aware of this multi-server dashboa= rd. +-
+- +-
+-
+-
+- EU - London connected clients +-
+-
+-
+-
+-
+-
+- +-
+- Each server is not aware of the other servers. +-
+- But on this dashboard they are one! (hover on the char= t above) +-
+- +- +- +-
+-
+- +-

Who uses netdata?

+-
+-
+-

+- Netdata is used by hundreds of thousands of users all ove= r the world. +-
 
+- Check our GitHub watchers list. +-
+- You will find people working for Amazon, Atos, Baidu, Cisco Systems, Citrix, +- Deutsche Telekom, DigitalOcean, Elastic<= /b>, EPAM Systems, Ericsson, Google, +- Groupon, Hortonworks, HP, Huawei<= /b>, IBM, Microsoft, NewRelic, +- Nvidia, Red Hat, SAP, Selectel, TicketMaster, Vimeo, and many more! +-

+- +- The following figures come from users using the netdata public global registry.
Counting since M= ay 16th 2016. Actual figures may be a lot higher.
+-
+-
+-
+- netdata unique users +-
+-
+-
+-
+-
+-
+-
+-
+-
+- netdata monitored servers +-
+-
+-
+-
+-
+-
+-
+-
+-
+- netdata sessions served +-
+-
+-
+-
+-
+-
+-

+- +- +-

+-

+- +- netdata can generate auto-refreshing badges, like these: +- +-
+- +- +- +-
+- These badges auto-refresh every minute. +-

+-
+-
+- netdata is featured at the GitHub's state of the= Octoverse 2016 +-
+- +- +- +-
+-
+- +-
+-
+-
+-
+- +- +- +- +- +- +-
+-
+- +- +- +- +- +- +- +- +- +- +-
+- +- +- +- +- +- +- +diff --git a/web/gui/demosites2.html b/web/gui/demosites2.html +deleted file mode 100644 +index fe35cfb6..00000000 +--- a/web/gui/demosites2.html ++++ /dev/null +@@ -1,1112 +0,0 @@ +- +- +- +- +- NetData - Real-time performance monitoring, done right! +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-
+- +-
+- netdata +-
+-
+- real-time performance monitoring +-
+-
+- scaled out! +-
+-
+- pick a netdata demo server +-
+-
+- these demo servers show what you will get by installing netdat= a +-
+- +-
+-
+- +-
+-
+-
+-
+-
+-
 
+- +-
+- Donated by DigitalOcean.com +-
+-
+-
+-
+-
+-
+-
+-
+-
 
+- +-
+- Donated by CDN77.com +-
+-
+-
+-
+-
+-
+-
+-
+-
 
+- +-
+- Donated by DigitalOcean.com +-
+-
+-
+-
+-
+-
+-
+-
+-
 
+- +-
+- Donated by DigitalOcean.com +-
+-
+-
+-
 
+-
+-
+-
+-
+-
+-
 
+- +-
+- Donated by DigitalOcean.com +-
+-
+-
+-
+-
+-
+-
+-
+-
 
+- +-
+- Donated by DigitalOcean.com +-
+-
+-
+-
+-
+-
+-
+-
+-
 
+- +-
+- Donated by DigitalOcean.com +-
+-
+-
+-
+-
+-
+-
+-
+-
 
+- +-
+- Donated by DigitalOcean.com +-
+-
+-
+-
+-
+- +-
+- this page is a custom netdata dashboard +-
+-
+- charts are coming from 8 servers, in parallel +-
+- the servers are not aware of this multi-server dashboard, +-
+- each server is not aware of the other servers, +-
+- but on this dashboard they are one! +-
+-
+- +- hover on a chart below, or drag it to show the past - the othe= rs will follow! +-
+- double click on a chart to reset them all +-
+- +-
+- our nginx performance +-
+-
+- (we proxy netdata through nginx, on the demo sites) +-
+- +- +- +- +- +-
+-
+-
+-
+- EU - London web requests/s +-
+-
+-
+-
+-
+- +-
+-
+- US - Atlanta web requests/s +-
+-
+-
+-
+-
+- +-
+-
+- US - California web requests/s +-
+-
+-
+-
+-
+- +-
+-
+- Canada web requests/s +-
+-
+-
+-
+-
+-
+- +-
+-
+-
+- EU - London active connections +-
+-
+-
+-
+-
+- +-
+-
+- US - Atlanta active connections +-
+-
+-
+-
+-
+- +-
+-
+- US - California active connections +-
+-
+-
+-
+-
+- +-
+-
+- Canada active connections +-
+-
+-
+-
+-
+-
+-
+- +-
+- these charts= are draggable and touchable, double click them to reset them +-
+- +- +-
+- bandwidth consumption on the demo sites +-
+-
+- +- +- +- +- +-
+-
+-
+-
+-
+- +-
+-
+- +-
+- +-
+-
+-
+- +-
+-
+-
+-
+- +-
+-
+-
+- +-
+- +-
+-
+- +-
+- +-
+-
+-
+- +-
+-
+-
+-
+-
+-
+- these leg= ends are interactive and the charts are resizable here ^^^ +-
+- +-
+- DDoS protection performance on the demo sites +-
+-
+- iptables SYNPROXY configured by = FireHOL +-
+- +-
+- +-
+-
+- EU - London, TCP SYN packets/s received +-
+-
+-
+-
+-
+- +-
+-
+- US - Atlanta, TCP SYN packets/s received +-
+-
+-
+-
+-
+- +-
+-
+- US - California, TCP SYN packets/s received +-
+-
+-
+-
+-
+- +-
+-
+- Canada, TCP SYN packets/s received +-
+-
+-
+-
+-
+-
+-
+- did you n= otice the decimal numbers? +-
netdata interpolates collected values at second boundaries, = with nanosecond detail!
+-
+- +- +-
+- CPU Utilization of the demo sites +-
+- +-
+-
+-
+-
+- +-
+-
+-
+- +-
+-
+-
+- +-
+-
+-
+-
+-
+- what is u= sing so much CPU? +-
The site iplists.firehol.= org is maintained by FireHOL - the CPU is used for comparing security I= P Lists.
+-
+- +-
+- Netdata performance +-
+-
+- netdata monitors users, user groups, application= s (process trees) +-
+- containers (lxc, docker, etc.) a= nd SNMP devices. +-
+- +- +- +- +- +-
+-
+-
+-
+- EU - London, CPU % of a single core +-
+-
+-
+-
+-
+- +-
+-
+- US - Atlanta, CPU % of a single core +-
+-
+-
+-
+-
+- +-
+-
+- US - California, CPU % of a single core +-
+-
+-
+-
+-
+- +-
+-
+- Toronto, CPU % of a single core +-
+-
+-
+-
+-
+- +-
t= his utilization is about the whole netdata process tree and the percentage = is of a single core! +-
including BASH plugins (it monitors mys= ql on the demo sites), node.js plugins (it monitors bin= d9 on the demo sites), etc. +-
and including the chart refreshes for the dashboards= of all viewers.
+-
+-
+- +-
+-
+-
+- EU - London, API average response time in mill= iseconds +-
+-
+-
+-
+-
+- +-
+-
+- US - Atlanta, API average response time in mil= liseconds +-
+-
+-
+-
+-
+- +-
+-
+- US - California, API average response time in = milliseconds +-
+-
+-
+-
+-
+- +-
+-
+- Canada, API average response time in milliseco= nds +-
+-
+-
+-
+-
+- +-
n= etdata is really fast (the values are milliseconds!) +-
+- These values include everything, from the reception of th= e first byte to the dispatch of the last, including gzip compression. +-
+- Values above 2-3ms are usually chart refreshes of charts = with several dimensions, charts with very long durations (zoomed out), or f= ile transfers. +-
+-
+-
+-
+- +-
+- want to know more? +-
+- jump to the netda= ta page at github +-
+- it needs just 3 mins to be installed on your servers! +-
+-   +-
+-
+- +- +- +diff --git a/web/gui/goto-host-from-alarm.html b/web/gui/goto-host-from-al= arm.html +index 7d12f848..af9db7ea 100644 +--- a/web/gui/goto-host-from-alarm.html ++++ b/web/gui/goto-host-from-alarm.html +@@ -2,13 +2,6 @@ + + + +- =20=20=20=20 + Goto a host you know... + + +diff --git a/web/gui/index.html b/web/gui/index.html +index d3099101..47baa548 100644 +--- a/web/gui/index.html ++++ b/web/gui/index.html +@@ -17,22 +17,6 @@ +=20 + +=20 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- + + +=20 +@@ -90,13 +74,9 @@ +
+
+- +-
+-
+- Like what you see?=20 +- Sign in=20 +- to experience the full-range of netdata capabilities! +-
+- Close +-
+-
+-
+=20=20=20=20=20 +
+
+@@ -1140,92 +1109,6 @@ +
+
+=20 +- +-
+-
+-
+-
+-
+-
+- Your netdata version: Unknown
+-
+-
+-
Not checked yet. Please p= ress the Check Now button.
+-
+-
+-
+-
+- For progress reports and key netdata updates: follow = netdata on twitter. +-
+- You can also follow netdata on facebook, +- or watch netdata on github<= /a>. +-
+-
+-
+- Check Now +- +-
+-
+-
+-
+- +-
+-
+-
+-
+-
+-
+-

+- Signing-in to netdata.cloud will synchronize the = list of=20 +- your netdata monitored nodes known at registry=20 +- . This=20 +- may include server hostnames, urls and identifica= tion=20 +- GUIDs. +-

+-

+- After you upgrade all your netdata servers, your = private=20 +- registry will not be needed any more. +-

+-

+- Are you sure you want to proceed? +-

+-
+-
+- +- Sign In +-
+-
+-
+-
+- +-
+-
+-
+-
+-
+-
+-

+- You are about to synchronize your netdata.cloud a= ccount with data from the registry at . +- This may include server hostnames, urls and ident= ification GUIDs. +-

+-

+- Are you sure you want to proceed? +-

+-
+-
+- +- Synchronize +-
+-
+-
+-
+- +
+
+
+diff --git a/web/gui/infographic.html b/web/gui/infographic.html +deleted file mode 100644 +index 24ff8f4e..00000000 +--- a/web/gui/infographic.html ++++ /dev/null +@@ -1,171 +0,0 @@ +- +- +- +- +- +- NetData: Get control of your Linux Servers. Simple. Effective.= Awesome. +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-
+-
+-

+- Interactive infographic of netdata features and functions +-

+-

+- Hover and click on the infographic, to open the related wiki = page. +-
+- +- The links and the docs are still a work in progress. +- The interactive infographic is a feature of draw.io. +- +-

+-
+- +-
+-

+- New to netdata? Have a look at a netdata demo. You will love it! +-

+-

+- +- +- +-

+-
+-
+-
+-
+-
+-
+- +- +- +- +- +- +- +- +- +-
+- +- +- +- +- +- +diff --git a/web/gui/main.js b/web/gui/main.js +index 5bf11e5f..d30192b4 100644 +--- a/web/gui/main.js ++++ b/web/gui/main.js +@@ -17,9 +17,6 @@ var netdataServer =3D undefined; + var netdataServerStatic =3D undefined; + var netdataCheckXSS =3D undefined; +=20 +-// control the welcome modal and analytics +-var this_is_demo =3D null; +- + function escapeUserInputHTML(s) { + return s.toString() + .replace(/&/g, '&') +@@ -206,7 +203,6 @@ var urlOptions =3D { +=20 + netdataShowAlarms =3D false; + netdataRegistry =3D false; +- this_is_demo =3D false; + break; +=20 + case 'live': +@@ -678,32 +674,6 @@ function renderMachines(machinesArray) { +
` + ) + } +- +- html +=3D `
`; +- html +=3D `
Demo netdata nodes
`; +- +- const demoServers =3D [ +- { url: "//london.netdata.rocks/default.html", title: "UK - Lo= ndon (DigitalOcean.com)" }, +- { url: "//newyork.netdata.rocks/default.html", title: "US - N= ew York (DigitalOcean.com)" }, +- { url: "//sanfrancisco.netdata.rocks/default.html", title: "U= S - San Francisco (DigitalOcean.com)" }, +- { url: "//atlanta.netdata.rocks/default.html", title: "US - A= tlanta (CDN77.com)" }, +- { url: "//frankfurt.netdata.rocks/default.html", title: "Germ= any - Frankfurt (DigitalOcean.com)" }, +- { url: "//toronto.netdata.rocks/default.html", title: "Canada= - Toronto (DigitalOcean.com)" }, +- { url: "//singapore.netdata.rocks/default.html", title: "Japa= n - Singapore (DigitalOcean.com)" }, +- { url: "//bangalore.netdata.rocks/default.html", title: "Indi= a - Bangalore (DigitalOcean.com)" }, +- +- ] +- +- for (var server of demoServers) { +- html +=3D ( +- `
+- <= /i> +- ${server.title} +-
+-
+- ` +- ); +- } + } +=20 + return html; +@@ -723,25 +693,9 @@ function clearMyNetdataMenu() { + } +=20 + function errorMyNetdataMenu() { +- setMyNetdataMenu(`
+- +- Cannot load known Netdata agents from Netdata Cloud! Please make = sure you have the latest version of Netdata. +-
`); + } +=20 + function restrictMyNetdataMenu() { +- setMyNetdataMenu(`
+- Please sign in to netdata.cloud to view your nodes! +-
+-
`); +-} +- +-function openAuthenticatedUrl(url) { +- if (isSignedIn()) { +- window.open(url); +- } else { +- window.open(`${NETDATA.registry.cloudBaseURL}/account/sign-in-age= nt?id=3D${NETDATA.registry.machine_guid}&name=3D${encodeURIComponent(NETDAT= A.registry.hostname)}&origin=3D${encodeURIComponent(window.location.origin = + "/")}&redirect_uri=3D${encodeURIComponent(window.location.origin + "/" + = url)}`); +- } + } +=20 + function renderMyNetdataMenu(machinesArray) { +@@ -750,42 +704,10 @@ function renderMyNetdataMenu(machinesArray) { +=20 + if (machinesArray =3D=3D registryAgents) { + console.log("Rendering my-netdata menu from registry"); +- } else { +- console.log("Rendering my-netdata menu from netdata.cloud", machi= nesArray); + } +=20 + let html =3D ''; +=20 +- if (!isSignedIn()) { +- if (!NETDATA.registry.isRegistryEnabled()) { +- html +=3D ( +- `
+- Please sign in to netdata.cloud to view your nodes! +-
+-
+-
` +- ); +- } +- } +- +- if (isSignedIn()) { +- html +=3D ( +- `
+- +- +-
+-
` +- ); +- } +- + // options.hosts =3D [ + // { + // hostname: "streamed1", +@@ -799,73 +721,15 @@ function renderMyNetdataMenu(machinesArray) { + html +=3D `
${renderStreamedH= osts(options)}

`; + } +=20 +- if (isSignedIn() || NETDATA.registry.isRegistryEnabled()) { ++ if (NETDATA.registry.isRegistryEnabled()) { + html +=3D `
${renderMachines(= machinesArray)}

`; + } +=20 +- if (!isSignedIn()) { +- html +=3D ( +- `
+- +- Switch Identity +-
+-
+-
+- +- What is this? +-
+-
` +- ) +- } else { +- html +=3D ( +- `
+- +- Nodes beta +-
+-
+- +-
+- +- What is this? +-
+-
` +- ) +- } +- + el.innerHTML =3D html; +=20 + gotoServerInit(); + } +=20 +-function isdemo() { +- if (this_is_demo !=3D=3D null) { +- return this_is_demo; +- } +- this_is_demo =3D false; +- +- try { +- if (typeof document.location.hostname =3D=3D=3D 'string') { +- if (document.location.hostname.endsWith('.my-netdata.io') || +- document.location.hostname.endsWith('.mynetdata.io') || +- document.location.hostname.endsWith('.netdata.rocks') || +- document.location.hostname.endsWith('.netdata.ai') || +- document.location.hostname.endsWith('.netdata.live') || +- document.location.hostname.endsWith('.firehol.org') || +- document.location.hostname.endsWith('.netdata.online') || +- document.location.hostname.endsWith('.netdata.cloud')) { +- this_is_demo =3D true; +- } +- } +- } +- catch (error) { +- } +- return this_is_demo; +-} +- + function netdataURL(url, forReload) { + if (typeof url =3D=3D=3D 'undefined') + // url =3D document.location.toString(); +@@ -973,28 +837,26 @@ function gotoServerModalHandler(guid) { + gotoServerValidateUrl(count++, guid, url); + } +=20 +- if (!isSignedIn()) { +- // When the registry is enabled, if the user's known URLs are not= working +- // we consult the registry to get additional URLs. +- setTimeout(function () { +- if (gotoServerStop =3D=3D=3D false) { +- document.getElementById('gotoServerResponse').innerHTML = =3D 'Added all the known URLs for this machine.'; +- NETDATA.registry.search(guid, function (data) { +- // console.log(data); +- len =3D data.urls.length; +- while (len--) { +- var url =3D data.urls[len][1]; +- // console.log(url); +- if (typeof checked[url] =3D=3D=3D 'undefined') { +- gotoServerValidateRemaining++; +- checked[url] =3D true; +- gotoServerValidateUrl(count++, guid, url); +- } ++ // When the registry is enabled, if the user's known URLs are not wor= king ++ // we consult the registry to get additional URLs. ++ setTimeout(function () { ++ if (gotoServerStop =3D=3D=3D false) { ++ document.getElementById('gotoServerResponse').innerHTML =3D '= Added all the known URLs for this machine.'; ++ NETDATA.registry.search(guid, function (data) { ++ // console.log(data); ++ len =3D data.urls.length; ++ while (len--) { ++ var url =3D data.urls[len][1]; ++ // console.log(url); ++ if (typeof checked[url] =3D=3D=3D 'undefined') { ++ gotoServerValidateRemaining++; ++ checked[url] =3D true; ++ gotoServerValidateUrl(count++, guid, url); + } +- }); +- } +- }, 2000); +- } ++ } ++ }); ++ } ++ }, 2000); +=20 + return false; + } +@@ -1057,34 +919,15 @@ function notifyForDeleteRegistry() { + const responseEl =3D document.getElementById('deleteRegistryResponse'= ); +=20 + if (deleteRegistryUrl) { +- if (isSignedIn()) { +- deleteCloudAgentURL(deleteRegistryGuid, deleteRegistryUrl) +- .then((count) =3D> { +- if (!count) { +- responseEl.innerHTML =3D "Sorry, this command = was rejected by netdata.cloud!"; +- return; +- } +- NETDATA.registry.delete(deleteRegistryUrl, function (= result) { +- if (result =3D=3D=3D null) { +- console.log("Received error from registry", r= esult); +- } +- +- deleteRegistryUrl =3D null; +- $('#deleteRegistryModal').modal('hide'); +- NETDATA.registry.init(); +- }); +- }); +- } else { +- NETDATA.registry.delete(deleteRegistryUrl, function (result) { +- if (result !=3D=3D null) { +- deleteRegistryUrl =3D null; +- $('#deleteRegistryModal').modal('hide'); +- NETDATA.registry.init(); +- } else { +- responseEl.innerHTML =3D "Sorry, this command was = rejected by the registry server!"; +- } +- }); +- } ++ NETDATA.registry.delete(deleteRegistryUrl, function (result) { ++ if (result !=3D=3D null) { ++ deleteRegistryUrl =3D null; ++ $('#deleteRegistryModal').modal('hide'); ++ NETDATA.registry.init(); ++ } else { ++ responseEl.innerHTML =3D "Sorry, this command was reje= cted by the registry server!"; ++ } ++ }); + } + } +=20 +@@ -2367,11 +2210,7 @@ function alarmsUpdateModal() { + void ($element); + let main_url; + let common_url =3D "&host=3D" + encodeURIComponent(ro= w['hostname']) + "&chart=3D" + encodeURIComponent(row['chart']) + "&family= =3D" + encodeURIComponent(row['family']) + "&alarm=3D" + encodeURIComponent= (row['name']) + "&alarm_unique_id=3D" + row['unique_id'] + "&alarm_id=3D" += row['alarm_id'] + "&alarm_event_id=3D" + row['alarm_event_id'] + "&alarm_= when=3D" + row['when']; +- if (NETDATA.registry.isUsingGlobalRegistry() && NETDA= TA.registry.machine_guid !=3D null) { +- main_url =3D "https://netdata.cloud/alarms/redire= ct?agentID=3D" + NETDATA.registry.machine_guid + common_url; +- } else { +- main_url =3D NETDATA.registry.server + "/goto-hos= t-from-alarm.html?" + common_url ; +- } ++ main_url =3D NETDATA.registry.server + "/goto-host-fr= om-alarm.html?" + common_url ; + window.open(main_url,"_blank"); + }, + rowStyle: function (row, index) { +@@ -2803,7 +2642,6 @@ function initializeDynamicDashboardWithData(data) { + // update the dashboard hostname + document.getElementById('hostname').innerHTML =3D '' + options.hostname + ((netdataSnapshotData !=3D=3D null) ? ' = (snap)' : '').toString() + '  '; + document.getElementById('hostname').href =3D NETDATA.serverDefaul= t; +- document.getElementById('netdataVersion').innerHTML =3D options.v= ersion; +=20 + if (netdataSnapshotData !=3D=3D null) { + $('#alarmsButton').hide(); +@@ -2836,7 +2674,7 @@ function initializeDynamicDashboardWithData(data) { + renderChartsAndMenu(data); +=20 + // Ensure MyNetdata menu is rendered with latest host info #5370 +- renderMyNetdataMenu(isSignedIn() ? cloudAgents : registryAgents); ++ renderMyNetdataMenu(registryAgents); + } + } +=20 +@@ -4136,18 +3974,10 @@ function runOnceOnDashboardWithjQuery() { + // ------------------------------------------------------------------= ------ + // sidebar / affix +=20 +- if (shouldShowSignInBanner()) { +- const el =3D document.getElementById("sign-in-banner"); +- if (el) { +- el.style.display =3D "initial"; +- el.classList.add(`theme-${netdataTheme}`); +- } +- } +- + $('#sidebar') + .affix({ + offset: { +- top: (isdemo()) ? 150 : 0, ++ top: 0, + bottom: 0 + } + }) +@@ -4457,32 +4287,6 @@ function finalizePage() { + $(".shorten").shorten(); + enableTooltipsAndPopovers(); +=20 +- if (isdemo()) { +- // do not to give errors on netdata demo servers for 60 seconds +- NETDATA.options.current.retries_on_data_failures =3D 60; +- +- // google analytics when this is used for the home page of the de= mo sites +- // this does not run on user's installations +- setTimeout(function () { +- (function (i, s, o, g, r, a, m) { +- i['GoogleAnalyticsObject'] =3D r; +- i[r] =3D i[r] || function () { +- (i[r].q =3D i[r].q || []).push(arguments) +- }, i[r].l =3D 1 * new Date(); +- a =3D s.createElement(o), +- m =3D s.getElementsByTagName(o)[0]; +- a.async =3D 1; +- a.src =3D g; +- m.parentNode.insertBefore(a, m) +- })(window, document, 'script', 'https://www.google-analytics.= com/analytics.js', 'ga'); +- +- ga('create', 'UA-64295674-3', 'auto'); +- ga('send', 'pageview', '/demosite/' + window.location.host); +- }, 2000); +- } else { +- notifyForUpdate(); +- } +- + if (urlOptions.show_alarms =3D=3D=3D true) { + setTimeout(function () { + $('#alarmsModal').modal('show'); +@@ -4547,12 +4351,9 @@ var netdataPrepCallback =3D function () { + } + }); +=20 +- if (isdemo()) { +- document.getElementById('masthead').style.display =3D 'block'; +- } else { +- if (urlOptions.update_always =3D=3D=3D true) { +- NETDATA.setOption('stop_updates_when_focus_is_lost', !urlOpti= ons.update_always); +- } ++ ++ if (urlOptions.update_always =3D=3D=3D true) { ++ NETDATA.setOption('stop_updates_when_focus_is_lost', !urlOptions.= update_always); + } + }; +=20 +@@ -4614,542 +4415,4 @@ var selected_server_timezone =3D function (timezon= e, status) { + // our entry point + // var netdataStarted =3D performance.now(); +=20 +-var netdataCallback =3D initializeDynamicDashboard; +- +-// =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +-// netdata.cloud +- +-let registryAgents =3D []; +- +-let cloudAgents =3D []; +- +-let myNetdataMenuFilterValue =3D ""; +- +-let cloudAccountID =3D null; +- +-let cloudAccountName =3D null; +- +-let cloudToken =3D null; +- +-/// Enforces a maximum string length while retaining the prefix and the p= ostfix of +-/// the string. +-function truncateString(str, maxLength) { +- if (str.length <=3D maxLength) { +- return str; +- } +- +- const spanLength =3D Math.floor((maxLength - 3) / 2); +- return `${str.substring(0, spanLength)}...${str.substring(str.length = - spanLength)}`; +-} +- +-// ----------------------------------------------------------------------= --------------------------- +-// netdata.cloud API Client +-// ----------------------------------------------------------------------= --------------------------- +- +-function isValidAgent(a) { +- return a.urls !=3D null && a.urls.length > 0; +-} +- +-// https://github.com/netdata/hub/issues/146 +-function getCloudAccountAgents() { +- if (!isSignedIn()) { +- return []; +- } +- +- return fetch( +- `${NETDATA.registry.cloudBaseURL}/api/v1/accounts/${cloudAccountI= D}/agents`, +- { +- method: "GET", +- mode: "cors", +- headers: { +- "Authorization": `Bearer ${cloudToken}` +- } +- } +- ).then((response) =3D> { +- if (!response.ok) { +- throw Error("Cannot fetch known accounts"); +- } +- return response.json(); +- }).then((payload) =3D> { +- const agents =3D payload.result ? payload.result.agents : null; +- +- if (!agents) { +- return []; +- } +- +- return agents.filter((a) =3D> isValidAgent(a)).map((a) =3D> { +- return { +- "guid": a.id, +- "name": a.name, +- "url": a.urls[0], +- "alternate_urls": a.urls +- } +- }) +- }).catch(function (error) { +- console.log(error); +- return null; +- }); +-} +- +-/** Updates the lastAccessTime and accessCount properties of the agent fo= r the account. */ +-function touchAgent() { +- if (!isSignedIn()) { +- return []; +- } +- +- const touchUrl =3D `${NETDATA.registry.cloudBaseURL}/api/v1/agents/${= NETDATA.registry.machine_guid}/touch?account_id=3D${cloudAccountID}`; +- return fetch( +- touchUrl, +- { +- method: "post", +- body: "", +- mode: "cors", +- headers: { +- "Authorization": `Bearer ${cloudToken}` +- } +- } +- ).then((response) =3D> { +- if (!response.ok) { +- throw Error("Cannot touch agent" + JSON.stringify(response)); +- } +- return response.json(); +- }).then((payload) =3D> { +- +- }).catch(function (error) { +- console.log(error); +- return null; +- }); +-} +- +-// https://github.com/netdata/hub/issues/128 +-function postCloudAccountAgents(agentsToSync) { +- if (!isSignedIn()) { +- return []; +- } +- +- const maskedURL =3D NETDATA.registry.MASKED_DATA; +- +- const agents =3D agentsToSync.map((a) =3D> { +- const urls =3D a.alternate_urls.filter((url) =3D> url !=3D masked= URL); +- +- return { +- "id": a.guid, +- "name": a.name, +- "urls": urls +- } +- }).filter((a) =3D> isValidAgent(a)) +- +- const payload =3D { +- "accountID": cloudAccountID, +- "agents": agents, +- "merge": false, +- }; +- +- return fetch( +- `${NETDATA.registry.cloudBaseURL}/api/v1/accounts/${cloudAccountI= D}/agents`, +- { +- method: "POST", +- mode: "cors", +- headers: { +- "Content-Type": "application/json; charset=3Dutf-8", +- "Authorization": `Bearer ${cloudToken}` +- }, +- body: JSON.stringify(payload) +- } +- ).then((response) =3D> { +- return response.json(); +- }).then((payload) =3D> { +- const agents =3D payload.result ? payload.result.agents : null; +- +- if (!agents) { +- return []; +- } +- +- return agents.filter((a) =3D> isValidAgent(a)).map((a) =3D> { +- return { +- "guid": a.id, +- "name": a.name, +- "url": a.urls[0], +- "alternate_urls": a.urls +- } +- }) +- }); +-} +- +-function deleteCloudAgentURL(agentID, url) { +- if (!isSignedIn()) { +- return []; +- } +- +- return fetch( +- `${NETDATA.registry.cloudBaseURL}/api/v1/accounts/${cloudAccountI= D}/agents/${agentID}/url?value=3D${encodeURIComponent(url)}`, +- { +- method: "DELETE", +- mode: "cors", +- headers: { +- "Content-Type": "application/json; charset=3Dutf-8", +- "Authorization": `Bearer ${cloudToken}` +- }, +- } +- ).then((response) =3D> { +- return response.json(); +- }).then((payload) =3D> { +- const count =3D payload.result ? payload.result.count : 0; +- return count; +- }); +-} +- +-// ----------------------------------------------------------------------= --------------------------- +- +-function signInDidClick(e) { +- e.preventDefault(); +- e.stopPropagation(); +- +- if (!NETDATA.registry.isUsingGlobalRegistry()) { +- // If user is using a private registry, request his consent for +- // synchronizing with cloud. +- showSignInModal(); +- return; +- } +- +- signIn(); +-} +- +-function shouldShowSignInBanner() { +- return false; +-} +- +-function closeSignInBanner() { +- localStorage.setItem("signInBannerClosed", "true"); +- const el =3D document.getElementById("sign-in-banner"); +- if (el) { +- el.style.display =3D "none"; +- } +-} +- +-function closeSignInBannerDidClick(e) { +- closeSignInBanner(); +-} +- +-function signOutDidClick(e) { +- e.preventDefault(); +- e.stopPropagation(); +- signOut(); +-} +- +-// ----------------------------------------------------------------------= --------------------------- +- +-function updateMyNetdataAfterFilterChange() { +- const machinesEl =3D document.getElementById("my-netdata-menu-machine= s") +- machinesEl.innerHTML =3D renderMachines(cloudAgents); +- +- if (options.hosts.length > 1) { +- const streamedEl =3D document.getElementById("my-netdata-menu-str= eamed") +- streamedEl.innerHTML =3D renderStreamedHosts(options); +- } +-} +- +-function myNetdataMenuDidShow() { +- const filterEl =3D document.getElementById("my-netdata-menu-filter-in= put"); +- if (filterEl) { +- filterEl.focus(); +- } +-} +- +-function myNetdataFilterDidChange(e) { +- const inputEl =3D e.target; +- setTimeout(() =3D> { +- myNetdataMenuFilterValue =3D inputEl.value; +- updateMyNetdataAfterFilterChange(); +- }, 1); +-} +- +-function myNetdataFilterClearDidClick(e) { +- e.preventDefault(); +- e.stopPropagation(); +- +- const inputEl =3D document.getElementById("my-netdata-menu-filter-inp= ut"); +- inputEl.value =3D ""; +- myNetdataMenuFilterValue =3D ""; +- +- updateMyNetdataAfterFilterChange(); +- +- inputEl.focus(); +-} +- +-// ----------------------------------------------------------------------= --------------------------- +- +-function clearCloudVariables() { +- cloudAccountID =3D null; +- cloudAccountName =3D null; +- cloudToken =3D null; +-} +- +-function clearCloudLocalStorageItems() { +- localStorage.removeItem("cloud.baseURL"); +- localStorage.removeItem("cloud.agentID"); +- localStorage.removeItem("cloud.sync"); +-} +- +-function signIn() { +- const url =3D `${NETDATA.registry.cloudBaseURL}/account/sign-in-agent= ?id=3D${NETDATA.registry.machine_guid}&name=3D${encodeURIComponent(NETDATA.= registry.hostname)}&origin=3D${encodeURIComponent(window.location.origin + = "/")}`; +- window.open(url); +-} +- +-function signOut() { +- cloudSSOSignOut(); +-} +- +-function handleMessage(e) { +- switch (e.data.type) { +- case "sign-in": +- handleSignInMessage(e); +- break; +- +- case "sign-out": +- handleSignOutMessage(e); +- break; +- +- default: +- return; +- } +-} +- +-function handleSignInMessage(e) { +- closeSignInBanner(); +- localStorage.setItem("cloud.baseURL", NETDATA.registry.cloudBaseURL); +- +- cloudAccountID =3D e.data.accountID; +- cloudAccountName =3D e.data.accountName; +- cloudToken =3D e.data.token; +- +- netdataRegistryCallback(registryAgents); +- if (e.data.redirectURI && !window.location.href.includes(e.data.redir= ectURI)) { +- // lgtm false-positive - redirectURI does not come from user inpu= t, but from iframe callback +- window.location.replace(e.data.redirectURI); // lgtm[js/client-si= de-unvalidated-url-redirection] +- } +-} +- +-function handleSignOutMessage(e) { +- clearCloudVariables(); +- renderMyNetdataMenu(registryAgents); +-} +- +-function isSignedIn() { +- return cloudToken !=3D null && cloudAccountID !=3D null; +-} +- +-function sortedArraysEqual(a, b) { +- if (a.length !=3D b.length) return false; +- +- for (var i =3D 0; i < a.length; ++i) { +- if (a[i] !=3D=3D b[i]) return false; +- } +- +- return true; +-} +- +-// If merging is needed returns the merged agents set, otherwise returns = null. +-function mergeAgents(cloud, local) { +- let dirty =3D false; +- +- const union =3D new Map(); +- +- for (const cagent of cloud) { +- union.set(cagent.guid, cagent); +- } +- +- for (const lagent of local) { +- const cagent =3D union.get(lagent.guid); +- if (cagent) { +- for (const u of lagent.alternate_urls) { +- if (u =3D=3D=3D NETDATA.registry.MASKED_DATA) { // TODO: = temp until registry is updated. +- continue; +- } +- +- if (!cagent.alternate_urls.includes(u)) { +- dirty =3D true; +- cagent.alternate_urls.push(u); +- } +- } +- } else { +- dirty =3D true; +- union.set(lagent.guid, lagent); +- } +- } +- +- if (dirty) { +- return Array.from(union.values()); +- } +- +- return null; +-} +- +-function showSignInModal() { +- document.getElementById("sim-registry").innerHTML =3D NETDATA.registr= y.server; +- $("#signInModal").modal("show"); +-} +- +-function explicitlySignIn() { +- $("#signInModal").modal("hide"); +- signIn(); +-} +- +-function showSyncModal() { +- document.getElementById("sync-registry-modal-registry").innerHTML =3D= NETDATA.registry.server; +- $("#syncRegistryModal").modal("show"); +-} +- +-function explicitlySyncAgents() { +- $("#syncRegistryModal").modal("hide"); +- +- const json =3D localStorage.getItem("cloud.sync"); +- const sync =3D json ? JSON.parse(json) : {}; +- delete sync[cloudAccountID]; +- localStorage.setItem("cloud.sync", JSON.stringify(sync)); +- +- NETDATA.registry.init(); +-} +- +-function syncAgents(callback) { +- const json =3D localStorage.getItem("cloud.sync"); +- const sync =3D json ? JSON.parse(json) : {}; +- +- const currentAgent =3D { +- guid: NETDATA.registry.machine_guid, +- name: NETDATA.registry.hostname, +- url: NETDATA.serverDefault, +- alternate_urls: [NETDATA.serverDefault], +- } +- +- const localAgents =3D sync[cloudAccountID] +- ? [currentAgent] +- : registryAgents.concat([currentAgent]); +- +- console.log("Checking if sync is needed.", localAgents); +- +- const agentsToSync =3D mergeAgents(cloudAgents, localAgents); +- +- if ((!sync[cloudAccountID]) || agentsToSync) { +- sync[cloudAccountID] =3D new Date().getTime(); +- localStorage.setItem("cloud.sync", JSON.stringify(sync)); +- } +- +- if (agentsToSync) { +- console.log("Synchronizing with netdata.cloud."); +- +- postCloudAccountAgents(agentsToSync).then((agents) =3D> { +- // TODO: clear syncTime on error! +- cloudAgents =3D agents; +- callback(cloudAgents); +- }); +- +- return +- } +- +- callback(cloudAgents); +-} +- +-let isCloudSSOInitialized =3D false; +- +-function cloudSSOInit() { +- const iframeEl =3D document.getElementById("ssoifrm"); +- const url =3D `${NETDATA.registry.cloudBaseURL}/account/sso-agent?id= =3D${NETDATA.registry.machine_guid}`; +- iframeEl.src =3D url; +- isCloudSSOInitialized =3D true; +-} +- +-function cloudSSOSignOut() { +- const iframe =3D document.getElementById("ssoifrm"); +- const url =3D `${NETDATA.registry.cloudBaseURL}/account/sign-out-agen= t`; +- iframe.src =3D url; +-} +- +-function initCloud() { +- if (!NETDATA.registry.isCloudEnabled) { +- clearCloudVariables(); +- clearCloudLocalStorageItems(); +- return; +- } +- +- if (NETDATA.registry.cloudBaseURL !=3D localStorage.getItem("cloud.ba= seURL")) { +- clearCloudVariables(); +- clearCloudLocalStorageItems(); +- if (NETDATA.registry.cloudBaseURL) { +- localStorage.setItem("cloud.baseURL", NETDATA.registry.cloudB= aseURL); +- } +- } +- +- if (!isCloudSSOInitialized) { +- cloudSSOInit(); +- } +- +- touchAgent(); +-} +- +-// This callback is called after NETDATA.registry is initialized. +-function netdataRegistryCallback(machinesArray) { +- localStorage.setItem("cloud.agentID", NETDATA.registry.machine_guid); +- +- initCloud(); +- +- registryAgents =3D machinesArray; +- +- if (isSignedIn()) { +- // We call getCloudAccountAgents() here because it requires that +- // NETDATA.registry is initialized. +- clearMyNetdataMenu(); +- getCloudAccountAgents().then((agents) =3D> { +- if (!agents) { +- errorMyNetdataMenu(); +- return; +- } +- cloudAgents =3D agents; +- syncAgents((agents) =3D> { +- const agentsMap =3D {} +- for (const agent of agents) { +- agentsMap[agent.guid] =3D agent; +- } +- +- NETDATA.registry.machines =3D agentsMap; +- NETDATA.registry.machines_array =3D agents; +- +- renderMyNetdataMenu(agents); +- }); +- }); +- } else { +- renderMyNetdataMenu(machinesArray) +- } +-}; +- +-// If we know the cloudBaseURL and agentID from local storage render (eag= erly) +-// the account ui before receiving the definitive response from the web s= erver. +-// This improves the perceived performance. +-function tryFastInitCloud() { +- const baseURL =3D localStorage.getItem("cloud.baseURL"); +- const agentID =3D localStorage.getItem("cloud.agentID"); +- +- if (baseURL && agentID) { +- NETDATA.registry.cloudBaseURL =3D baseURL; +- NETDATA.registry.machine_guid =3D agentID; +- NETDATA.registry.isCloudEnabled =3D true; +- +- initCloud(); +- } +-} +- +-function initializeApp() { +- window.addEventListener("message", handleMessage, false); +- +- // tryFastInitCloud(); +-} +- +-if (document.readyState =3D=3D=3D "complete") { +- initializeApp(); +-} else { +- document.addEventListener("readystatechange", () =3D> { +- if (document.readyState =3D=3D=3D "complete") { +- initializeApp(); +- } +- }); +-} ++var netdataCallback =3D initializeDynamicDashboard; +\ No newline at end of file +diff --git a/web/gui/old/index.html b/web/gui/old/index.html +index 94ec12b7..cffa335e 100644 +--- a/web/gui/old/index.html ++++ b/web/gui/old/index.html +@@ -108,17 +108,6 @@ +
+
+
+- +-
+-
+- Like what you see?=20 +- Sign in=20 +- to experience the full-range of netdata capabilities! +-
+- Close +-
+-
+-
+=20=20=20=20=20 +
+
+@@ -1139,92 +1128,6 @@ +
+
+=20 +- +-
+-
+-
+-
+-
+-
+- Your netdata version: Unknown
+-
+-
+-
Not checked yet. Please p= ress the Check Now button.
+-
+-
+-
+-
+- For progress reports and key netdata updates: follow = netdata on twitter. +-
+- You can also follow netdata on facebook, +- or watch netdata on github<= /a>. +-
+-
+-
+- Check Now +- +-
+-
+-
+-
+- +-
+-
+-
+-
+-
+-
+-

+- Signing-in to netdata.cloud will synchronize the = list of=20 +- your netdata monitored nodes known at registry=20 +- . This=20 +- may include server hostnames, urls and identifica= tion=20 +- GUIDs. +-

+-

+- After you upgrade all your netdata servers, your = private=20 +- registry will not be needed any more. +-

+-

+- Are you sure you want to proceed? +-

+-
+-
+- +- Sign In +-
+-
+-
+-
+- +-
+-
+-
+-
+-
+-
+-

+- You are about to synchronize your netdata.cloud a= ccount with data from the registry at . +- This may include server hostnames, urls and ident= ification GUIDs. +-

+-

+- Are you sure you want to proceed? +-

+-
+-
+- +- Synchronize +-
+-
+-
+-
+- +
+
+
+diff --git a/web/gui/src/dashboard.js/registry.js b/web/gui/src/dashboard.= js/registry.js +index 090ef52f..a2322fb7 100644 +--- a/web/gui/src/dashboard.js/registry.js ++++ b/web/gui/src/dashboard.js/registry.js +@@ -3,25 +3,14 @@ +=20 + NETDATA.registry =3D { + server: null, // the netdata registry server +- isCloudEnabled: false,// is netdata.cloud functionality enabled? +- cloudBaseURL: null, // the netdata cloud base url + person_guid: null, // the unique ID of this browser / user + machine_guid: null, // the unique ID the netdata server that served= dashboard.js + hostname: 'unknown', // the hostname of the netdata server that serv= ed dashboard.js + machines: null, // the user's other URLs + machines_array: null, // the user's other URLs in an array + person_urls: null, +- anonymous_statistics_checked: false, + MASKED_DATA: "***", +=20 +- isUsingGlobalRegistry: function() { +- return NETDATA.registry.server =3D=3D "https://registry.my-netdat= a.io"; +- }, +- +- isRegistryEnabled: function() { +- return !(NETDATA.registry.isUsingGlobalRegistry() || isSignedIn()) +- }, +- + parsePersonUrls: function (person_urls) { + NETDATA.registry.person_urls =3D person_urls; +=20 +@@ -75,26 +64,8 @@ NETDATA.registry =3D { + NETDATA.registry.hello(NETDATA.serverDefault, function (data) { + if (data) { + NETDATA.registry.server =3D data.registry; +- if (data.cloud_base_url !=3D=3D "") { +- NETDATA.registry.isCloudEnabled =3D true; +- NETDATA.registry.cloudBaseURL =3D data.cloud_base_url; +- } else { +- NETDATA.registry.isCloudEnabled =3D false; +- NETDATA.registry.cloudBaseURL =3D ""; +- } + NETDATA.registry.machine_guid =3D data.machine_guid; + NETDATA.registry.hostname =3D data.hostname; +- if (!NETDATA.registry.anonymous_statistics_checked) { +- NETDATA.registry.anonymous_statistics_checked=3Dtrue; +- if (data.anonymous_statistics) { +- (function(w,d,s,l,i){w[l]=3Dw[l]||[];w[l].push({'= gtm.start': +- new Date().getTime(),event:'gtm.js'});var= f=3Dd.getElementsByTagName(s)[0], +- j=3Dd.createElement(s),dl=3Dl!=3D'dataLayer'?= '&l=3D'+l:'';j.async=3Dfalse;j.src=3D +- 'https://www.googletagmanager.com/gtm.js?id= =3D'+i+dl;f.parentNode.insertBefore(j,f); +- })(window,document,'script','dataLayer','GTM-N6CB= MJD'); +- dataLayer.push({"anonymous_statistics" : "true", = "machine_guid" : data.machine_guid}); +- } +- } + NETDATA.registry.access(2, function (person_urls) { + NETDATA.registry.parsePersonUrls(person_urls); + });=20=20=20=20 +@@ -143,12 +114,8 @@ NETDATA.registry =3D { + let name =3D NETDATA.registry.MASKED_DATA; + let url =3D NETDATA.registry.MASKED_DATA; +=20 +- if (!NETDATA.registry.isUsingGlobalRegistry()) { +- // If the user is using a private registry keep sending ident= ifiable +- // data. +- name =3D NETDATA.registry.hostname; +- url =3D NETDATA.serverDefault; +- }=20 ++ name =3D NETDATA.registry.hostname; ++ url =3D NETDATA.serverDefault; +=20 + console.log("ACCESS", name, url); +=20 --=20 2.30.0