@cryptotaxi247 / netdata-1 / commits / 1aef5a70d

Split plugins to individual packages for DEB/RPM packaging. (#13927)

* Update and normalize plugin package descriptions. This ensures they have accurate and cnocise descriptions of what they do, and that the descriptions are the same for both the RPM and DEB packages. * Split NFACCT plugin to it’s own package. Most users do not actually use it, so make life easier for them by reducing our dependency footprint and cutting down on how much they need to download. * Split charts.d.plugin to it’s own package. * Split eBPF plugin and code to their own packages. The code is in a separate package to simplify handling updates for it separately from the main agent code in the future. The eBPF plugin will still be installed by default in most cases when installing the Netdata Agent * Split python.d plugin to it’s own package. The python.d plugin will still be installed by default in most cases when installing the Netdata Agent * Split go.d plugin to it’s own package. The go.d plugin will still be installed by default in most cases when installing the Netdata Agent * Split apps.plugin to it’s own package The apps plugin will still be installed by default in most cases when installing the Netdata Agent * Properly split out postinst scripts for DEB packages. We should be modifying permissions and filecaps for plugins in the specific packages that install those plugins. * Clean up main files section in RPM spec file. This should get rid of the duplicate files warnings, as well as probably producing a more technically correct RPM. * Properly format DEB package descriptions. They should be folded at 76 characters. * Fix dependencies for split RPM plugin packages. * Fix most duplicate file warnings for RPM builds. * Split slabinfo plugin to it’s own package. * Clean up RPM conditional build. All platforms we build RPMs for have both netns and systemd support, so quit supporting platforms that don’t in our spec file. * Include loopsleepms.sh.inc in RPM package. * Fix packaging of nfacct plugin. * Skip building NFACCT plugin on RHEL clones. They lack the required dependencies. * Split perf.plugin to it’s own package. Also, start using CAP_PERFMON for it in RPM packages when available. * Fix typo in DEB postinstall scripts. * Fix issues with ebpf bundling scripts. They don’t need to preserve permissions, and choosing not to do so makes them work more reliably in a number of cases. * Improve dependency handling of secondary plugins. * Fix dependency handling. * Match ebpf code files more specifically in RPM spec file. * Fix branding and dependencies for RPM packages. - Change the eBPF plugin legacy code package name and description to reflect what it actually is. - Properly have the new plugin packages conflict with the older Netdata packages. This is needed for updates to work cleanly. - Only require the eBPF legacy code on older systems that need it. * Fix branding and dependencies for DEB packages. - Change the eBPF plugin legacy code package name and description to reflect what it actually is. - Properly have the new plugin packages conflict with the older Netdata packages. This is needed for updates to work cleanly. * Update docs for non-default plugins. * Have docs link back to package document. * Address review feedback. * Explicitly suggest plugins we are not including by default. This does not pull them in by default, but does make it easier for users to discover them. * Explicitly pull in default plugins on CentOS 7. * Fix broken merge of netdata spec file. * Resolve typo in kickstart script. * Explicitly disable FreeIPMI and NFACCT in RPMs if they are not available. * Fix RPM changelog. * Fix conditional plugin handling. * Fix disabling FreeIPMI on Amazon Linux. * Split new debugfs plugin to separate package. * Install debugfs plugin by default.

Austin S. Hemmelgarn committed May 30, 2023 at 08:38 UTC 1aef5a70d8ba6df58ae29cd320fb0f7c0eeca6f0
25 files changed +690 -118
collectors/charts.d.plugin/README.md
+2
@@ -17,6 +17,8 @@ memory, collecting data with as little overheads as possible
17 `charts.d.plugin` looks for scripts in `/usr/lib/netdata/charts.d`.
18 The scripts should have the filename suffix: `.chart.sh`.
19
20 +By default, `charts.d.plugin` is not included as part of the install when using [our official native DEB/RPM packages](https://github.com/netdata/netdata/blob/master/packaging/installer/methods/packages.md). You can install it by installing the `netdata-plugin-chartsd` package.
21 +
22 ## Configuration
23
24 `charts.d.plugin` itself can be [configured](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md#use-edit-config-to-edit-configuration-files) using the configuration file `/etc/netdata/charts.d.conf`. This file is also a BASH script.
collectors/charts.d.plugin/ap/README.md
+2
@@ -85,6 +85,8 @@ Station 40:b8:37:5a:ed:5e (on wlan0)
85
86 ## Configuration
87
88 +If using [our official native DEB/RPM packages](https://github.com/netdata/netdata/blob/master/packaging/installer/methods/packages.md), make sure `netdata-plugin-chartsd` is installed.
89 +
90 Edit the `charts.d/ap.conf` configuration file using `edit-config` from the Netdata [config
91 directory](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md), which is typically at `/etc/netdata`.
92
collectors/charts.d.plugin/apcupsd/README.md
+2
@@ -13,6 +13,8 @@ Monitors different APC UPS models and retrieves status information using `apcacc
13
14 ## Configuration
15
16 +If using [our official native DEB/RPM packages](https://github.com/netdata/netdata/blob/master/packaging/installer/methods/packages.md), make sure `netdata-plugin-chartsd` is installed.
17 +
18 Edit the `charts.d/apcupsd.conf` configuration file using `edit-config` from the Netdata [config
19 directory](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md), which is typically at `/etc/netdata`.
20
collectors/charts.d.plugin/libreswan/README.md
+2
@@ -24,6 +24,8 @@ The following charts are created, **per tunnel**:
24
25 ## Configuration
26
27 +If using [our official native DEB/RPM packages](https://github.com/netdata/netdata/blob/master/packaging/installer/methods/packages.md), make sure `netdata-plugin-chartsd` is installed.
28 +
29 Edit the `charts.d/libreswan.conf` configuration file using `edit-config` from the Netdata [config
30 directory](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md), which is typically at `/etc/netdata`.
31
collectors/charts.d.plugin/nut/README.md
+2
@@ -53,6 +53,8 @@ The following charts will be created:
53
54 ## Configuration
55
56 +If using [our official native DEB/RPM packages](https://github.com/netdata/netdata/blob/master/packaging/installer/methods/packages.md), make sure `netdata-plugin-chartsd` is installed.
57 +
58 Edit the `charts.d/nut.conf` configuration file using `edit-config` from the Netdata [config
59 directory](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md), which is typically at `/etc/netdata`.
60
collectors/charts.d.plugin/opensips/README.md
+2
@@ -11,6 +11,8 @@ learn_rel_path: "Integrations/Monitor/Networking"
11
12 ## Configuration
13
14 +If using [our official native DEB/RPM packages](https://github.com/netdata/netdata/blob/master/packaging/installer/methods/packages.md), make sure `netdata-plugin-chartsd` is installed.
15 +
16 Edit the `charts.d/opensips.conf` configuration file using `edit-config` from the Netdata [config
17 directory](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md), which is typically at `/etc/netdata`.
18
collectors/charts.d.plugin/sensors/README.md
+4 -2
@@ -21,13 +21,15 @@ One chart for every sensor chip found and each of the above will be created.
21
22 ## Enable the collector
23
24 +If using [our official native DEB/RPM packages](https://github.com/netdata/netdata/blob/master/packaging/installer/methods/packages.md), make sure `netdata-plugin-chartsd` is installed.
25 +
26 The `sensors` collector is disabled by default.
27
26 -To enable the collector, you need to edit the configuration file of `charts.d/sensors.conf`. You can do so by using the `edit config` script.
28 +To enable the collector, you need to edit the configuration file of `charts.d/sensors.conf`. You can do so by using the `edit config` script.
29
30 > ### Info
31 >
30 -> To edit configuration files in a safe way, we provide the [`edit config` script](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md#use-edit-config-to-edit-configuration-files) located in your [Netdata config directory](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md#the-netdata-config-directory) (typically is `/etc/netdata`) that creates the proper file and opens it in an editor automatically.
32 +> To edit configuration files in a safe way, we provide the [`edit config` script](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md#use-edit-config-to-edit-configuration-files) located in your [Netdata config directory](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md#the-netdata-config-directory) (typically is `/etc/netdata`) that creates the proper file and opens it in an editor automatically.
33 > It is recommended to use this way for configuring Netdata.
34 >
35 > Please also note that after most configuration changes you will need to [restart the Agent](https://github.com/netdata/netdata/blob/master/docs/configure/start-stop-restart.md) for the changes to take effect.
collectors/nfacct.plugin/README.md
+5
@@ -13,6 +13,11 @@ learn_rel_path: "Integrations/Monitor/Networking"
13
14 ## Prerequisites
15
16 +If you are using [our official native DEB/RPM packages](https://github.com/netdata/netdata/blob/master/packaging/installer/methods/packages.md), install the
17 +`netdata-plugin-nfacct` package using your system package manager.
18 +
19 +If you built Netdata locally:
20 +
21 1. install `libmnl-dev` and `libnetfilter-acct-dev` using the package manager of your system.
22
23 2. re-install Netdata from source. The installer will detect that the required libraries are now available and will also build `netdata.plugin`.
collectors/perf.plugin/README.md
+3
@@ -14,6 +14,9 @@ the `perf_event_open()` system call.
14
15 ## Important Notes
16
17 +If you are using [our official native DEB/RPM packages](https://github.com/netdata/netdata/blob/master/packaging/installer/methods/packages.md), you will need to install
18 +the `netdata-plugin-perf` package using your system package manager.
19 +
20 Accessing hardware PMUs requires root permissions, so the plugin is setuid to root.
21
22 Keep in mind that the number of PMUs in a system is usually quite limited and every hardware monitoring
collectors/slabinfo.plugin/README.md
+3
@@ -18,6 +18,9 @@ Each internal structure (process, file descriptor, inode...) is stored within a
18 The plugin is disabled by default because it collects and displays a huge amount of metrics.
19 To enable it set `slabinfo = yes` in the `plugins` section of the `netdata.conf` configuration file.
20
21 +If you are using [our official native DEB/RPM packages](https://github.com/netdata/netdata/blob/master/packaging/installer/methods/packages.md), you will additionally need to install the `netdata-plugin-slabinfo`
22 +package using your system package manager.
23 +
24 There is currently no configuration needed for the plugin itself.
25
26 As `/proc/slabinfo` is only readable by root, this plugin is setuid root.
contrib/debian/control
+123 -6
@@ -42,6 +42,17 @@ Conflicts: netdata-core,
42 netdata-plugins-bash,
43 netdata-plugins-python,
44 netdata-web
45 +Recommends: netdata-plugin-ebpf,
46 + netdata-plugin-apps,
47 + netdata-plugin-pythond,
48 + netdata-plugin-go,
49 + netdata-plugin-debugfs
50 +Suggests: netdata-plugin-cups,
51 + netdata-plugin-freeipmi,
52 + netdata-plugin-nfacct,
53 + netdata-plugin-chartsd,
54 + netdata-plugin-slabinfo,
55 + netdata-plugin-perf
56 Pre-Depends: dpkg (>= 1.17.14)
57 Description: real-time charts for system monitoring
58 Netdata is a daemon that collects data in realtime (per second)
@@ -54,14 +65,120 @@ Architecture: any
65 Depends: cups,
66 ${shlibs:Depends},
67 netdata (>= ${source:Version})
57 -Description: The Common Unix Printing System plugin for metrics collection from cupsd
68 +Description: The CUPS metrics collection plugin for the Netdata Agent
69 + This plugin allows the Netdata Agent to collect metrics from the Common
70 + UNIX Printing System.
71
72 Package: netdata-plugin-freeipmi
73 Architecture: any
74 Depends: freeipmi,
75 ${shlibs:Depends},
63 - netdata (= ${source:Version})
64 -Description: FreeIPMI - The Intelligent Platform Management System.
65 - The IPMI specification defines a set of interfaces for platform management.
66 - It is implemented by a number vendors for system management. The features of IPMI that most users will be interested in
67 - are sensor monitoring, system event monitoring, power control, and serial-over-LAN (SOL).
76 + netdata (>= ${source:Version})
77 +Description: The FreeIPMI metrics collection plugin for the Netdata Agent
78 + This plugin allows the Netdata Agent to collect metrics from hardware
79 + using FreeIPMI.
80 +
81 +Package: netdata-plugin-nfacct
82 +Architecture: any
83 +Depends: ${shlibs:Depends},
84 + netdata (>= ${source:Version})
85 +Conflicts: netdata (< ${source:Version})
86 +Description: The NFACCT metrics collection plugin for the Netdata Agent
87 + This plugin allows the Netdata Agent to collect metrics from the firewall
88 + using NFACCT objects.
89 +
90 +Package: netdata-plugin-chartsd
91 +Architecture: all
92 +Depends: bash,
93 + netdata (>= ${source:Version})
94 +Conflicts: netdata (< ${source:Version})
95 +Suggests: apcupsd, nut, iw, sudo
96 +Description: The charts.d metrics collection plugin for the Netdata Agent
97 + This plugin adds a selection of additional collectors written in shell
98 + script to the Netdata Agent. It includes collectors for NUT, APCUPSD,
99 + LibreSWAN, OpenSIPS, and Wireless access point statistics.
100 +
101 +Package: netdata-plugin-ebpf
102 +Architecture: any
103 +Depends: ${shlibs:Depends},
104 + netdata (>= ${source:Version})
105 +Recommends: netdata-ebpf-code-legacy (>= ${source:Version}),
106 + netdata-plugin-apps (>= ${source:Version})
107 +Conflicts: netdata (< ${source:Version})
108 +Description: The eBPF metrics collection plugin for the Netdata Agent
109 + This plugin allows the Netdata Agent to use eBPF code to collect more
110 + detailed kernel-level metrics for the system.
111 +
112 +Package: netdata-ebpf-code-legacy
113 +Architecture: i386 amd64
114 +Depends: netdata-plugin-ebpf (= ${source:Version})
115 +Conflicts: netdata (< ${source:Version})
116 +Description: Compiled eBPF legacy code for the Netdata eBPF plugin
117 + This package provides the pre-compiled eBPF legacy code for use by
118 + the Netdata eBPF plugin. This code is only needed when using the eBPF
119 + plugin with kernel that do not include BTF support (mostly kernel
120 + versions lower than 5.10)..
121 +
122 +Package: netdata-plugin-pythond
123 +Architecture: all
124 +Depends: ${shlibs:Depends},
125 + netdata (>= ${source:Version})
126 +Suggests: sudo
127 +Conflicts: netdata (< ${source:Version})
128 +Description: The python.d metrics collection plugin for the Netdata Agent
129 + Many of the collectors provided by this package are also available
130 + in netdata-plugin-god. In msot cases, you probably want to use those
131 + versions instead of the Python versions.
132 +
133 +Package: netdata-plugin-go
134 +Architecture: any
135 +Depends: ${shlibs:Depends},
136 + libcap2-bin,
137 + netdata (>= ${source:Version})
138 +Suggests: nvme-cli, sudo
139 +Conflicts: netdata (< ${source:Version})
140 +Description: The go.d metrics collection plugin for the Netdata Agent
141 + This plugin adds a selection of additional collectors written in Go to
142 + the Netdata Agent. A significant percentage of the application specific
143 + collectors provided by Netdata are part of this plugin, so most users
144 + will want it installed.
145 +
146 +Package: netdata-plugin-apps
147 +Architecture: any
148 +Depends: ${shlibs:Depends},
149 + libcap2-bin,
150 + netdata (>= ${source:Version})
151 +Conflicts: netdata (< ${source:Version})
152 +Description: The per-application metrics collection plugin for the Netdata Agent
153 + This plugin allows the Netdata Agent to collect per-application and
154 + per-user metrics without using cgroups.
155 +
156 +Package: netdata-plugin-slabinfo
157 +Architecture: any
158 +Depends: ${shlibs:Depends},
159 + libcap2-bin,
160 + netdata (>= ${source:Version})
161 +Conflicts: netdata (< ${source:Version})
162 +Description: The slabinfo metrics collector for the Netdata Agent
163 + This plugin allows the Netdata Agent to collect perfromance and
164 + utilization metrics for the Linux kernel’s SLAB allocator.
165 +
166 +Package: netdata-plugin-perf
167 +Architecture: any
168 +Depends: ${shlibs:Depends},
169 + libcap2-bin,
170 + netdata (>= ${source:Version})
171 +Conflicts: netdata (< ${source:Version})
172 +Description: The perf metrics collector for the Netdata Agent
173 + This plugin allows the Netdata to collect metrics from the Linux perf
174 + subsystem.
175 +
176 +Package: netdata-plugin-debugfs
177 +Architecture: any
178 +Depends: ${shlibs:Debends},
179 + libcap2-bin,
180 + netdata (>= ${source:Version})
181 +Conflicts: netdata (< ${source:Version})
182 +Description: The debugfs metrics collector for the Netdata Agent
183 + This plugin allows the Netdata Agent to collect Linux kernel metrics
184 + exposed through debugfs.
contrib/debian/netdata-plugin-apps.postinst new
+13
@@ -0,0 +1,13 @@
1 +#!/bin/sh
2 +
3 +set -e
4 +
5 +case "$1" in
6 + configure|reconfigure)
7 + setcap "cap_dac_read_search=eip cap_sys_ptrace=eip" /usr/libexec/netdata/plugins.d/apps.plugin
8 + ;;
9 +esac
10 +
11 +#DEBHELPER#
12 +
13 +exit 0
contrib/debian/netdata-plugin-debugfs.postinst new
+13
@@ -0,0 +1,13 @@
1 +#!/bin/sh
2 +
3 +set -e
4 +
5 +case "$1" in
6 + configure|reconfigure)
7 + setcap "cap_dac_read_search=eip" /usr/libexec/netdata/plugins.d/debugfs.plugin
8 + ;;
9 +esac
10 +
11 +#DEBHELPER#
12 +
13 +exit 0
contrib/debian/netdata-plugin-ebpf.postinst new
+13
@@ -0,0 +1,13 @@
1 +#!/bin/sh
2 +
3 +set -e
4 +
5 +case "$1" in
6 + configure|reconfigure)
7 + chmod -f 4750 /usr/libexec/netdata/plugins.d/ebpf.plugin
8 + ;;
9 +esac
10 +
11 +#DEBHELPER#
12 +
13 +exit 0
contrib/debian/netdata-plugin-freeipmi.postinst new
+13
@@ -0,0 +1,13 @@
1 +#!/bin/sh
2 +
3 +set -e
4 +
5 +case "$1" in
6 + configure|reconfigure)
7 + chmod -f 4750 /usr/libexec/netdata/plugins.d/freeipmi.plugin
8 + ;;
9 +esac
10 +
11 +#DEBHELPER#
12 +
13 +exit 0
contrib/debian/netdata-plugin-go.postinst new
+13
@@ -0,0 +1,13 @@
1 +#!/bin/sh
2 +
3 +set -e
4 +
5 +case "$1" in
6 + configure|reconfigure)
7 + setcap "cap_net_admin=eip cap_net_raw=eip" /usr/libexec/netdata/plugins.d/go.d.plugin
8 + ;;
9 +esac
10 +
11 +#DEBHELPER#
12 +
13 +exit 0
contrib/debian/netdata-plugin-nfacct.postinst new
+13
@@ -0,0 +1,13 @@
1 +#!/bin/sh
2 +
3 +set -e
4 +
5 +case "$1" in
6 + configure|reconfigure)
7 + chmod -f 4750 /usr/libexec/netdata/plugins.d/nfacct.plugin
8 + ;;
9 +esac
10 +
11 +#DEBHELPER#
12 +
13 +exit 0
contrib/debian/netdata-plugin-perf.postinst new
+17
@@ -0,0 +1,17 @@
1 +#!/bin/sh
2 +
3 +set -e
4 +
5 +case "$1" in
6 + configure|reconfigure)
7 + if capsh --supports=cap_perfmon 2>/dev/null; then
8 + setcap cap_perfmon+ep /usr/libexec/netdata/plugins.d/perf.plugin
9 + else
10 + setcap cap_sys_admin+ep /usr/libexec/netdata/plugins.d/perf.plugin
11 + fi
12 + ;;
13 +esac
14 +
15 +#DEBHELPER#
16 +
17 +exit 0
contrib/debian/netdata-plugin-slabinfo.postinst new
+13
@@ -0,0 +1,13 @@
1 +#!/bin/sh
2 +
3 +set -e
4 +
5 +case "$1" in
6 + configure|reconfigure)
7 + setcap "cap_dac_read_search=eip" /usr/libexec/netdata/plugins.d/apps.plugin
8 + ;;
9 +esac
10 +
11 +#DEBHELPER#
12 +
13 +exit 0
contrib/debian/netdata.postinst
-17
@@ -59,28 +59,11 @@ case "$1" in
59 dpkg-statoverride --force --update --add root netdata 0775 /var/lib/netdata/registry > /dev/null 2>&1
60
61 chown -R root:netdata /usr/libexec/netdata/plugins.d
62 - setcap cap_dac_read_search,cap_sys_ptrace+ep /usr/libexec/netdata/plugins.d/apps.plugin
63 - setcap cap_dac_read_search+ep /usr/libexec/netdata/plugins.d/slabinfo.plugin
62 setcap cap_dac_read_search+ep /usr/libexec/netdata/plugins.d/debugfs.plugin
63
66 - if capsh --supports=cap_perfmon 2>/dev/null; then
67 - setcap cap_perfmon+ep /usr/libexec/netdata/plugins.d/perf.plugin
68 - else
69 - setcap cap_sys_admin+ep /usr/libexec/netdata/plugins.d/perf.plugin
70 - fi
71 -
72 - if [ -f "/usr/libexec/netdata/plugins.d/go.d.plugin" ]; then
73 - setcap "cap_net_admin+epi cap_net_raw=eip" /usr/libexec/netdata/plugins.d/go.d.plugin
74 - fi
75 -
64 chmod 4750 /usr/libexec/netdata/plugins.d/cgroup-network
77 - chmod 4750 /usr/libexec/netdata/plugins.d/nfacct.plugin
78 -
79 - # Workaround if system does not have ebpf.plugin
80 - chmod -f 4750 /usr/libexec/netdata/plugins.d/ebpf.plugin || true
65
66 # Workaround for other plugins not installed directly by this package
83 - chmod -f 4750 /usr/libexec/netdata/plugins.d/freeipmi.plugin || true
67 chmod -f 4750 /usr/libexec/netdata/plugins.d/ioping || true
68
69 ;;
contrib/debian/rules
+87 -10
@@ -60,6 +60,67 @@ override_dh_install:
60 mv -f $(TEMPTOP)/usr/libexec/netdata/plugins.d/freeipmi.plugin \
61 $(TOP)-plugin-freeipmi/usr/libexec/netdata/plugins.d/freeipmi.plugin
62
63 + # Add free IPMI plugin install rules
64 + #
65 + mkdir -p $(TOP)-plugin-nfacct/usr/libexec/netdata/plugins.d
66 + mv -f $(TEMPTOP)/usr/libexec/netdata/plugins.d/nfacct.plugin \
67 + $(TOP)-plugin-nfacct/usr/libexec/netdata/plugins.d/nfacct.plugin
68 +
69 + # Add charts.d plugin install rules
70 + #
71 + mkdir -p $(TOP)-plugin-chartsd/usr/libexec/netdata/plugins.d/
72 + mkdir -p $(TOP)-plugin-chartsd/usr/lib/netdata/conf.d/
73 + mv -f $(TEMPTOP)/usr/libexec/netdata/plugins.d/charts.d.plugin \
74 + $(TOP)-plugin-chartsd/usr/libexec/netdata/plugins.d/charts.d.plugin
75 + mv -f $(TEMPTOP)/usr/libexec/netdata/plugins.d/charts.d.dryrun-helper.sh \
76 + $(TOP)-plugin-chartsd/usr/libexec/netdata/plugins.d/charts.d.dryrun-helper.sh
77 + mv -f $(TEMPTOP)/usr/libexec/netdata/charts.d \
78 + $(TOP)-plugin-chartsd/usr/libexec/netdata/charts.d
79 + mv -f $(TEMPTOP)/usr/lib/netdata/conf.d/charts.d.conf \
80 + $(TOP)-plugin-chartsd/usr/lib/netdata/conf.d/charts.d.conf
81 + mv -f $(TEMPTOP)/usr/lib/netdata/conf.d/charts.d \
82 + $(TOP)-plugin-chartsd/usr/lib/netdata/conf.d/charts.d
83 +
84 + # Add ebpf plugin install rules
85 + [ $(HAVE_EBPF) -eq 1 ] && mkdir -p $(TOP)-plugin-ebpf/usr/libexec/netdata/plugins.d/
86 + [ $(HAVE_EBPF) -eq 1 ] && mkdir -p $(TOP)-plugin-ebpf/usr/lib/netdata/conf.d/
87 + [ $(HAVE_EBPF) -eq 1 ] && mv -f $(TEMPTOP)/usr/libexec/netdata/plugins.d/ebpf.plugin \
88 + $(TOP)-plugin-ebpf/usr/libexec/netdata/plugins.d/ebpf.plugin
89 + [ $(HAVE_EBPF) -eq 1 ] && mv -f $(TEMPTOP)/usr/lib/netdata/conf.d/ebpf.d.conf \
90 + $(TOP)-plugin-ebpf/usr/lib/netdata/conf.d/ebpf.d.conf
91 + [ $(HAVE_EBPF) -eq 1 ] && mv -f $(TEMPTOP)/usr/lib/netdata/conf.d/ebpf.d \
92 + $(TOP)-plugin-ebpf/usr/lib/netdata/conf.d/ebpf.d
93 +
94 + # Add python plugin install rules
95 + mkdir -p $(TOP)-plugin-pythond/usr/libexec/netdata/plugins.d/
96 + mkdir -p $(TOP)-plugin-pythond/usr/lib/netdata/conf.d/
97 + mv -f $(TEMPTOP)/usr/libexec/netdata/plugins.d/python.d.plugin \
98 + $(TOP)-plugin-pythond/usr/libexec/netdata/plugins.d/python.d.plugin
99 + mv -f $(TEMPTOP)/usr/libexec/netdata/python.d \
100 + $(TOP)-plugin-pythond/usr/libexec/netdata/python.d
101 + mv -f $(TEMPTOP)/usr/lib/netdata/conf.d/python.d.conf \
102 + $(TOP)-plugin-pythond/usr/lib/netdata/conf.d/python.d.conf
103 + mv -f $(TEMPTOP)/usr/lib/netdata/conf.d/python.d \
104 + $(TOP)-plugin-pythond/usr/lib/netdata/conf.d/python.d
105 +
106 + # Add apps plugin install rules
107 + mkdir -p $(TOP)-plugin-apps/usr/libexec/netdata/plugins.d/
108 + mkdir -p $(TOP)-plugin-apps/usr/lib/netdata/conf.d/
109 + mv -f $(TEMPTOP)/usr/libexec/netdata/plugins.d/apps.plugin \
110 + $(TOP)-plugin-apps/usr/libexec/netdata/plugins.d/apps.plugin
111 + mv -f $(TEMPTOP)/usr/lib/netdata/conf.d/apps_groups.conf \
112 + $(TOP)-plugin-apps/usr/lib/netdata/conf.d/apps_groups.conf
113 +
114 + # Add slabinfo plugin install rules
115 + mkdir -p $(TOP)-plugin-slabinfo/usr/libexec/netdata/plugins.d/
116 + mv -f $(TEMPTOP)/usr/libexec/netdata/plugins.d/slabinfo.plugin \
117 + $(TOP)-plugin-slabinfo/usr/libexec/netdata/plugins.d/slabinfo.plugin
118 +
119 + # Add perf plugin install rules
120 + mkdir -p $(TOP)-plugin-perf/usr/libexec/netdata/plugins.d/
121 + mv -f $(TEMPTOP)/usr/libexec/netdata/plugins.d/perf.plugin \
122 + $(TOP)-plugin-perf/usr/libexec/netdata/plugins.d/perf.plugin
123 +
124 # Set the rest of the software in the main package
125 #
126 cp -rp $(TEMPTOP)/usr $(TOP)
@@ -82,13 +143,18 @@ override_dh_install:
143 ln -s "/usr/share/netdata/www/$$D" "$(TOP)/var/lib/netdata/www/$$D"; \
144 done
145
85 - if [ $(HAVE_EBPF) -eq 1 ]; then \
86 - packaging/bundle-ebpf.sh . ${TOP}/usr/libexec/netdata/plugins.d; \
87 - fi
146 + # Handle eBPF code
147 + #
148 + [ $(HAVE_EBPF) -eq 1 ] && mkdir -p $(TOP)-plugin-ebpf-code/usr/libexec/netdata/plugins.d/
149 + [ $(HAVE_EBPF) -eq 1 ] && packaging/bundle-ebpf.sh . ${TOP}-plugin-ebpf-code/usr/libexec/netdata/plugins.d/
150
89 - # Install go
151 + # Install go to it's own package directory
152 #
91 - debian/install_go.sh $$(cat ${CURDIR}/packaging/go.d.version) $(TOP)/usr/lib/netdata $(TOP)/usr/libexec/netdata
153 + mkdir -p $(TOP)-plugin-go/usr/lib/netdata/conf.d
154 + mkdir -p $(TOP)-plugin-go/usr/libexec/netdata/plugins.d
155 + debian/install_go.sh $$(cat ${CURDIR}/packaging/go.d.version) \
156 + $(TOP)-plugin-go/usr/lib/netdata \
157 + $(TOP)-plugin-go/usr/libexec/netdata
158
159 override_dh_installdocs:
160 dh_installdocs
@@ -109,14 +175,22 @@ override_dh_fixperms:
175 #
176 chmod 0755 $(TOP)/usr/libexec/netdata/netdata-updater.sh
177
178 + # debugfs plugin
179 + chmod 0750 $(TOP)/usr/libexec/netdata/plugins.d/debugfs.plugin
180 +
181 # apps.plugin should only be runnable by the netdata user. It will be
182 # given extra capabilities in the postinst script.
183 #
115 - chmod 0750 $(TOP)/usr/libexec/netdata/plugins.d/apps.plugin
116 - chmod 0750 $(TOP)/usr/libexec/netdata/plugins.d/debugfs.plugin
117 - chmod 0750 $(TOP)/usr/libexec/netdata/plugins.d/perf.plugin
118 - chmod 0750 $(TOP)/usr/libexec/netdata/plugins.d/slabinfo.plugin
119 - chmod 0750 $(TOP)/usr/libexec/netdata/plugins.d/go.d.plugin
184 + chmod 0750 $(TOP)-plugin-apps/usr/libexec/netdata/plugins.d/apps.plugin
185 +
186 + # slabinfo package
187 + chmod 0750 $(TOP)-plugin-slabinfo/usr/libexec/netdata/plugins.d/slabinfo.plugin
188 +
189 + # perf package
190 + chmod 0750 $(TOP)-plugin-perf/usr/libexec/netdata/plugins.d/perf.plugin
191 +
192 + # Go plugin package
193 + chmod 0750 $(TOP)-plugin-go/usr/libexec/netdata/plugins.d/go.d.plugin
194
195 # CUPS plugin package
196 chmod 0750 $(TOP)-plugin-cups/usr/libexec/netdata/plugins.d/cups.plugin
@@ -124,6 +198,9 @@ override_dh_fixperms:
198 # freeIPMI plugin package
199 chmod 4750 $(TOP)-plugin-freeipmi/usr/libexec/netdata/plugins.d/freeipmi.plugin
200
201 + # NFACCT plugin package
202 + chmod 4750 $(TOP)-plugin-nfacct/usr/libexec/netdata/plugins.d/nfacct.plugin
203 +
204 override_dh_installlogrotate:
205 cp system/logrotate/netdata debian/netdata.logrotate
206 dh_installlogrotate
netdata.spec.in
+329 -79
@@ -27,20 +27,6 @@ AutoReqProv: yes
27 %global _have_ebpf 0
28 %endif
29
30 -# Disable FreeIPMI on Amazon Linux
31 -%if 0%{?amzn}
32 -%global _have_freeipmi 0
33 -%else
34 -%global _have_freeipmi 1
35 -%endif
36 -
37 -# Disable the NFACCT plugin on Amazon Linux
38 -%if 0%{?amzn}
39 -%global _have_nfacct 0
40 -%else
41 -%global _have_nfacct 1
42 -%endif
43 -
30 # Mitigate the cross-distro mayhem by strictly defining the libexec destination
31 %define _prefix /usr
32 %define _sysconfdir /etc
@@ -54,13 +40,18 @@ AutoReqProv: yes
40 # Redefine centos_ver to standardize on a single macro
41 %{?rhel:%global centos_ver %rhel}
42
57 -#
58 -# Conditional build:
59 -%bcond_without netns # build with netns support (cgroup-network)
43 +# Disable FreeIPMI on Amazon Linux 2023 and newer
44 +%if 0%{?amzn} >= 2023
45 +%global _have_freeipmi 0
46 +%else
47 +%global _have_freeipmi 1
48 +%endif
49
61 -%if 0%{?fedora} || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1140
50 +# Disable NFACCT for RHEL equivalents and Amazon Linux
51 +%if 0%{?centos_ver} || 0%{?amzn}
52 +%global _have_nfacct 0
53 %else
63 -%undefine with_netns
54 +%global _have_nfacct 1
55 %endif
56
57 Summary: Real-time performance monitoring, done right!
@@ -150,33 +141,49 @@ Requires(pre): /usr/sbin/groupadd
141 Requires(pre): /usr/sbin/useradd
142
143 # #####################################################################
153 -# Functionality-dependent package dependencies
144 +# External plugin package dependencies
145 # #####################################################################
155 -# Note: Some or all of the Packages may be found in the EPEL repo,
156 -# rather than the standard ones
157 -
158 -# epbf dependencies
146 +# CentOS prior to CentOS 8 does not have a new enough version of RPM
147 +# to support weak dependencies. Explicitly requiring our default plugins
148 +# makes it impossible to properly test the packages prior to upload,
149 +# so we just skip depending on them on CentOS 7.
150 +%if 0%{?centos_ver} != 7
151 %if 0%{?_have_ebpf}
160 -%if 0%{?suse_version}
161 -BuildRequires: libelf-devel
162 -%else
163 -BuildRequires: elfutils-libelf-devel
152 +Recommends: netdata-plugin-ebpf
153 %endif
154 +Recommends: netdata-plugin-apps
155 +Recommends: netdata-plugin-pythond
156 +Recommends: netdata-plugin-go
157 +Recommends: netdata-plugin-debugfs
158 +%if 0%{?_have_freeipmi}
159 +Suggests: netdata-plugin-freeipmi
160 %endif
166 -# end - ebpf dependencies
161 +%if 0%{?_have_nfacct}
162 +Suggests: netdata-plugin-nfacct
163 +%endif
164 +Suggests: netdata-plugin-cups
165 +Suggests: netdata-plugin-chartsd
166 +Suggests: netdata-plugin-slabinfo
167 +Suggests: netdata-plugin-perf
168 +%endif
169 +
170 +# #####################################################################
171 +# Functionality-dependent package dependencies
172 +# #####################################################################
173 +# Note: Some or all of the Packages may be found in the EPEL repo,
174 +# rather than the standard ones
175
176 # nfacct plugin dependencies
169 -%if %{_have_nfacct}
177 +
178 +%if 0%{?_have_nfacct}
179 BuildRequires: libmnl-devel
171 -%if 0%{?fedora} || 0%{?suse_version} >= 1140
180 BuildRequires: libnetfilter_acct-devel
181 %endif
174 -%endif
182
183 # end nfacct plugin dependencies
184
185 # freeipmi plugin dependencies
179 -%if %{_have_freeipmi}
186 +%if 0%{?_have_freeipmi}
187 BuildRequires: freeipmi-devel
188 %endif
189 # end - freeipmi plugin dependencies
@@ -234,6 +241,12 @@ autoreconf -ivf
241 %if 0%{!?_have_ebpf}
242 --disable-ebpf
243 %endif
244 + %if 0%{!?_have_freeipmi}
245 + --disable-plugin-freeipmi
246 + %endif
247 + %if 0%{!?_have_nfacct}
248 + --disable-plugin-nfacct
249 + %endif
250 %if 0%{?centos_ver:1}
251 %if %{centos_ver} < 8
252 --with-bundled-protobuf \
@@ -272,7 +285,7 @@ install -m 644 -p system/logrotate/netdata "${RPM_BUILD_ROOT}%{_sysconfdir}/logr
285
286 # ###########################################################
287 # Install freeipmi
275 -%if %{_have_freeipmi}
288 +%if 0%{?_have_freeipmi}
289 install -m 4750 -p freeipmi.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/freeipmi.plugin"
290 %endif
291
@@ -313,6 +326,11 @@ install -m 755 -d "${RPM_BUILD_ROOT}%{_localstatedir}/log/%{name}"
326 # Install registry directory
327 install -m 755 -d "${RPM_BUILD_ROOT}%{_localstatedir}/lib/%{name}/registry"
328
329 +# ###########################################################
330 +# Install uninstaller script
331 +install -m 750 -p packaging/installer/netdata-uninstaller.sh \
332 + "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/netdata-uninstaller.sh"
333 +
334 # ###########################################################
335 # Install netdata service
336 install -m 755 -d "${RPM_BUILD_ROOT}%{_unitdir}"
@@ -461,14 +479,13 @@ rm -rf "${RPM_BUILD_ROOT}"
479
480 %files
481 %doc README.md
464 -%{_sysconfdir}/%{name}
482 %config(noreplace) %{_sysconfdir}/%{name}/netdata.conf
483 +%attr(0755,root,netdata) %{_sysconfdir}/%{name}/edit-config
484 +%attr(0644,root,netdata) %{_sysconfdir}/%{name}/.install-type
485 +%dir %{_sysconfdir}/%{name}/health.d
486 +%dir %{_sysconfdir}/%{name}/statsd.d
487 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
467 -%dir %{_libdir}/%{name}
468 -%dir %{_datadir}/%{name}
488 %{_libdir}/%{name}
470 -%{_libdir}/%{name}/conf.d/
471 -%{_libexecdir}/%{name}
489 %{_sbindir}/%{name}
490 %{_sbindir}/netdatacli
491 %{_sbindir}/netdata-claim.sh
@@ -476,43 +493,33 @@ rm -rf "${RPM_BUILD_ROOT}"
493 %{_unitdir}/netdata.service
494 %{_presetdir}/50-netdata.preset
495
479 -%defattr(0750,root,netdata,0750)
480 -
481 -%dir %{_libexecdir}/%{name}/python.d
482 -%dir %{_libexecdir}/%{name}/charts.d
496 +%dir %{_libexecdir}/%{name}
497 %dir %{_libexecdir}/%{name}/plugins.d
498 +%defattr(0750,root,netdata,0750)
499 +%{_libexecdir}/%{name}/install-service.sh
500 +%{_libexecdir}/%{name}/netdata-updater.sh
501 +%{_libexecdir}/%{name}/netdata-uninstaller.sh
502 +%{_libexecdir}/%{name}/plugins.d/acl.sh
503 +%{_libexecdir}/%{name}/plugins.d/alarm.sh
504 +%{_libexecdir}/%{name}/plugins.d/alarm-email.sh
505 +%{_libexecdir}/%{name}/plugins.d/alarm-notify.sh
506 +%{_libexecdir}/%{name}/plugins.d/alarm-test.sh
507 +%{_libexecdir}/%{name}/plugins.d/anonymous-statistics.sh
508 +%{_libexecdir}/%{name}/plugins.d/cgroup-name.sh
509 +%{_libexecdir}/%{name}/plugins.d/get-kubernetes-labels.sh
510 +%{_libexecdir}/%{name}/plugins.d/health-cmdapi-test.sh
511 +%{_libexecdir}/%{name}/plugins.d/ioping.plugin
512 +%{_libexecdir}/%{name}/plugins.d/loopsleepms.sh.inc
513 +%{_libexecdir}/%{name}/plugins.d/request.sh
514 +%{_libexecdir}/%{name}/plugins.d/system-info.sh
515 +%{_libexecdir}/%{name}/plugins.d/tc-qos-helper.sh
516 +%{_libexecdir}/%{name}/plugins.d/template_dim.sh
517
485 -%{_libexecdir}/%{name}/python.d
486 -%{_libexecdir}/%{name}/plugins.d
487 -
488 -%caps(cap_dac_read_search,cap_sys_ptrace=ep) %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/apps.plugin
489 -
490 -%if %{with netns}
518 # cgroup-network detects the network interfaces of CGROUPs
519 # it must be able to use setns() and run cgroup-network-helper.sh as root
520 # the helper script reads /proc/PID/fdinfo/* files, runs virsh, etc.
521 %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/cgroup-network
522 %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/cgroup-network-helper.sh
496 -%endif
497 -
498 -# ebpf plugin
499 -%if 0%{?_have_ebpf}
500 -%attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/ebpf.plugin
501 -%endif
502 -
503 -# perf plugin
504 -# This should be CAP_PERFMON once RPM finally learns about it, but needs to be CAP_SYS_ADMIN for now.
505 -# %caps(cap_perfmon=ep) %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/perf.plugin
506 -%caps(cap_sys_admin=ep) %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/perf.plugin
507 -
508 -# debugfs plugin
509 -%caps(cap_dac_read_search=ep) %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/debugfs.plugin
510 -
511 -# slabinfo plugin
512 -%caps(cap_dac_read_search=ep) %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/slabinfo.plugin
513 -
514 -# go.d.plugin (the capability required for wireguard module)
515 -%caps(cap_net_admin,cap_net_raw=eip) %{_libexecdir}/%{name}/plugins.d/go.d.plugin
523
524 # Enforce 0644 for files and 0755 for directories
525 # for the netdata web directory
@@ -528,45 +535,287 @@ rm -rf "${RPM_BUILD_ROOT}"
535 %attr(0770,netdata,netdata) %dir %{_localstatedir}/lib/%{name}/registry
536
537 # Free IPMI belongs to a different sub-package
531 -%if %{_have_freeipmi}
538 +%if 0%{?_have_freeipmi}
539 %exclude %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin
540 %endif
541
542 +# NFACCT belongs to a different sub-package
543 +%if 0%{?_have_nfacct}
544 +%exclude %{_libexecdir}/%{name}/plugins.d/nfacct.plugin
545 +%endif
546 +
547 +# Charts.d belongs to a different sub-package
548 +%exclude %{_libexecdir}/%{name}/plugins.d/charts.d.plugin
549 +%exclude %{_libexecdir}/%{name}/plugins.d/charts.d.dryrun-helper.sh
550 +%exclude %{_libexecdir}/%{name}/charts.d/
551 +%exclude %{_libdir}/%{name}/conf.d/charts.d.conf
552 +%exclude %{_libdir}/%{name}/conf.d/charts.d/
553 +
554 +# eBPF belongs to a different sub-package
555 +%if 0%{?_have_ebpf}
556 +%exclude %{_libexecdir}/%{name}/plugins.d/ebpf.plugin
557 +%exclude %{_libdir}/%{name}/conf.d/ebpf.d.conf
558 +%exclude %{_libdir}/%{name}/conf.d/ebpf.d
559 +%exclude %{_libexecdir}/%{name}/plugins.d/ebpf.d
560 +%endif
561 +
562 +# Python.d belongs to a different sub-package
563 +%exclude %{_libexecdir}/%{name}/plugins.d/python.d.plugin
564 +%exclude %{_libexecdir}/%{name}/python.d
565 +%exclude %{_libdir}/%{name}/conf.d/python.d.conf
566 +%exclude %{_libdir}/%{name}/conf.d/python.d
567 +
568 +# Go.d belongs to a different sub-package
569 +%exclude %{_libexecdir}/%{name}/plugins.d/go.d.plugin
570 +%exclude %{_libdir}/%{name}/conf.d/go.d.conf
571 +%exclude %{_libdir}/%{name}/conf.d/go.d
572 +
573 +# apps belongs to a different sub-package
574 +%exclude %{_libexecdir}/%{name}/plugins.d/apps.plugin
575 +%exclude %{_libdir}/%{name}/conf.d/apps_groups.conf
576 +
577 +# slabinfo belongs to a different sub-package
578 +%exclude %{_libexecdir}/%{name}/plugins.d/slabinfo.plugin
579 +
580 +# perf belongs to a different sub-package
581 +%exclude %{_libexecdir}/%{name}/plugins.d/perf.plugin
582 +
583 # CUPS belongs to a different sub package
584 %if 0%{?centos_ver} != 6 && 0%{?centos_ver} != 7
585 %exclude %{_libexecdir}/%{name}/plugins.d/cups.plugin
586
587 %package plugin-cups
540 -Summary: The Common Unix Printing System plugin for netdata
588 +Summary: The CUPS metrics collection plugin for the Netdata Agent
589 Group: Applications/System
590 Requires: cups >= 1.7
591 Requires: netdata = %{version}
592
593 %description plugin-cups
546 - This is the Common Unix Printing System plugin for the netdata daemon.
547 -Use this plugin to enable metrics collection from cupsd, the daemon running when CUPS is enabled on the system
594 + This plugin allows the Netdata Agent to collect metrics from the Common UNIX Printing System.
595
596 %files plugin-cups
597 %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/cups.plugin
598 %endif
599
553 -%if %{_have_freeipmi}
600 +%if 0%{?_have_freeipmi}
601 %package plugin-freeipmi
555 -Summary: FreeIPMI - The Intelligent Platform Management System
602 +Summary: The FreeIPMI metrics collection plugin for the Netdata Agent
603 Group: Applications/System
604 Requires: freeipmi
605 Requires: netdata = %{version}
606
607 %description plugin-freeipmi
561 - The IPMI specification defines a set of interfaces for platform management.
562 -It is implemented by a number vendors for system management. The features of IPMI that most users will be interested in
563 -are sensor monitoring, system event monitoring, power control, and serial-over-LAN (SOL).
608 + This plugin allows the Netdata Agent to collect metrics from hardware using FreeIPMI.
609
610 %files plugin-freeipmi
611 %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin
612 %endif
613
614 +%if 0%{?_have_nfacct}
615 +%package plugin-nfacct
616 +Summary: The NFACCT metrics collection plugin for the Netdata Agent
617 +Group: Applications/System
618 +Requires: libmnl
619 +Requires: netdata = %{version}
620 +Conflicts: netdata <= %{version}
621 +%if 0%{?fedora} || 0%{?suse_version} >= 1140
622 +Requires: libnetfilter_acct
623 +%endif
624 +
625 +%description plugin-nfacct
626 + This plugin allows the Netdata Agent to collect metrics from the firewall using NFACCT objects.
627 +
628 +%files plugin-nfacct
629 +%attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/nfacct.plugin
630 +%endif
631 +
632 +%package plugin-chartsd
633 +Summary: The charts.d metrics collection plugin for the Netdata Agent
634 +Group: Applications/System
635 +Requires: bash
636 +Requires: netdata = %{version}
637 +Conflicts: netdata <= %{version}
638 +%if 0%{?centos_ver} != 7
639 +Suggests: nut
640 +Suggests: apcupsd
641 +Suggests: iw
642 +Suggests: sudo
643 +%endif
644 +
645 +%description plugin-chartsd
646 + This plugin adds a selection of additional collectors written in shell script to the Netdata Agent.
647 +It includes collectors for NUT, APCUPSD, LibreSWAN, OpenSIPS, and Wireless access point statistics.
648 +
649 +%files plugin-chartsd
650 +%defattr(0750,root,netdata,0750)
651 +%{_libexecdir}/%{name}/plugins.d/charts.d.plugin
652 +%{_libexecdir}/%{name}/plugins.d/charts.d.dryrun-helper.sh
653 +%{_libexecdir}/%{name}/charts.d/
654 +%defattr(0644,root,netdata,0644)
655 +%{_libdir}/%{name}/conf.d/charts.d.conf
656 +%{_libdir}/%{name}/conf.d/charts.d/
657 +
658 +%if 0%{?_have_ebpf}
659 +%package plugin-ebpf
660 +Summary: The eBPF metrics collection plugin for the Netdata Agent
661 +Group: Applications/System
662 +Requires: netdata = %{version}
663 +Conflicts: netdata <= %{version}
664 +%if 0%{?centos_ver} != 7
665 +Recommends: netdata-plugin-apps = %{version}
666 +Recommends: netdata-ebpf-legacy-code >= %{version}
667 +%else
668 +Requires: netdata-plugin-apps = %{version}
669 +Requires: netdata-ebpf-legacy-code >= %{version}
670 +%endif
671 +
672 +%description plugin-ebpf
673 + This plugin allows the Netdata Agent to use eBPF code to collect more detailed kernel-level metrics for the system.
674 +
675 +%files plugin-ebpf
676 +%defattr(4750,root,netdata,4750)
677 +%{_libexecdir}/%{name}/plugins.d/ebpf.plugin
678 +%defattr(0644,root,netdata,0644)
679 +%{_libdir}/%{name}/conf.d/ebpf.d.conf
680 +%{_libdir}/%{name}/conf.d/ebpf.d
681 +
682 +%package ebpf-legacy-code
683 +Summary: Compiled eBPF legacy code for the Netdata eBPF plugin
684 +Group: Applications/System
685 +Requires: netdata-plugin-ebpf = %{version}
686 +Conflicts: netdata <= %{version}
687 +
688 +%description ebpf-legacy-code
689 + This package provides the pre-compiled eBPF legacy code for use by the Netdata eBPF plugin.
690 +This code is only needed when using the eBPF plugin with kernel versions before 5.10.
691 +
692 +%files ebpf-legacy-code
693 +%defattr(0640,root,netdata,0640)
694 +%{_libexecdir}/%{name}/plugins.d/ebpf.d/*.o
695 +
696 +%endif
697 +
698 +%package plugin-pythond
699 +Summary: The python.d metrics collection plugin for the Netdata Agent
700 +Group: Applications/System
701 +Requires: netdata = %{version}
702 +Conflicts: netdata <= %{version}
703 +%if 0%{?centos_ver} == 7 || 0%{?centos_ver} == 6
704 +Requires: python
705 +%else
706 +%if 0%{?centos_ver} == 8
707 +Requires: python38
708 +%else
709 +Requires: python3
710 +%endif
711 +%endif
712 +%if 0%{?centos_ver} != 7
713 +Suggests: sudo
714 +%endif
715 +
716 +%description plugin-pythond
717 + This plugin adds a selection of additional collectors written in Python to the Netdata Agent.
718 +Many of the collectors provided by this package are also available in netdata-plugin-go. In msot cases, you probably
719 +want to use those versions instead of the Python versions.
720 +
721 +%files plugin-pythond
722 +%defattr(0750,root,netdata,0750)
723 +%{_libexecdir}/%{name}/plugins.d/python.d.plugin
724 +%{_libexecdir}/%{name}/python.d
725 +%defattr(0640,root,netdata,0640)
726 +%{_libdir}/%{name}/conf.d/python.d.conf
727 +%{_libdir}/%{name}/conf.d/python.d
728 +
729 +%package plugin-go
730 +Summary: The go.d metrics collection plugin for the Netdata Agent
731 +Group: Applications/System
732 +Requires: netdata = %{version}
733 +Conflicts: netdata <= %{version}
734 +%if 0%{?centos_ver} != 7
735 +Suggests: nvme-cli
736 +Suggests: sudo
737 +%endif
738 +
739 +%description plugin-go
740 + This plugin adds a selection of additional collectors written in Go to the Netdata Agent
741 +A significant percentage of the application specific collectors provided by Netdata are part of this plugin,
742 +so most users will want it installed.
743 +
744 +%files plugin-go
745 +%defattr(0750,root,netdata,0750)
746 +# CAP_NET_ADMIN needed for WireGuard collector
747 +# CAP_NET_RAW needed for ping collector
748 +%caps(cap_net_admin,cap_net_raw=eip) %{_libexecdir}/%{name}/plugins.d/go.d.plugin
749 +%defattr(0644,root,netdata,0644)
750 +%{_libdir}/%{name}/conf.d/go.d.conf
751 +%{_libdir}/%{name}/conf.d/go.d
752 +
753 +%package plugin-apps
754 +Summary: The per-application metrics collection plugin for the Netdata Agent
755 +Group: Applications/System
756 +Requires: netdata = %{version}
757 +Conflicts: netdata <= %{version}
758 +
759 +%description plugin-apps
760 + This plugin allows the Netdata Agent to collect per-application and per-user metrics without using cgroups.
761 +
762 +%files plugin-apps
763 +%defattr(0750,root,netdata,0750)
764 +# CAP_DAC_READ_SEARCH and CAP_SYS_PTRACE needed for data collection by the plugin.
765 +%caps(cap_dac_read_search,cap_sys_ptrace=ep) %{_libexecdir}/%{name}/plugins.d/apps.plugin
766 +%defattr(0644,root,netdata,0644)
767 +%{_libdir}/%{name}/conf.d/apps_groups.conf
768 +
769 +%package plugin-slabinfo
770 +Summary: The slabinfo metrics collector for the Netdata Agent
771 +Group: Applications/System
772 +Requires: netdata = %{version}
773 +Conflicts: netdata <= %{version}
774 +
775 +%description plugin-slabinfo
776 + This plugin allows the Netdata Agent to collect perfromance and utilization metrics for the Linux kernel’s SLAB allocator.
777 +
778 +%files plugin-slabinfo
779 +%defattr(0750,root,netdata,0750)
780 +# CAP_DAC_READ_SEARCH needed to access the files the plugin reads to collect data.
781 +%caps(cap_dac_read_search=ep) %{_libexecdir}/%{name}/plugins.d/slabinfo.plugin
782 +
783 +%package plugin-perf
784 +Summary: The perf metrics collector for the Netdata Agent
785 +Group: Applications/System
786 +Requires: netdata = %{version}
787 +Conflicts: netdata <= %{version}
788 +
789 +%description plugin-perf
790 + This plugin allows the Netdata to collect metrics from the Linux perf subsystem.
791 +
792 +%files plugin-perf
793 +%defattr(0750,root,netdata,0750)
794 +# Either CAP_SYS_ADMIN or CAP_PERFMON needed for data collection
795 +# PERFMON is newer, so only try to use it on platforms which support it.
796 +%if 0%{?centos_ver} >= 9 || 0%{?fedora} >= 36
797 +%caps(cap_perfmon=ep) %{_libexecdir}/%{name}/plugins.d/perf.plugin
798 +%else
799 +%caps(cap_sys_admin=ep) %{_libexecdir}/%{name}/plugins.d/perf.plugin
800 +%endif
801 +
802 +%package plugin-debugfs
803 +Summary: The debugfs metrics collector for the Netdata Agent
804 +Group: Applications/System
805 +Requires: netdata = %{version}
806 +Conflicts: netdata <= %{version}
807 +
808 +%description plugin-debugfs
809 + This plugin allows the Netdata Agent to collect Linux kernel metrics exposed through debugfs.
810 +
811 +%files plugin-debugfs
812 +%defattr(0750,root,netdata,0750)
813 +# CAP_DAC_READ_SEARCH required for data collection.
814 +%caps(cap_dac_read_search=ep) %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/debugfs.plugin
815 +
816 %changelog
817 +* Fri Apr 07 2023 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-19
818 +- Split additional plugins out in their own packages.
819 * Tue Mar 21 2023 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-18
820 - Fix systemd handling to follow BCP.
821 - Drop pre-systemd init support.
@@ -609,8 +858,9 @@ First draft refactor on package dependencies section
858 * Wed Jan 02 2019 Pawel Krupa <pkrupa@redhat.com> - 0.0.0-3
859 - Temporary set version statically
860 - Fix changelog ordering
612 -- Comment-out node.d configuration directory
861 +- Comment-out node.d configuration directory
862 * Wed Jan 02 2019 Pawel Krupa <pkrupa@redhat.com> - 0.0.0-2
863 - Fix permissions for log files
864 * Sun Nov 15 2015 Alon Bar-Lev <alonbl@redhat.com> - 0.0.0-1
865 - Initial add.
866 +
packaging/bundle-ebpf.sh
+1 -1
@@ -15,5 +15,5 @@ if [ -x "${PLUGINDIR}/ebpf.plugin" ] ; then
15 mkdir "${PLUGINDIR}/ebpf.d"
16 fi
17 # shellcheck disable=SC2046
18 - cp -a $(find "${SRCDIR}/tmp/ebpf" -mindepth 1 -maxdepth 1) "${PLUGINDIR}/ebpf.d"
18 + cp -r $(find "${SRCDIR}/tmp/ebpf" -mindepth 1 -maxdepth 1) "${PLUGINDIR}/ebpf.d"
19 fi
packaging/bundle-libbpf.sh
+3 -3
@@ -22,6 +22,6 @@ curl -sSL --connect-timeout 10 --retry 3 "https://github.com/netdata/libbpf/arch
22 sha256sum -c "${1}/packaging/libbpf.checksums" || exit 1
23 tar -xzf "${LIBBPF_TARBALL}" -C "${1}/externaldeps/libbpf" || exit 1
24 make -C "${LIBBPF_BUILD_PATH}/src" BUILD_STATIC_ONLY=1 OBJDIR=build/ DESTDIR=../ install || exit 1
25 -cp -a "${LIBBPF_BUILD_PATH}/usr/${lib_subdir}/libbpf.a" "${1}/externaldeps/libbpf" || exit 1
26 -cp -a "${LIBBPF_BUILD_PATH}/usr/include" "${1}/externaldeps/libbpf" || exit 1
27 -cp -a "${LIBBPF_BUILD_PATH}/include/uapi" "${1}/externaldeps/libbpf/include" || exit 1
25 +cp -r "${LIBBPF_BUILD_PATH}/usr/${lib_subdir}/libbpf.a" "${1}/externaldeps/libbpf" || exit 1
26 +cp -r "${LIBBPF_BUILD_PATH}/usr/include" "${1}/externaldeps/libbpf" || exit 1
27 +cp -r "${LIBBPF_BUILD_PATH}/include/uapi" "${1}/externaldeps/libbpf/include" || exit 1
packaging/installer/kickstart.sh
+12
@@ -26,6 +26,7 @@ KICKSTART_SOURCE="$(
26 echo "$(pwd -P)/${self##*/}"
27 )"
28 PACKAGES_SCRIPT="https://raw.githubusercontent.com/netdata/netdata/master/packaging/installer/install-required-packages.sh"
29 +DEFAULT_PLUGIN_PACKAGES="netdata-plugin-go netdata-plugin-python netdata-plugin-apps netdata-plugin-ebpf"
30 PATH="${PATH}:/usr/local/bin:/usr/local/sbin"
31 PUBLIC_CLOUD_URL="https://app.netdata.cloud"
32 REPOCONFIG_DEB_URL_PREFIX="https://repo.netdata.cloud/repos/repoconfig"
@@ -1398,6 +1399,9 @@ try_package_install() {
1399 common_rpm_opts
1400 common_dnf_opts
1401 repo_prefix="el/${SYSVERSION}"
1402 + if [ "${SYSVERSION}" -lt 8 ]; then
1403 + explicitly_install_native_plugins=1
1404 + fi
1405 ;;
1406 fedora|ol)
1407 common_rpm_opts
@@ -1533,6 +1537,14 @@ try_package_install() {
1537 fi
1538 return 2
1539 fi
1540 +
1541 + if [ -n "${explicitly_install_native_plugins}" ]; then
1542 + progress "Installing external plugins."
1543 + # shellcheck disable=SC2086
1544 + if ! run_as_root env ${env} ${pm_cmd} install ${DEFAULT_PLUGIN_PACKAGES}; then
1545 + warning "Failed to install external plugin packages. Some collectors may not be available."
1546 + fi
1547 + fi
1548 }
1549
1550 # ======================================================================