From 5da14042f70711ea5cf66e034699730335462f66 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 5 May 2024 14:08:03 +0200 Subject: Merging upstream version 1.45.3+dfsg. Signed-off-by: Daniel Baumann --- netdata.spec.in | 523 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 259 insertions(+), 264 deletions(-) (limited to 'netdata.spec.in') diff --git a/netdata.spec.in b/netdata.spec.in index 7ebe5e276..ecaf573d0 100644 --- a/netdata.spec.in +++ b/netdata.spec.in @@ -1,8 +1,6 @@ # SPDX-License-Identifier: GPL-3.0-or-later %global contentdir %{_datadir}/netdata %global version @PACKAGE_VERSION@ -%global go_version @GO_PACKAGE_VERSION@ -%global go_name go.d.plugin # XXX: We are using automatic `Requires:` generation for libraries # whenever possible, DO NOT LIST LIBRARY DEPENDENCIES UNLESS THE RESULTANT @@ -10,25 +8,38 @@ AutoReqProv: yes # This is temporary and should eventually be resolved. This bypasses -# the default rhel __os_install_p,ost which throws a python compile +# the default rhel __os_install_post which throws a python compile # error. %global __os_install_post %{nil} -# We don’t want LTO as it has a minimal performance impact at runtime -# but a huge impact on build times (we want our CI to not take multiple -# hours to finish). -%global _lto_cflags %nil - -# Disable go.d.plugin build on outdated golang distros -%if 0 -%if 0%{?centos_ver:1} -%if 0%{?centos_ver} >= 10 && 0%{?almalinux_ver:1} && 0%{?rocky_ver:1} -%global _golang_build 1 -%else -%global _golang_build 0 +# This is needed to support proper handling of Go code without requiring +# external linking or GCCGO, because even recent versions of rpmbuild do +# not properly support the build IDs generated by the upstream Go toolchain. %global _missing_build_ids_terminate_build 0 + +# Use our custom CMake version from our package builders if we can’t find cmake. +%if 0%{?centos_ver} == 7 +%global __cmake /cmake/bin/cmake +%global __cmake_builddir . +%global cmake %{__cmake} +%global cmake_build %{__cmake} --build %{__cmake_builddir} --verbose --parallel $(nproc) +%global cmake_install DESTDIR="%{buildroot}" %{__cmake} --install %{__cmake_builddir} +%global _have_ml 0 %endif +%if 0%{?amazon_linux} == 2 +%global __cmake /cmake/bin/cmake +%global __cmake_builddir . +%global cmake %{__cmake} +%global cmake_build %{__cmake} --build %{__cmake_builddir} --verbose --parallel $(nproc) +%global cmake_install DESTDIR="%{buildroot}" %{__cmake} --install %{__cmake_builddir} +%global _have_ml 0 %endif + +# openSUSE requires us to explicity ask for ninja for builds. +# We also need to specify the build directory since they do not. +%if 0%{?suse_version} +%global __builder ninja +%global __cmake_builddir %{__builddir} %endif # Disable eBPF for architectures other than x86 @@ -58,6 +69,13 @@ AutoReqProv: yes %global _have_freeipmi 1 %endif +# Disable CUPS on old RHEL systems. +%if 0%{?centos_ver} != 6 && 0%{?centos_ver} != 7 && 0%{?amazon_linux} != 2 +%global _have_cups 1 +%else +%global _have_cups 0 +%endif + # Disable NFACCT for RHEL equivalents and Amazon Linux %if 0%{?centos_ver} || 0%{?amzn} %global _have_nfacct 0 @@ -65,6 +83,32 @@ AutoReqProv: yes %global _have_nfacct 1 %endif +# Disable xenstat if we’re not on Fedora or openSUSE +%if 0%{?suse_version} || 0%{?fedora} +%if 0%{!?amzm:1} +%global _have_xenstat 0 +%else +%global _have_xenstat 1 +%endif +%else +%global _have_xenstat 0 +%endif + +# Skip MongoDB exporter on known problem platforms +%if 0%{?oraclelinux} || 0%{?suse_version} || 0%{?amzn} +%global _have_mongo_exporter 0 +%else +%global _have_mongo_exporter 1 +%endif + +# If ML hasn’t been explicitly disabled or enabled yet, enable it now. +%if 0%{!?_have_ml:1} +%global _have_ml 1 +%endif + +# Filter known bogus deps that would be caught by AutoReqProv. +%global __requires_exclude_from ^%{_libdir}/%{name}/system/.*$ + Summary: Real-time performance monitoring, done right! Name: netdata Version: %{version} @@ -72,8 +116,6 @@ Release: 1%{?dist} License: GPLv3+ Group: Applications/System Source0: https://github.com/%{name}/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz -Source1: https://github.com/%{name}/%{go_name}/releases/download/v%{go_version}/config.tar.gz -Source2: https://github.com/%{name}/%{go_name}/archive/refs/tags/v%{go_version}.tar.gz URL: http://my-%{name}.io # Remove conflicting EPEL packages @@ -90,49 +132,40 @@ BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: make BuildRequires: git-core -BuildRequires: autoconf -%if 0%{?fedora} || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1140 -BuildRequires: autoconf-archive -%if 0%{?rhel} <= 8 && 0%{?amzn} < 2023 -BuildRequires: autogen -%endif -%endif -BuildRequires: automake BuildRequires: cmake +%if 0%{!?suse_version:1} +BuildRequires: ninja-build +%else +BuildRequires: ninja +%endif BuildRequires: pkgconfig BuildRequires: curl BuildRequires: findutils -BuildRequires: zlib-devel -BuildRequires: libuuid-devel -BuildRequires: libuv-devel >= 1 -BuildRequires: openssl-devel -BuildRequires: libcurl-devel +BuildRequires: pkgconfig(zlib) +BuildRequires: pkgconfig(uuid) +BuildRequires: pkgconfig(libuv) +BuildRequires: pkgconfig(openssl) +BuildRequires: pkgconfig(libcurl) +BuildRequires: pkgconfig(liblz4) +BuildRequires: pkgconfig(yaml-0.1) +BuildRequires: pkgconfig(json-c) %if 0%{?suse_version} # log2journal is not available on these systems %else -BuildRequires: pcre2-devel +BuildRequires: pkgconfig(libpcre2-8) %endif %if 0%{?suse_version} BuildRequires: protobuf-devel BuildRequires: libprotobuf-c-devel -BuildRequires: liblz4-devel -BuildRequires: libjson-c-devel -BuildRequires: libyaml-devel %else %if 0%{?fedora} BuildRequires: protobuf-devel BuildRequires: protobuf-c-devel -BuildRequires: lz4-devel -BuildRequires: json-c-devel -BuildRequires: libyaml-devel %else %if 0%{?centos_ver} >= 8 BuildRequires: protobuf-devel BuildRequires: protobuf-c-devel %endif -BuildRequires: lz4-devel -BuildRequires: json-c-devel -BuildRequires: libyaml-devel %endif %endif @@ -164,18 +197,25 @@ Requires: %{name}-plugin-debugfs = %{version} Requires: %{name}-plugin-chartsd = %{version} Requires: %{name}-plugin-slabinfo = %{version} Requires: %{name}-plugin-perf = %{version} -%if 0%{?_have_nfacct} +%if %{_have_nfacct} Requires: %{name}-plugin-nfacct = %{version} %endif -%if 0%{?_have_freeipmi} && 0%{?centos_ver} != 6 && 0%{?centos_ver} != 7 && 0%{?amazon_linux} != 2 +%if %{_have_xenstat} +Suggests: %{name}-plugin-xenstat = %{version} +%endif +%if %{_have_freeipmi} && 0%{?centos_ver} != 6 && 0%{?centos_ver} != 7 && 0%{?amazon_linux} != 2 Suggests: %{name}-plugin-freeipmi = %{version} %endif %if 0%{?centos_ver} != 7 && 0%{?amazon_linux} != 2 +%if %{_have_cups} Suggests: %{name}-plugin-cups = %{version} +%endif Recommends: %{name}-plugin-systemd-journal = %{version} +Recommends: %{name}-plugin-network-viewer = %{version} Recommends: %{name}-plugin-logs-management = %{version} %else Requires: %{name}-plugin-systemd-journal = %{version} +Requires: %{name}-plugin-network-viewer = %{version} %endif @@ -186,52 +226,75 @@ Requires: %{name}-plugin-systemd-journal = %{version} # rather than the standard ones # epbf plugin dependencies -%if 0%{?_have_ebpf} -%if 0%{?suse_version} -BuildRequires: libelf-devel -%else -BuildRequires: elfutils-libelf-devel -%endif +%if %{_have_ebpf} +BuildRequires: pkgconfig(libelf) %endif # end ebpf plugin dependencies # nfacct plugin dependencies -%if 0%{?_have_nfacct} -BuildRequires: libmnl-devel -BuildRequires: libnetfilter_acct-devel +%if %{_have_nfacct} +BuildRequires: pkgconfig(libmnl) +BuildRequires: pkgconfig(libnetfilter_acct) %endif # end nfacct plugin dependencies # freeipmi plugin dependencies -%if 0%{?_have_freeipmi} -BuildRequires: freeipmi-devel +%if %{_have_freeipmi} +BuildRequires: pkgconfig(libipmimonitoring) %endif # end - freeipmi plugin dependencies # CUPS plugin dependencies -%if 0%{?centos_ver} != 6 && 0%{?centos_ver} != 7 -BuildRequires: cups-devel >= 1.7 +%if %{_have_cups} +BuildRequires: cups-devel %endif # end - cups plugin dependencies # go.d.plugin dependencies -%if 0%{?_golang_build} +# +# The conditional here is checking for a macro we define in our package +# builders. If it’s defined, then we’ve injected an upstream copy of +# the Go toolchain, so we don’t need the package installed (which +# is needed because Go’s development model is at odds with enterprise +# distro handling of versioning). +%if %{?_upstream_go_toolchain:0}%{!?_upstream_go_toolchain:1} %if 0%{?suse_version} -BuildRequires: go +BuildRequires: go >= 1.21 %else -BuildRequires: golang +BuildRequires: golang >= 1.21 %endif %endif # end - go.d.plugin plugin dependencies # systemd-journal dependencies -BuildRequires: systemd-devel +BuildRequires: pkgconfig(libsystemd) # end - systemd-journal dependencies # Prometheus remote write dependencies +%if 0%{?suse_version} +BuildRequires: snappy-devel +%else +%if 0%{?centos_ver} != 7 +BuildRequires: pkgconfig(snappy) +%else BuildRequires: snappy-devel +%endif +%endif # end - prometheus remote write dependencies +# Xenstat dependencies +%if %{_have_xenstat} +BuildRequires: pkgconfig(xenstat) +BuildRequires: pkgconfig(xenlight) +%endif +# end - xenstat dependencies + +# MongoDB exporter dependencies +%if %{_have_mongo_exporter} +BuildRequires: pkgconfig(libmongoc-1.0) +%endif +# end - mongodb expoerter dependencies + # logs-management dependencies BuildRequires: bison BuildRequires: flex @@ -252,12 +315,6 @@ happened, on your systems and applications. %prep %setup -q -n "%{name}-%{version}" -# Only bundle protobuf on CentOS 7 or earlier -%if 0%{?centos_ver:1} -%if %{centos_ver} < 8 -export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-protobuf.sh ${RPM_BUILD_DIR}/%{name}-%{version} -%endif -%endif %if 0%{?_have_ebpf} %if 0%{?centos_ver:1} %if %{centos_ver} < 8 @@ -273,62 +330,85 @@ export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging %endif %endif -# go.d.plugin -%if 0%{?_golang_build} -mkdir -p "%{_builddir}/%{go_name}" -tar -xzf "%{SOURCE1}" -C "%{_builddir}/%{go_name}" -tar -xzf "%{SOURCE2}" -C "%{_builddir}/%{go_name}" -cd "%{_builddir}/%{go_name}/%{go_name}-%{go_version}" -make download -%endif - %build # Conf step -autoreconf -ivf -%configure \ - %if 0%{!?_have_ebpf} - --disable-ebpf \ +%cmake -G Ninja \ + -DCMAKE_INSTALL_PREFIX=/ \ + %if 0%{?centos_ver:1} + %if %{centos_ver} < 8 + -DUSE_CXX_11=On \ + %endif + %endif + %if %{_have_cups} + -DENABLE_PLUGIN_CUPS=On \ + %else + -DENABLE_PLUGIN_CUPS=Off \ + %endif + %if %{_have_ebpf} + -DENABLE_PLUGIN_EBPF=On \ + %else + -DENABLE_PLUGIN_EBPF=Off \ %endif - %if 0%{!?_have_freeipmi} - --disable-plugin-freeipmi \ + %if %{_have_freeipmi} + -DENABLE_PLUGIN_FREEIPMI=On \ + %else + -DENABLE_PLUGIN_FREEIPMI=Off \ %endif - %if 0%{!?_have_nfacct} - --disable-plugin-nfacct \ + %if %{_have_nfacct} + -DENABLE_PLUGIN_NFACCT=On \ + %else + -DENABLE_PLUGIN_NFACCT=Off \ + %endif + %if %{_have_xenstat} + -DENABLE_PLUGIN_XENSTAT=On \ + %else + -DENABLE_PLUGIN_XENSTAT=Off \ %endif %if 0%{?centos_ver:1} %if %{centos_ver} < 8 - --with-bundled-protobuf \ + -DENABLE_BUNDLED_PROTOBUF=On \ + %else + -DENABLE_BUNDLED_PROTOBUF=Off \ + %endif + %else + -DENABLE_BUNDLED_PROTOBUF=Off \ %endif + %if %{_have_ml} + -DENABLE_ML=On \ + %else + -DENABLE_ML=Off \ %endif - %if 0%{?oraclelinux} - --disable-exporting-mongodb \ + %if %{_have_mongo_exporter} + -DENABLE_EXPORTER_MONGODB=On \ + %else + -DENABLE_EXPORTER_MONGODB=Off \ %endif - --prefix="%{_prefix}" \ - --sysconfdir="%{_sysconfdir}" \ - --localstatedir="%{_localstatedir}" \ - --libexecdir="%{_libexecdir}" \ - --libdir="%{_libdir}" \ - --with-zlib \ - --with-math \ - --with-user=%{name} \ - --disable-dependency-tracking + -DENABLE_ACLK=On \ + -DENABLE_CLOUD=On \ + -DENABLE_DBENGINE=On \ + -DENABLE_H2O=On \ + -DENABLE_PLUGIN_APPS=On \ + -DENABLE_PLUGIN_CGROUP_NETWORK=On \ + -DENABLE_PLUGIN_DEBUGFS=On \ + -DENABLE_PLUGIN_GO=On \ + -DENABLE_PLUGIN_LOCAL_LISTENERS=On \ + -DENABLE_PLUGIN_PERF=On \ + -DENABLE_PLUGIN_SLABINFO=On \ + -DENABLE_PLUGIN_SYSTEMD_JOURNAL=On \ + -DENABLE_PLUGIN_LOGS_MANAGEMENT=On \ + -DENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE=On \ + -DENABLE_BUNDLED_JSONC=Off \ + -DENABLE_BUNDLED_YAML=Off # Build step -%{__make} %{?_smp_mflags} - -# Build go.d.plugin -%if 0%{?_golang_build} -cd "%{_builddir}/%{go_name}/%{go_name}-%{go_version}" -sed -i 's|CGO_ENABLED=0 ||' "hack/go-build.sh" -TRAVIS_TAG="%{go_version}" %{__make} build -%endif +%{cmake_build} %install # ########################################################### # Clear the directory, if already exists and install rm -rf "${RPM_BUILD_ROOT}" -%{__make} %{?_smp_mflags} DESTDIR="${RPM_BUILD_ROOT}" install +%{cmake_install} install -m 644 -p "system/%{name}.conf" "${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}" @@ -339,49 +419,7 @@ install -m 755 -p packaging/installer/%{name}-updater.sh "${RPM_BUILD_ROOT}%{_li # ########################################################### # logrotate settings install -m 755 -d "${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d" -install -m 644 -p "system/logrotate/%{name}" "${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name}" - -# ########################################################### -# Install freeipmi -%if 0%{?_have_freeipmi} -install -m 4750 -p freeipmi.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/freeipmi.plugin" -%endif - -# ########################################################### -# Install apps.plugin -install -m 4750 -p apps.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/apps.plugin" - -# ########################################################### -# Install debugfs.plugin -install -m 0750 -p debugfs.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/debugfs.plugin" - -# ########################################################### -# Install systemd-journal.plugin -install -m 4750 -p systemd-journal.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/systemd-journal.plugin" - -# ########################################################### -# Install logs-management.plugin -#install -m 4750 -p logs-management.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/logs-management.plugin" - -# ########################################################### -# Install perf.plugin -install -m 4750 -p perf.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/perf.plugin" - -# ########################################################### -# Install ebpf.plugin -%if 0%{?_have_ebpf} -install -m 4750 -p ebpf.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/ebpf.plugin" -%endif - -# ########################################################### -# Install cups.plugin -%if 0%{?centos_ver} != 6 && 0%{?centos_ver} != 7 -install -m 0750 -p cups.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/cups.plugin" -%endif - -# ########################################################### -# Install slabinfo.plugin -install -m 4750 -p slabinfo.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/slabinfo.plugin" +install -m 644 -p "%{__cmake_builddir}/system/logrotate/%{name}" "${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name}" # ########################################################### # Install cache and log directories @@ -402,118 +440,13 @@ install -m 750 -p packaging/installer/%{name}-uninstaller.sh \ install -m 755 -d "${RPM_BUILD_ROOT}%{_unitdir}" %if 0%{?centos_ver} != 7 && 0%{?amazon_linux} != 2 -install -m 644 -p "system/systemd/%{name}.service" "${RPM_BUILD_ROOT}%{_unitdir}/%{name}.service" +install -m 644 -p "%{__cmake_builddir}/system/systemd/%{name}.service" "${RPM_BUILD_ROOT}%{_unitdir}/%{name}.service" %else -install -m 644 -p "system/systemd/%{name}.service.v235" "${RPM_BUILD_ROOT}%{_unitdir}/%{name}.service" +install -m 644 -p "%{__cmake_builddir}/system/systemd/%{name}.service.v235" "${RPM_BUILD_ROOT}%{_unitdir}/%{name}.service" %endif install -m 755 -d "${RPM_BUILD_ROOT}%{_presetdir}" install -m 644 -p "system/systemd/50-%{name}.preset" "${RPM_BUILD_ROOT}%{_presetdir}/50-%{name}.preset" -# ############################################################ -# Package Go within netdata - -# Install builded go.d.plugin -%if 0%{?_golang_build} -install -m 0640 "%{_builddir}/%{go_name}/%{go_name}-%{go_version}/bin/godplugin" \ -"${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/%{go_name}" -cp -r "%{_builddir}/%{go_name}/go.d.conf" "%{_builddir}/%{go_name}/go.d" \ -"${RPM_BUILD_ROOT}%{_libdir}/%{name}/conf.d/" -%else -# Install binary go.d.plugin -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 - GO_PACKAGE_VERSION="$(cat packaging/go.d.version)" - 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 - ARCH="%{_arch}" - OS=$(uname -s | tr '[:upper:]' '[:lower:]') - - echo >&2 "Install go.d.plugin (ARCH=${ARCH}, OS=${OS})" - - 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}" - 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 - 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}\$" "packaging/go.d.checksums" > "${tmp}/sha256sums.txt" 2>/dev/null - grep "config.tar.gz" "packaging/go.d.checksums" >> "${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 "${RPM_BUILD_ROOT}%{_libdir}/%{name}/conf.d/" - tar xf "${tmp}/${GO_PACKAGE_BASENAME}" - mv "${GO_PACKAGE_BASENAME/\.tar\.gz/}" "go.d.plugin" - rm -rf "${tmp}" - fi - return 0 -} -install_go -install -m 0640 -p "%{go_name}" "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/%{go_name}" -%endif - %if 0%{?_have_ebpf} ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-ebpf.sh ${RPM_BUILD_DIR}/%{name}-%{version} \ ${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d @@ -615,6 +548,12 @@ rm -rf "${RPM_BUILD_ROOT}" # local-listeners detects the local processes that are listening for connections %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/local-listeners +# network-viewer.plugin, detects all system sockets and classifies them +%attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/network-viewer.plugin + +# ndsudo a helper to run privileged commands +%attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/ndsudo + # Enforce 0644 for files and 0755 for directories # for the netdata web directory %defattr(0644,root,root,0755) @@ -627,14 +566,15 @@ rm -rf "${RPM_BUILD_ROOT}" %attr(0755,netdata,root) %dir %{_localstatedir}/log/%{name} %attr(0770,netdata,netdata) %dir %{_localstatedir}/lib/%{name} %attr(0770,netdata,netdata) %dir %{_localstatedir}/lib/%{name}/registry +%attr(0770,netdata,netdata) %dir %{_localstatedir}/lib/%{name}/cloud.d # Free IPMI belongs to a different sub-package -%if 0%{?_have_freeipmi} +%if %{_have_freeipmi} %exclude %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin %endif # NFACCT belongs to a different sub-package -%if 0%{?_have_nfacct} +%if %{_have_nfacct} %exclude %{_libexecdir}/%{name}/plugins.d/nfacct.plugin %endif @@ -646,7 +586,7 @@ rm -rf "${RPM_BUILD_ROOT}" %exclude %{_libdir}/%{name}/conf.d/charts.d/ # eBPF belongs to a different sub-package -%if 0%{?_have_ebpf} +%if %{_have_ebpf} %exclude %{_libexecdir}/%{name}/plugins.d/ebpf.plugin %exclude %{_libdir}/%{name}/conf.d/ebpf.d.conf %exclude %{_libdir}/%{name}/conf.d/ebpf.d @@ -660,7 +600,7 @@ rm -rf "${RPM_BUILD_ROOT}" %exclude %{_libdir}/%{name}/conf.d/python.d # Go.d belongs to a different sub-package -%exclude %{_libexecdir}/%{name}/plugins.d/%{go_name} +%exclude %{_libexecdir}/%{name}/plugins.d/go.d.plugin %exclude %{_libdir}/%{name}/conf.d/go.d.conf %exclude %{_libdir}/%{name}/conf.d/go.d @@ -677,19 +617,24 @@ rm -rf "${RPM_BUILD_ROOT}" # systemd-journal belongs to a different sub-package %exclude %{_libexecdir}/%{name}/plugins.d/systemd-journal.plugin +# xenstat belongs to a different sub-package +%exclude %{_libexecdir}/%{name}/plugins.d/xenstat.plugin + # logs management belongs to a different sub-package %exclude %{_libexecdir}/%{name}/plugins.d/logs-management.plugin %exclude %{_libdir}/%{name}/conf.d/logsmanagement.d.conf %exclude %{_libdir}/%{name}/conf.d/logsmanagement.d +# Network viewer belongs to a different sub-package +%exclude %{_libexecdir}/%{name}/plugins.d/network-viewer.plugin + # CUPS belongs to a different sub package -%if 0%{?centos_ver} != 6 && 0%{?centos_ver} != 7 +%if %{_have_cups} %exclude %{_libexecdir}/%{name}/plugins.d/cups.plugin %package plugin-cups Summary: The CUPS metrics collection plugin for the Netdata Agent Group: Applications/System -Requires: cups >= 1.7 Requires: %{name} = %{version} %description plugin-cups @@ -725,7 +670,7 @@ fi %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin %endif -%if 0%{?_have_nfacct} +%if %{_have_nfacct} %package plugin-nfacct Summary: The NFACCT metrics collection plugin for the Netdata Agent Group: Applications/System @@ -752,7 +697,6 @@ Requires: bash Requires: %{name} = %{version} Conflicts: %{name} < %{version} %if 0%{?centos_ver} != 7 -Suggests: nut Suggests: apcupsd Suggests: iw Suggests: sudo @@ -760,7 +704,7 @@ Suggests: sudo %description plugin-chartsd This plugin adds a selection of additional collectors written in shell script to the Netdata Agent. -It includes collectors for NUT, APCUPSD, LibreSWAN, OpenSIPS, and Wireless access point statistics. +It includes collectors for APCUPSD, LibreSWAN, OpenSIPS, and Wireless access point statistics. %pre plugin-chartsd @@ -887,7 +831,7 @@ fi %defattr(0750,root,netdata,0750) # CAP_NET_ADMIN needed for WireGuard collector # CAP_NET_RAW needed for ping collector -%caps(cap_net_admin,cap_net_raw=eip) %{_libexecdir}/%{name}/plugins.d/%{go_name} +%caps(cap_dac_read_search,cap_net_admin,cap_net_raw=eip) %{_libexecdir}/%{name}/plugins.d/go.d.plugin %defattr(0644,root,netdata,0755) %{_libdir}/%{name}/conf.d/go.d.conf %{_libdir}/%{name}/conf.d/go.d @@ -1000,6 +944,27 @@ fi # CAP_DAC_READ_SEARCH required for data collection. %caps(cap_dac_read_search=ep) %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/systemd-journal.plugin +%if %{_have_xenstat} +%package plugin-xenstat +Summary: The xenstat plugin for the Netdata Agent +Group: Applications/System +Requires: %{name} = %{version} +Conflicts: %{name} < %{version} + +%description plugin-xenstat + This plugin allows Netdata to collect metrics from the Xen Hypervisor. + +%pre plugin-xenstat +if ! getent group %{name} > /dev/null; then + groupadd --system %{name} +fi + +%files plugin-xenstat +%defattr(0750,root,netdata,0750) +# SUID needed for data collection +%attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/xenstat.plugin +%endif + %package plugin-logs-management Summary: The logs-management plugin for the Netdata Agent Group: Applications/System @@ -1011,7 +976,6 @@ Conflicts: %{name} < %{version} and parse them to extract metrics. %pre plugin-logs-management - if ! getent group %{name} > /dev/null; then groupadd --system %{name} fi @@ -1024,9 +988,40 @@ fi # CAP_DAC_READ_SEARCH and CAP_SYSLOG needed for data collection. %caps(cap_dac_read_search,cap_syslog=ep) %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/logs-management.plugin +%package plugin-network-viewer +Summary: The network viewer plugin for the Netdata Agent +Group: Applications/System +Requires: %{name} = %{version} +Conflicts: %{name} < %{version} +%if 0%{?_have_ebpf} +%if 0%{?centos_ver} != 7 +Recommends: %{name}-plugin-ebpf = %{version} +%else +Requires: %{name}-plugin-ebpf = %{version} +%endif +%endif + +%description plugin-network-viewer + This plugin allows the Netdata Agent to provide network connection + mapping functionality for use in netdata Cloud. + +%pre plugin-network-viewer +if ! getent group %{name} > /dev/null; then + groupadd --system %{name} +fi + +%files plugin-network-viewer +%defattr(0750,root,netdata,0750) +# CAP_SYS_ADMIN, CAP_SYS_PTRACE and CAP_DAC_READ_SEARCH needed for data collection. +%caps(cap_sys_admin,cap_sys_ptrace,cap_dac_read_search=ep) %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/network-viewer.plugin + %changelog +* Tue Feb 06 2024 Austin Hemmelgarn 0.0.0-25 +- Add package for network-viewer plugin * Thu Oct 26 2023 Austin Hemmelgarn 0.0.0-24 - Add package for logs-management plugin +* Tue Sep 19 2023 Austin hemmelgarn 0.0.0-24 +- Switch to using cmake for builds. * Mon Aug 28 2023 Konstantin Shalygin 0.0.0-23 - Build go.d.plugin natively for CentOS Stream distro * Mon Aug 21 2023 Austin Hemmelgarn 0.0.0-22 -- cgit v1.2.3