Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
b58a2b57c3
!25 [sync] PR-22: update to 1.39.1
From: @openeuler-sync-bot 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
2023-05-24 07:04:21 +00:00
lyn1001
17bb03ef3d update to 1.39.0
(cherry picked from commit 797bc86a2b419bdde63e2fa88afd43e6d48af334)
2023-05-24 14:34:52 +08:00
openeuler-ci-bot
1b31f87115
!16 升级到1.37.1版本修复CVE-2023-22496,CVE-2023-22497
From: @wk333 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
2023-01-30 08:34:11 +00:00
wk333
14a608225d Upgrade to version 1.37.1 2023-01-30 14:49:44 +08:00
openeuler-ci-bot
cdece74796
!14 [sync] PR-11: 解决netdata安装失败
Merge pull request !14 from openeuler-sync-bot/sync-pr11-master-to-openEuler-22.03-LTS-Next
2022-02-07 03:03:08 +00:00
caodongxia
ea8f4ae829 remove install requires glyphicons-halfings-fonts
(cherry picked from commit 180f9415ed14cca242b7de448b91186fe37d86f3)
2022-01-30 16:27:16 +08:00
openeuler-ci-bot
417dd2d6db !2 Fix missing extern in some global variables
From: @si-gui
Reviewed-by: @overweight
Signed-off-by: @overweight
2021-08-04 07:53:58 +00:00
sunguoshuai
48b83c280c Fix missing extern in some global variables 2021-08-04 15:29:21 +08:00
openeuler-ci-bot
3d7202b020 !1 netdata package init
From: @bzg1107
Reviewed-by: @overweight
Signed-off-by: @overweight
2021-06-26 03:27:28 +00:00
baizg1107
2c2ae8fa42 package init 2021-06-25 10:48:24 +08:00
11 changed files with 909 additions and 0 deletions

25
README-packager.md Normal file
View File

@ -0,0 +1,25 @@
# netdata
Netdata is the fastest way to visualize metrics. It is a resource efficient, highly optimized system for collecting and visualizing any type of realtime time-series data, from CPU usage, disk activity, SQL queries, API calls, web site visitors, etc.
netdata tries to visualize the truth of now, in its greatest detail, so that you can get insights of what is happening now and what just happened, on your systems and applications.
## Plugins
### Activate mysql plugin
Be sure to have python library for mysql MySQLdb (faster) or PyMySQL (slower)
* openEuler
````
sudo dnf install python3-mysql
````
Create netdata mysql user
````
CREATE USER 'netdata'@'localhost';
GRANT USAGE on *.* to 'netdata'@'localhost';
FLUSH PRIVILEGES;
````

BIN
config.tar.gz Normal file

Binary file not shown.

View File

@ -0,0 +1,336 @@
Fix shebang according to
https://docs.fedoraproject.org/en-US/packaging-guidelines/#_shebang_lines
diff -rup a/claim/netdata-claim.sh.in b/claim/netdata-claim.sh.in
--- a/claim/netdata-claim.sh.in 2023-05-08 14:52:30.397594409 +0200
+++ b/claim/netdata-claim.sh.in 2023-05-14 11:12:13.229357763 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
# netdata
# real-time performance and health monitoring, done right!
# (C) 2017 Costa Tsaousis <costa@tsaousis.gr>
diff -rup a/collectors/cgroups.plugin/cgroup-name.sh b/collectors/cgroups.plugin/cgroup-name.sh
--- a/collectors/cgroups.plugin/cgroup-name.sh 2023-05-08 14:52:30.397594409 +0200
+++ b/collectors/cgroups.plugin/cgroup-name.sh 2023-05-14 11:12:13.253357925 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
#shellcheck disable=SC2001
# netdata
diff -rup a/collectors/cgroups.plugin/cgroup-network-helper.sh b/collectors/cgroups.plugin/cgroup-network-helper.sh
--- a/collectors/cgroups.plugin/cgroup-network-helper.sh 2023-05-08 14:52:30.397594409 +0200
+++ b/collectors/cgroups.plugin/cgroup-network-helper.sh 2023-05-14 11:12:13.251357912 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
# shellcheck disable=SC1117
# cgroup-network-helper.sh
diff -rup a/collectors/charts.d.plugin/charts.d.dryrun-helper.sh b/collectors/charts.d.plugin/charts.d.dryrun-helper.sh
--- a/collectors/charts.d.plugin/charts.d.dryrun-helper.sh 2023-05-08 14:52:30.401594370 +0200
+++ b/collectors/charts.d.plugin/charts.d.dryrun-helper.sh 2023-05-14 11:12:13.242357851 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
# shellcheck disable=SC2181
diff -rup a/collectors/charts.d.plugin/charts.d.plugin b/collectors/charts.d.plugin/charts.d.plugin
--- a/collectors/charts.d.plugin/charts.d.plugin 2023-05-08 14:53:14.493122687 +0200
+++ b/collectors/charts.d.plugin/charts.d.plugin 2023-05-14 11:12:13.240357837 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
# netdata
diff -rup a/collectors/charts.d.plugin/charts.d.plugin.in b/collectors/charts.d.plugin/charts.d.plugin.in
--- a/collectors/charts.d.plugin/charts.d.plugin.in 2023-05-08 14:52:30.401594370 +0200
+++ b/collectors/charts.d.plugin/charts.d.plugin.in 2023-05-14 11:12:13.237357817 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
# netdata
diff -rup a/collectors/ioping.plugin/ioping.plugin b/collectors/ioping.plugin/ioping.plugin
--- a/collectors/ioping.plugin/ioping.plugin 2023-05-08 14:53:14.653120991 +0200
+++ b/collectors/ioping.plugin/ioping.plugin 2023-05-14 11:12:13.245357872 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
# netdata
diff -rup a/collectors/ioping.plugin/ioping.plugin.in b/collectors/ioping.plugin/ioping.plugin.in
--- a/collectors/ioping.plugin/ioping.plugin.in 2023-05-08 14:52:30.409594292 +0200
+++ b/collectors/ioping.plugin/ioping.plugin.in 2023-05-14 11:12:13.247357885 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
# netdata
diff -rup a/collectors/python.d.plugin/python.d.plugin b/collectors/python.d.plugin/python.d.plugin
--- a/collectors/python.d.plugin/python.d.plugin 2023-05-08 14:53:14.929118066 +0200
+++ b/collectors/python.d.plugin/python.d.plugin 2023-05-14 11:12:13.259357966 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
'''':;
pybinary=$(which python3 || which python || which python2)
filtered=()
diff -rup a/collectors/python.d.plugin/python.d.plugin.in b/collectors/python.d.plugin/python.d.plugin.in
--- a/collectors/python.d.plugin/python.d.plugin.in 2023-05-08 14:52:30.429594097 +0200
+++ b/collectors/python.d.plugin/python.d.plugin.in 2023-05-14 11:12:13.256357946 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
'''':;
pybinary=$(which python3 || which python || which python2)
filtered=()
diff -rup a/collectors/python.d.plugin/python_modules/third_party/boinc_client.py b/collectors/python.d.plugin/python_modules/third_party/boinc_client.py
--- a/collectors/python.d.plugin/python_modules/third_party/boinc_client.py 2023-05-08 14:52:30.433594058 +0200
+++ b/collectors/python.d.plugin/python_modules/third_party/boinc_client.py 2023-05-14 11:12:13.437359174 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#
# -*- coding: utf-8 -*-
#
# client.py - Somewhat higher-level GUI_RPC API for BOINC core client
diff -rup a/collectors/tc.plugin/tc-qos-helper.sh b/collectors/tc.plugin/tc-qos-helper.sh
--- a/collectors/tc.plugin/tc-qos-helper.sh 2023-05-08 14:53:15.429112767 +0200
+++ b/collectors/tc.plugin/tc-qos-helper.sh 2023-05-14 11:12:13.232357783 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
# netdata
# real-time performance and health monitoring, done right!
diff -rup a/collectors/tc.plugin/tc-qos-helper.sh.in b/collectors/tc.plugin/tc-qos-helper.sh.in
--- a/collectors/tc.plugin/tc-qos-helper.sh.in 2023-05-08 14:52:30.441593980 +0200
+++ b/collectors/tc.plugin/tc-qos-helper.sh.in 2023-05-14 11:12:13.234357797 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
# netdata
# real-time performance and health monitoring, done right!
diff -rup a/contrib/debian/install_go.sh b/contrib/debian/install_go.sh
--- a/contrib/debian/install_go.sh 2023-05-08 14:52:30.441593980 +0200
+++ b/contrib/debian/install_go.sh 2023-05-14 11:12:13.261357980 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
GO_PACKAGE_VERSION="$1"
LIB_DIR="$2"
diff -rup a/contrib/rhel/build-netdata-rpm.sh b/contrib/rhel/build-netdata-rpm.sh
--- a/contrib/rhel/build-netdata-rpm.sh 2023-05-08 14:52:30.441593980 +0200
+++ b/contrib/rhel/build-netdata-rpm.sh 2023-05-14 11:12:13.264358000 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
# docker run -it --rm centos:6.9 /bin/sh
# yum -y install rpm-build redhat-rpm-config yum-utils autoconf automake curl gcc git libmnl-devel libuuid-devel make pkgconfig zlib-devel
diff -rup a/coverity-scan.sh b/coverity-scan.sh
--- a/coverity-scan.sh 2023-05-08 14:52:30.441593980 +0200
+++ b/coverity-scan.sh 2023-05-14 11:12:13.266358014 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
#
# Coverity scan script
#
diff -rup a/cppcheck.sh b/cppcheck.sh
--- a/cppcheck.sh 2023-05-08 14:52:30.441593980 +0200
+++ b/cppcheck.sh 2023-05-14 11:12:13.269358034 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
# echo >>/tmp/cppcheck.log "cppcheck ${*}"
diff -rup a/daemon/anonymous-statistics.sh b/daemon/anonymous-statistics.sh
--- a/daemon/anonymous-statistics.sh 2023-05-08 14:53:15.469112343 +0200
+++ b/daemon/anonymous-statistics.sh 2023-05-14 11:12:13.309358305 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env sh
+#!/usr/bin/sh
# Valid actions:
diff -rup a/daemon/anonymous-statistics.sh.in b/daemon/anonymous-statistics.sh.in
--- a/daemon/anonymous-statistics.sh.in 2023-05-08 14:52:30.445593941 +0200
+++ b/daemon/anonymous-statistics.sh.in 2023-05-14 11:12:13.312358326 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env sh
+#!/usr/bin/sh
# Valid actions:
diff -rup a/daemon/get-kubernetes-labels.sh b/daemon/get-kubernetes-labels.sh
--- a/daemon/get-kubernetes-labels.sh 2023-05-08 14:53:15.473112301 +0200
+++ b/daemon/get-kubernetes-labels.sh 2023-05-14 11:12:13.275358075 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
me="$(basename "${0}")"
# Checks if netdata is running in a kubernetes pod and fetches:
diff -rup a/daemon/get-kubernetes-labels.sh.in b/daemon/get-kubernetes-labels.sh.in
--- a/daemon/get-kubernetes-labels.sh.in 2023-05-08 14:52:30.445593941 +0200
+++ b/daemon/get-kubernetes-labels.sh.in 2023-05-14 11:12:13.272358054 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
me="$(basename "${0}")"
# Checks if netdata is running in a kubernetes pod and fetches:
diff -rup a/daemon/system-info.sh b/daemon/system-info.sh
--- a/daemon/system-info.sh 2023-05-08 14:52:30.445593941 +0200
+++ b/daemon/system-info.sh 2023-05-14 11:12:13.307358292 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env sh
+#!/usr/bin/sh
# -------------------------------------------------------------------------------------------------
# detect the kernel
diff -rup a/diagrams/build.sh b/diagrams/build.sh
--- a/diagrams/build.sh 2023-05-08 14:52:30.505593355 +0200
+++ b/diagrams/build.sh 2023-05-14 11:12:13.277358089 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
path=$(dirname "$0")
diff -rup a/exporting/nc-exporting.sh b/exporting/nc-exporting.sh
--- a/exporting/nc-exporting.sh 2023-05-08 14:52:30.525593160 +0200
+++ b/exporting/nc-exporting.sh 2023-05-14 11:12:13.279358102 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
diff -rup a/health/notifications/alarm-email.sh b/health/notifications/alarm-email.sh
--- a/health/notifications/alarm-email.sh 2023-05-08 14:52:30.529593121 +0200
+++ b/health/notifications/alarm-email.sh 2023-05-14 11:12:13.282358122 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
# OBSOLETE - REPLACED WITH
diff -rup a/health/notifications/alarm-notify.sh b/health/notifications/alarm-notify.sh
--- a/health/notifications/alarm-notify.sh 2023-05-08 14:53:16.097105688 +0200
+++ b/health/notifications/alarm-notify.sh 2023-05-14 11:12:13.291358183 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
#shellcheck source=/dev/null disable=SC2086,SC2154
# netdata
diff -rup a/health/notifications/alarm-notify.sh.in b/health/notifications/alarm-notify.sh.in
--- a/health/notifications/alarm-notify.sh.in 2023-05-08 14:52:30.533593082 +0200
+++ b/health/notifications/alarm-notify.sh.in 2023-05-14 11:12:13.285358143 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
#shellcheck source=/dev/null disable=SC2086,SC2154
# netdata
diff -rup a/health/notifications/alarm-test.sh b/health/notifications/alarm-test.sh
--- a/health/notifications/alarm-test.sh 2023-05-08 14:52:30.533593082 +0200
+++ b/health/notifications/alarm-test.sh 2023-05-14 11:12:13.288358163 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
# netdata
# real-time performance and health monitoring, done right!
diff -rup a/ml/dlib/dlib/external/pybind11/tools/mkdoc.py b/ml/dlib/dlib/external/pybind11/tools/mkdoc.py
--- a/ml/dlib/dlib/external/pybind11/tools/mkdoc.py 2023-05-08 14:52:40.109496786 +0200
+++ b/ml/dlib/dlib/external/pybind11/tools/mkdoc.py 2023-05-14 11:12:13.441359201 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/python33
#
# Syntax: mkdoc.py [-I<path> ..] [.. a list of header files ..]
#
diff -rup a/ml/dlib/dlib/travis/build-and-test.sh b/ml/dlib/dlib/travis/build-and-test.sh
--- a/ml/dlib/dlib/travis/build-and-test.sh 2023-05-08 14:52:40.201495797 +0200
+++ b/ml/dlib/dlib/travis/build-and-test.sh 2023-05-14 11:12:13.294358204 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
# Exit if anything fails.
set -eux
diff -rup a/ml/dlib/tools/convert_dlib_nets_to_caffe/running_a_dlib_model_with_caffe_example.py b/ml/dlib/tools/convert_dlib_nets_to_caffe/running_a_dlib_model_with_caffe_example.py
--- a/ml/dlib/tools/convert_dlib_nets_to_caffe/running_a_dlib_model_with_caffe_example.py 2023-05-08 14:52:40.265495109 +0200
+++ b/ml/dlib/tools/convert_dlib_nets_to_caffe/running_a_dlib_model_with_caffe_example.py 2023-05-14 11:12:13.444359221 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# This script takes the dlib lenet model trained by the
# examples/dnn_introduction_ex.cpp example program and runs it using caffe.
diff -rup a/packaging/check-kernel-config.sh b/packaging/check-kernel-config.sh
--- a/packaging/check-kernel-config.sh 2023-05-08 14:52:30.557592848 +0200
+++ b/packaging/check-kernel-config.sh 2023-05-14 11:12:13.297358224 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
get_kernel_version() {
r="$(uname -r | cut -f 1 -d '-')"
diff -rup a/system/edit-config b/system/edit-config
--- a/system/edit-config 2023-05-08 14:52:30.565592770 +0200
+++ b/system/edit-config 2023-05-14 11:12:13.316358353 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env sh
+#!/usr/bin/sh
# shellcheck disable=SC1091
[ -f /etc/profile ] && . /etc/profile
diff -rup a/system/install-service.sh.in b/system/install-service.sh.in
--- a/system/install-service.sh.in 2023-05-08 14:52:30.565592770 +0200
+++ b/system/install-service.sh.in 2023-05-14 11:12:13.318358367 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env sh
+#!/usr/bin/sh
# SPDX-License-Identifier: GPL-3.0-or-later
diff -rup a/system/lsb/init.d/netdata.in b/system/lsb/init.d/netdata.in
--- a/system/lsb/init.d/netdata.in 2023-05-08 14:52:30.565592770 +0200
+++ b/system/lsb/init.d/netdata.in 2023-05-14 11:12:13.299358238 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
#
# Netdata LSB start script
#
diff -rup a/tests/health_mgmtapi/health-cmdapi-test.sh b/tests/health_mgmtapi/health-cmdapi-test.sh
--- a/tests/health_mgmtapi/health-cmdapi-test.sh 2023-05-08 14:53:14.297124764 +0200
+++ b/tests/health_mgmtapi/health-cmdapi-test.sh 2023-05-14 11:12:13.304358271 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
# shellcheck disable=SC1117,SC2034,SC2059,SC2086,SC2181
NETDATA_VARLIB_DIR="/var/lib/netdata"
diff -rup a/tests/health_mgmtapi/health-cmdapi-test.sh.in b/tests/health_mgmtapi/health-cmdapi-test.sh.in
--- a/tests/health_mgmtapi/health-cmdapi-test.sh.in 2023-05-08 14:52:30.569592731 +0200
+++ b/tests/health_mgmtapi/health-cmdapi-test.sh.in 2023-05-14 11:12:13.301358251 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/bash
# shellcheck disable=SC1117,SC2034,SC2059,SC2086,SC2181
NETDATA_VARLIB_DIR="@varlibdir_POST@"

104
netdata-install-go-plugins.sh Executable file
View File

@ -0,0 +1,104 @@
#!/bin/bash
GO_PACKAGE_VERSION="v@PLUGIN_GO_VERSION@"
CHECKSUM_FILE="@DATADIR@/netdata/go.d.checksums"
LIBEXEC_PATH="@LIBEXEC@/netdata"
safe_sha256sum() {
# Within the context of the installer, we only use -c option that is common between the two commands
# We will have to reconsider if we start non-common options
if command -v sha256sum >/dev/null 2>&1; then
sha256sum $@
elif command -v shasum >/dev/null 2>&1; then
shasum -a 256 $@
else
fatal "I could not find a suitable checksum binary to use"
fi
}
download_go() {
url="${1}"
dest="${2}"
if command -v curl >/dev/null 2>&1; then
curl -sSL --connect-timeout 10 --retry 3 "${url}" > "${dest}"
elif command -v wget >/dev/null 2>&1; then
wget -T 15 -O - "${url}" > "${dest}"
else
echo >&2
echo >&2 "Downloading go.d plugin from '${url}' failed because of missing mandatory packages."
echo >&2 "Either add packages or disable it by issuing '--disable-go' in the installer"
echo >&2
exit 1
fi
}
install_go() {
# When updating this value, ensure correct checksums in packaging/go.d.checksums
ARCH_MAP=(
'i386::386'
'i686::386'
'x86_64::amd64'
'aarch64::arm64'
'armv64::arm64'
'armv6l::arm'
'armv7l::arm'
'armv5tel::arm'
)
if [ -z "${NETDATA_DISABLE_GO+x}" ]; then
echo >&2 "Install go.d.plugin"
ARCH=$(uname -m)
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
for index in "${ARCH_MAP[@]}" ; do
KEY="${index%%::*}"
VALUE="${index##*::}"
if [ "$KEY" = "$ARCH" ]; then
ARCH="${VALUE}"
break
fi
done
tmp=$(mktemp -d /tmp/netdata-go-XXXXXX)
GO_PACKAGE_BASENAME="go.d.plugin-${GO_PACKAGE_VERSION}.${OS}-${ARCH}.tar.gz"
download_go "https://github.com/netdata/go.d.plugin/releases/download/${GO_PACKAGE_VERSION}/${GO_PACKAGE_BASENAME}" "${tmp}/${GO_PACKAGE_BASENAME}"
# Include in RPM
#download_go "https://github.com/netdata/go.d.plugin/releases/download/${GO_PACKAGE_VERSION}/config.tar.gz" "${tmp}/config.tar.gz"
#if [ ! -f "${tmp}/${GO_PACKAGE_BASENAME}" ] || [ ! -f "${tmp}/config.tar.gz" ] || [ ! -s "${tmp}/config.tar.gz" ] || [ ! -s "${tmp}/${GO_PACKAGE_BASENAME}" ]; then
if [ ! -f "${tmp}/${GO_PACKAGE_BASENAME}" ] || [ ! -s "${tmp}/${GO_PACKAGE_BASENAME}" ]; then
echo >&2 "Either check the error or consider disabling it by issuing '--disable-go' in the installer"
echo >&2
return 1
fi
grep "${GO_PACKAGE_BASENAME}\$" "${CHECKSUM_FILE}" > "${tmp}/sha256sums.txt" 2>/dev/null
#grep "config.tar.gz" "${CHECKSUM_FILE}" >> "${tmp}/sha256sums.txt" 2>/dev/null
# Checksum validation
if ! (cd "${tmp}" && safe_sha256sum -c "sha256sums.txt"); then
echo >&2 "go.d plugin checksum validation failure."
echo >&2 "Either check the error or consider disabling it by issuing '--disable-go' in the installer"
echo >&2
echo "go.d.plugin package files checksum validation failed."
exit 1
fi
# Install files
#tar -xf "${tmp}/config.tar.gz" -C "${NETDATA_CONF_STOCK}/conf.d/"
tar xf "${tmp}/${GO_PACKAGE_BASENAME}"
install -m 0750 -p "${GO_PACKAGE_BASENAME/\.tar\.gz/}" ${LIBEXEC_PATH}/plugins.d/go.d.plugin
setcap 'cap_net_admin=eip cap_net_raw=eip' ${LIBEXEC_PATH}/plugins.d/go.d.plugin
rm -rf "${tmp}"
fi
return 0
}
if [ ${UID} -ne 0 ]
then
echo "This script must be run by root, please use sudo"
exit 1
fi
install_go

View File

@ -0,0 +1,40 @@
diff -rup a/web/gui/dashboard/Makefile.am b/web/gui/dashboard/Makefile.am
--- a/web/gui/dashboard/Makefile.am 2023-02-06 15:18:31.201561714 +0100
+++ b/web/gui/dashboard/Makefile.am 2023-02-07 08:59:30.617627390 +0100
@@ -171,36 +171,3 @@ dist_webstaticjs_DATA = \
$(srcdir)/static/js/runtime-main.08abed8f.js \
$(srcdir)/static/js/runtime-main.08abed8f.js.map \
$(NULL)
-
-webstaticmediadir=$(webdir)/static/media
-dist_webstaticmedia_DATA = \
- $(srcdir)/static/media/ibm-plex-sans-latin-100.245539db.woff2 \
- $(srcdir)/static/media/ibm-plex-sans-latin-100.9a582f3a.woff \
- $(srcdir)/static/media/ibm-plex-sans-latin-100italic.1ea7c5d2.woff \
- $(srcdir)/static/media/ibm-plex-sans-latin-100italic.3c34cf08.woff2 \
- $(srcdir)/static/media/ibm-plex-sans-latin-200.67524c36.woff \
- $(srcdir)/static/media/ibm-plex-sans-latin-200.bf72c841.woff2 \
- $(srcdir)/static/media/ibm-plex-sans-latin-200italic.52df2560.woff \
- $(srcdir)/static/media/ibm-plex-sans-latin-200italic.bbc2d552.woff2 \
- $(srcdir)/static/media/ibm-plex-sans-latin-300.10bb6a0a.woff \
- $(srcdir)/static/media/ibm-plex-sans-latin-300.9e1c48af.woff2 \
- $(srcdir)/static/media/ibm-plex-sans-latin-300italic.c76f2ab5.woff2 \
- $(srcdir)/static/media/ibm-plex-sans-latin-300italic.d3566d5b.woff \
- $(srcdir)/static/media/ibm-plex-sans-latin-400.263d6267.woff2 \
- $(srcdir)/static/media/ibm-plex-sans-latin-400.a2c56f94.woff \
- $(srcdir)/static/media/ibm-plex-sans-latin-400italic.272f8611.woff \
- $(srcdir)/static/media/ibm-plex-sans-latin-400italic.89a93a1b.woff2 \
- $(srcdir)/static/media/ibm-plex-sans-latin-500.0866c244.woff2 \
- $(srcdir)/static/media/ibm-plex-sans-latin-500.f6d5c5d5.woff \
- $(srcdir)/static/media/ibm-plex-sans-latin-500italic.ccd41bd1.woff \
- $(srcdir)/static/media/ibm-plex-sans-latin-500italic.ffd12d59.woff2 \
- $(srcdir)/static/media/ibm-plex-sans-latin-600.337b1651.woff \
- $(srcdir)/static/media/ibm-plex-sans-latin-600.7852d4dc.woff2 \
- $(srcdir)/static/media/ibm-plex-sans-latin-600italic.17e5379f.woff2 \
- $(srcdir)/static/media/ibm-plex-sans-latin-600italic.6f4ba6aa.woff \
- $(srcdir)/static/media/ibm-plex-sans-latin-700.b8809d61.woff \
- $(srcdir)/static/media/ibm-plex-sans-latin-700.c9983d3d.woff2 \
- $(srcdir)/static/media/ibm-plex-sans-latin-700italic.02954bee.woff2 \
- $(srcdir)/static/media/ibm-plex-sans-latin-700italic.72e9af40.woff \
- $(srcdir)/static/media/material-icons.0509ab09.woff2 \
- $(NULL)

BIN
netdata-v1.39.1.tar.gz Normal file

Binary file not shown.

38
netdata.conf Normal file
View File

@ -0,0 +1,38 @@
# netdata configuration
#
# You can get the latest version of this file, using:
#
# netdatacli dumpconfig > /etc/netdata/netdata.conf
#
# You can also download it using:
#
# wget -O /etc/netdata/netdata.conf http://localhost:19999/netdata.conf
# or
# curl -o /etc/netdata/netdata.conf http://localhost:19999/netdata.conf
#
# You can uncomment and change any of the options below.
# The value shown in the commented settings, is the default value.
#
[global]
run as user = netdata
# default storage size - increase for longer data retention
page cache size = 32
dbengine multihost disk space = 256
# some defaults to run netdata with least priority
process scheduling policy = idle
OOM score = 1000
stock config directory = /usr/lib/netdata/conf.d
[web]
web files owner = root
web files group = netdata
# by default do not expose the netdata port
bind to = localhost
[health]
stock health configuration directory = /usr/lib/netdata/conf.d/health.d

71
netdata.init Normal file
View File

@ -0,0 +1,71 @@
#!/bin/bash
#
# netdata This shell script takes care of starting and stopping netdata.
#
# chkconfig: 345 99 01
# description: netdata is a Real-time performance monitoring
# probe: false
# processname: netdata
# pidfile: /var/run/netdata.pid
### BEGIN INIT INFO
# Provides: netdata
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 3 4 5
# Short-Description: netdata.
# Description: netdata is a highly optimized Linux daemon providing real-time
# performance monitoring for Linux systems, Applications, SNMP devices, over
# the web!
#It tries to visualize the truth of now, in its greatest detail, so that you
#can get insights of what is happening now and what just happened, on your
#systems and applications.
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
[ -f /usr/sbin/netdata ] || exit 0
# See how we were called.
case "$1" in
start)
if [ -n "`/sbin/pidof netdata`" ]; then
echo -n "netdata: already running"
RETVAL=$?
echo
exit $RETVAL
fi
echo -n "Starting netdata: "
/usr/sbin/netdata ${OPTIONS}
RETVAL=$?
[ $RETVAL -eq 0 ] && success || failure
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/netdata
;;
stop)
echo -n "Stopping netdata: "
killproc netdata
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/netdata
;;
status)
status netdata
RETVAL=$?
;;
restart|reload)
$0 stop
$0 start
RETVAL=$?
;;
*)
echo "Usage: netdata {start|stop|status|restart}"
exit 1
;;
esac
exit $RETVAL

5
netdata.profile Normal file
View File

@ -0,0 +1,5 @@
# env vars for netdata
export NETDATA_STOCK_CONFIG_DIR="@STOCK_CONFIG_DIR@/conf.d"
export NETDATA_USER_CONFIG_DIR="/etc/netdata"
export NETDATA_VARLIB_DIR="/var/lib/netdata"
export NETDATA_CACHE_DIR="/var/cache/netdata"

289
netdata.spec Normal file
View File

@ -0,0 +1,289 @@
%bcond_with netfilteracct
%bcond_without cups
%global _hardened_build 1
# Build release candidate
%global plugin_go_ver 0.52.2
%global netdata_conf_stock %{_prefix}/lib/%{name}
Name: netdata
Version: 1.39.1
Release: 1
Summary: Real-time performance monitoring
License: GPLv3 and GPLv3+ and ASL 2.0 and CC-BY-4.0 and MIT and WTFPL
URL: https://github.com/%{name}/%{name}/
Source0: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-v%{version}.tar.gz
Source1: netdata.tmpfiles.conf
Source2: netdata.init
Source3: netdata.conf
Source4: netdata.profile
Source5: README-packager.md
Source6: https://github.com/netdata/go.d.plugin/releases/download/v%{plugin_go_ver}/config.tar.gz
Source7: netdata-install-go-plugins.sh
Patch0: netdata-fix-shebang-1.39.0.patch
# Remove embedded font
Patch10: netdata-remove-fonts-1.38.0.patch
BuildRequires: zlib-devel
BuildRequires: git
BuildRequires: autoconf
BuildRequires: autoconf-archive
BuildRequires: automake
BuildRequires: pkgconfig
BuildRequires: libuuid-devel
BuildRequires: freeipmi-devel
BuildRequires: httpd
BuildRequires: gcc
BuildRequires: libuv-devel
BuildRequires: Judy-devel
BuildRequires: lz4-devel
BuildRequires: openssl-devel
BuildRequires: libmnl-devel
BuildRequires: make
BuildRequires: libcurl-devel
BuildRequires: systemd
BuildRequires: openssl-devel
BuildRequires: libpfm-devel
BuildRequires: libyaml-devel
BuildRequires: autogen
# Prometheus
BuildRequires: snappy-devel
BuildRequires: protobuf-devel
BuildRequires: protobuf-c-devel
BuildRequires: findutils
# Cloud client
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: json-c-devel
BuildRequires: libcap-devel
# For tests
BuildRequires: libcmocka-devel
%if %{with cups}
BuildRequires: cups-devel >= 1.7
%endif
%if %{with netfilteracct}
BuildRequires: libnetfilter_acct-devel
%endif
BuildRequires: python3
Requires: nodejs
Requires: curl
Requires: nc
Requires: snappy
Requires: protobuf-c
Requires: protobuf
Requires: logrotate
Requires: %{name}-data = %{version}-%{release}
Requires: %{name}-conf = %{version}-%{release}
%description
netdata is the fastest way to visualize metrics. It is a resource
efficient, highly optimized system for collecting and visualizing any
type of realtime time-series data, from CPU usage, disk activity, SQL
queries, API calls, web site visitors, etc.
netdata tries to visualize the truth of now, in its greatest detail,
so that you can get insights of what is happening now and what just
happened, on your systems and applications.
%package data
BuildArch: noarch
Summary: Data files for netdata
Requires: /usr/sbin/useradd
Requires: /usr/sbin/groupadd
Requires: /usr/bin/systemctl
%description data
Data files for netdata
%package conf
BuildArch: noarch
Summary: Configuration files for netdata
Requires: logrotate
%description conf
Configuration files for netdata
%package freeipmi
Summary: FreeIPMI plugin for netdata
Requires: %{name}%{?_isa} = %{version}-%{release}
License: GPLv3
%description freeipmi
freeipmi plugin for netdata
%prep
%setup -qn %{name}-v%{version}
%patch0 -p1
# Remove embedded font(added in requires)
%patch10 -p1
rm -rf web/fonts web/gui/dashboard/static/media
cp %{SOURCE5} .
%build
autoreconf -ivf
%configure \
--enable-plugin-freeipmi \
%if %{with netfilteracct}
--enable-plugin-nfacct \
%endif
%if %{with cups}
--enable-plugin-cups \
%endif
--with-zlib \
--with-math \
--with-user=netdata
%make_build
# Integrate go plugins
mkdir conf.d
tar -xf %{SOURCE6} -C conf.d/
%install
%make_install
find %{buildroot} -name '.keep' -delete
# Unit file
mkdir -p %{buildroot}%{_unitdir}
mkdir -p %{buildroot}%{_tmpfilesdir}
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
install -Dp -m 0644 system/systemd/netdata.service %{buildroot}%{_unitdir}/%{name}.service
install -p -m 0644 %{SOURCE1} %{buildroot}%{_tmpfilesdir}/%{name}.conf
install -Dp -m 0644 system/logrotate/netdata %{buildroot}%{_sysconfdir}/logrotate.d/netdata
mkdir -p %{buildroot}%{_localstatedir}/lib/%{name}
mkdir -p %{buildroot}%{_localstatedir}/log/%{name}
mkdir -p %{buildroot}%{_localstatedir}/cache/%{name}
install -p -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/%{name}/
mkdir -p %{buildroot}%{netdata_conf_stock}/conf.d
mv %{buildroot}%{_libdir}/%{name}/conf.d/* %{buildroot}%{netdata_conf_stock}/conf.d/
sed -i -e '/NETDATA_STOCK_CONFIG_DIR/ s/lib64/lib/' %{buildroot}%{_sysconfdir}/%{name}/edit-config
sed -i -e '/^script_dir/s;=.*;="\$\{NETDATA_USER_CONFIG_DIR:-%{_sysconfdir}/netdata\}";' \
%{buildroot}%{_sysconfdir}/%{name}/edit-config
# Scripts must not be in /etc, /usr/libexec is a better place
mv %{buildroot}%{_sysconfdir}/%{name}/edit-config %{buildroot}%{_libexecdir}/%{name}/edit-config
# Fix EOL
sed -i -e 's/\r//' %{buildroot}%{_datadir}/%{name}/web/lib/tableExport-1.6.0.min.js
# Delete system dir with init scripts or unit files
rm -rf %{buildroot}%{_libdir}/%{name}/system
# Delete useless hidden dir
rm -rf %{buildroot}%{_datadir}/%{name}/web/.well-known
# Delete useless file (ubuntu)
rm -f %{buildroot}%{_sysconfdir}/%{name}/conf.d/ebpf.d/ebpf_kernel_reject_list.txt
for dir in charts.d health.d python.d statsd.d ; do
mkdir -p %{buildroot}%{_sysconfdir}/%{name}/${dir}
done
mkdir -p %{buildroot}%{_sysconfdir}/profile.d
install -p -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/profile.d/netdata.sh
sed -i -e '/NETDATA_STOCK_CONFIG_DIR/s;@STOCK_CONFIG_DIR@;%{netdata_conf_stock};' %{buildroot}%{_sysconfdir}/profile.d/netdata.sh
# Integrate go plugins
mkdir -p %{buildroot}%{_sysconfdir}/%{name}/go.d
install -p conf.d/go.d.conf %{buildroot}%{netdata_conf_stock}/conf.d/go.d.conf
cp -rp conf.d/go.d %{buildroot}%{netdata_conf_stock}/conf.d/go.d
install -p -m 0644 packaging/go.d.checksums %{buildroot}%{_datadir}/%{name}/go.d.checksums
install -p -m 0750 %{SOURCE7} %{buildroot}%{_sbindir}/netdata-install-go-plugins.sh
sed -i \
-e 's;@PLUGIN_GO_VERSION@;%{plugin_go_ver};' \
-e 's;@DATADIR@;%{_datadir};' \
-e 's;@LIBEXEC@;%{_libexecdir};' \
%{buildroot}%{_sbindir}/netdata-install-go-plugins.sh
%check
make tests
%pre data
getent group netdata > /dev/null || groupadd -r netdata
getent passwd netdata > /dev/null || useradd -r -g netdata -c "NetData User" -s /sbin/nologin -d /var/log/%{name} netdata
%post
sed -i -e '/web files group/ s/root/netdata/' /etc/netdata/netdata.conf ||:
sed -i -e '/stock config directory/ s;/etc/netdata/conf.d;/usr/lib/netdata/conf.d;' /etc/netdata/netdata.conf ||:
sed -i -e '/stock health configuration directory/ s;/etc/netdata/conf.d/health.d;/usr/lib/netdata/conf.d/health.d;' /etc/netdata/netdata.conf ||:
%systemd_post %{name}.service
echo "Netdata config should be edited with %{_libexecdir}/%{name}/edit-config"
echo "Netdata go plugin can be easily installed with %{_sbindir}/netdata-install-go-plugins.sh script"
%preun
%systemd_preun %{name}.service
%postun
%systemd_postun_with_restart %{name}.service
%files
%doc README.md CHANGELOG.md README-packager.md
%license LICENSE REDISTRIBUTED.md
%{_sbindir}/%{name}
%{_sbindir}/%{name}-claim.sh
%{_sbindir}/%{name}cli
%{_libexecdir}/%{name}/*
%{_unitdir}/%{name}.service
%{_tmpfilesdir}/%{name}.conf
%caps(cap_dac_read_search,cap_sys_ptrace=ep) %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/apps.plugin
%caps(cap_setuid=ep) %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/cgroup-network
%attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/cgroup-network-helper.sh
%caps(cap_setuid=ep) %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/perf.plugin
%caps(cap_setuid=ep) %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/slabinfo.plugin
%if %{with cups}
%attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/cups.plugin
%endif
%exclude %{_libexecdir}/%{name}/edit-config
%exclude %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin
%attr(0755, netdata, netdata) %{_localstatedir}/lib/%{name}
%attr(0755, netdata, netdata) %dir %{_localstatedir}/cache/%{name}
%attr(0755, netdata, netdata) %dir %{_localstatedir}/log/%{name}
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%attr(0750,root,netdata)%{_sbindir}/netdata-install-go-plugins.sh
%files conf
%doc README.md
%license LICENSE REDISTRIBUTED.md
%dir %{_sysconfdir}/%{name}
%dir %{_sysconfdir}/%{name}/charts.d
%dir %{_sysconfdir}/%{name}/health.d
%dir %{_sysconfdir}/%{name}/python.d
%dir %{_sysconfdir}/%{name}/statsd.d
%dir %{_sysconfdir}/%{name}/go.d
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
%dir %{netdata_conf_stock}/conf.d
%{netdata_conf_stock}/conf.d/*
%config %{_sysconfdir}/logrotate.d/netdata
%config %{_sysconfdir}/profile.d/netdata.sh
%dir %{_libexecdir}/%{name}
%{_libexecdir}/%{name}/edit-config
%{_sysconfdir}/netdata/.install-type
%files data
%doc README.md
%license LICENSE REDISTRIBUTED.md
%dir %{_datadir}/%{name}
%attr(-, root, netdata) %{_datadir}/%{name}/web
%{_datadir}/%{name}/go.d.checksums
%files freeipmi
%doc README.md
%license LICENSE REDISTRIBUTED.md
%caps(cap_setuid=ep) %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin
%changelog
* Tue May 23 2023 liyanan <thistleslyn@163.com> - 1.39.1-1
- update to 1.39.1
* Mon Jan 30 2023 wangkai <wangkai385@h-partners.com> - 1.37.1-1
- Upgrade to version 1.37.1 for fix CVE-2023-22496,CVE-2023-22497
* Sat Jan 29 2022 caodongxia <caodongxia@huawei.com> - 1.16.0-3
- remove install requires glyphicons-halfings-fonts
* Wed Aug 04 2021 sunguoshuai <sunguoshuai@huawei.com> - 1.16.0-2
- Fix missing extern in some global variables
* Thu Jun 24 2021 baizhonggui <baizhonggui@huawei.com> - 1.16.0-1
- package init

1
netdata.tmpfiles.conf Normal file
View File

@ -0,0 +1 @@
D /run/netdata 0775 netdata netdata -