@cryptotaxi247 / netdata-1 / commits / 2be15d151

Split network viewer plugin to it’s own package. (#16949)

* Split network viewer plugin to it’s own package. * Fix typos in RPM changelog. * Add soft dep on ebpf plugin.

Austin S. Hemmelgarn committed Feb 29, 2024 at 07:10 UTC 2be15d151745c37ac3d506a1d0aaf6d5e3dd562b
5 files changed +82 -3
contrib/debian/control
+13 -1
@@ -58,7 +58,8 @@ Conflicts: netdata-core,
58 Suggests: netdata-plugin-cups (= ${source:Version}),
59 netdata-plugin-freeipmi (= ${source:Version})
60 Recommends: netdata-plugin-systemd-journal (= ${source:Version}),
61 - netdata-plugin-logs-management (= ${source:Version})
61 + netdata-plugin-logs-management (= ${source:Version}),
62 + netdata-plugin-network-viewer (= ${source:Version})
63 Description: real-time charts for system monitoring
64 Netdata is a daemon that collects data in realtime (per second)
65 and presents a web site to view and analyze them. The presentation
@@ -223,3 +224,14 @@ Conflicts: netdata (<< ${source:Version})
224 Description: The logs-management plugin for the Netdata Agent
225 This plugin allows the Netdata Agent to collect logs from the system
226 and parse them to extract metrics.
227 +
228 +Package: netdata-plugin-network-viewer
229 +Architecture: any
230 +Depends: ${shlibs:Depends},
231 + netdata (= ${source:Version})
232 +Pre-Depends: libcap2-bin, adduser
233 +Recommends: netdata-plugin-ebpf (= ${source:Version} )
234 +Conflicts: netdata (<< ${source:Version})
235 +Description: The network viewer plugin for the Netdata Agent
236 + This plugin allows the Netdata Agent to provide network connection
237 + mapping functionality for use in netdata Cloud.
contrib/debian/netdata-plugin-network-viewer-plugin.postinst new
+17
@@ -0,0 +1,17 @@
1 +#!/bin/sh
2 +
3 +set -e
4 +
5 +case "$1" in
6 + configure|reconfigure)
7 + chown root:netdata /usr/libexec/netdata/plugins.d/network-viewer.plugin
8 + chmod 0750 /usr/libexec/netdata/plugins.d/network-viewer.plugin
9 + if ! setcap "cap_dac_read_search,cap_sys_admin,cap_sys_ptrace=eip" /usr/libexec/netdata/plugins.d/network-viewer.plugin; then
10 + chmod -f 4750 /usr/libexec/netdata/plugins.d/network-viewer.plugin
11 + fi
12 + ;;
13 +esac
14 +
15 +#DEBHELPER#
16 +
17 +exit 0
contrib/debian/netdata-plugin-network-viewer-plugin.preinst new
+13
@@ -0,0 +1,13 @@
1 +#!/bin/sh
2 +
3 +set -e
4 +
5 +case "$1" in
6 + install)
7 + if ! getent group netdata > /dev/null; then
8 + addgroup --quiet --system netdata
9 + fi
10 + ;;
11 +esac
12 +
13 +#DEBHELPER#
contrib/debian/rules
+7 -2
@@ -124,7 +124,7 @@ override_dh_install:
124 mv -f $(TEMPTOP)/usr/libexec/netdata/plugins.d/freeipmi.plugin \
125 $(TOP)-plugin-freeipmi/usr/libexec/netdata/plugins.d/freeipmi.plugin
126
127 - # Add free IPMI plugin install rules
127 + # Add NFACCT plugin install rules
128 #
129 mkdir -p $(TOP)-plugin-nfacct/usr/libexec/netdata/plugins.d
130 mv -f $(TEMPTOP)/usr/libexec/netdata/plugins.d/nfacct.plugin \
@@ -222,6 +222,11 @@ override_dh_install:
222 mv -f $(TEMPTOP)/usr/lib/netdata/conf.d/go.d \
223 $(TOP)-plugin-go/usr/lib/netdata/conf.d/go.d
224
225 + # Add network-viewer plugin install rules
226 + mkdir -p $(TOP)-plugin-network-viewer/usr/libexec/netdata/plugins.d/
227 + mv -f $(TEMPTOP)/usr/libexec/netdata/plugins.d/network-viewer.plugin \
228 + $(TOP)-plugin-network-viewer/usr/libexec/netdata/plugins.d/network-viewer.plugin
229 +
230 # Set the rest of the software in the main package
231 #
232 cp -rp $(TEMPTOP)/usr $(TOP)
@@ -294,7 +299,7 @@ override_dh_fixperms:
299 chmod 4750 $(TOP)/usr/libexec/netdata/plugins.d/local-listeners
300
301 # network-viewer
297 - chmod 4750 $(TOP)/usr/libexec/netdata/plugins.d/network-viewer.plugin
302 + chmod 4750 $(TOP)-plugin-network-viewer/usr/libexec/netdata/plugins.d/network-viewer.plugin
303
304 # systemd-journal
305 chmod 4750 $(TOP)-plugin-systemd-journal/usr/libexec/netdata/plugins.d/systemd-journal.plugin
netdata.spec.in
+32
@@ -211,9 +211,11 @@ Suggests: %{name}-plugin-freeipmi = %{version}
211 Suggests: %{name}-plugin-cups = %{version}
212 %endif
213 Recommends: %{name}-plugin-systemd-journal = %{version}
214 +Recommends: %{name}-plugin-network-viewer = %{version}
215 Recommends: %{name}-plugin-logs-management = %{version}
216 %else
217 Requires: %{name}-plugin-systemd-journal = %{version}
218 +Requires: %{name}-plugin-network-viewer = %{version}
219 %endif
220
221
@@ -629,6 +631,9 @@ rm -rf "${RPM_BUILD_ROOT}"
631 %exclude %{_libdir}/%{name}/conf.d/logsmanagement.d.conf
632 %exclude %{_libdir}/%{name}/conf.d/logsmanagement.d
633
634 +# Network viewer belongs to a different sub-package
635 +%exclude %{_libexecdir}/%{name}/plugins.d/network-viewer.plugin
636 +
637 # CUPS belongs to a different sub package
638 %if %{_have_cups}
639 %exclude %{_libexecdir}/%{name}/plugins.d/cups.plugin
@@ -990,7 +995,34 @@ fi
995 # CAP_DAC_READ_SEARCH and CAP_SYSLOG needed for data collection.
996 %caps(cap_dac_read_search,cap_syslog=ep) %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/logs-management.plugin
997
998 +%package plugin-network-viewer
999 +Summary: The network viewer plugin for the Netdata Agent
1000 +Group: Applications/System
1001 +Requires: %{name} = %{version}
1002 +Conflicts: %{name} < %{version}
1003 +%if 0%{?centos_ver} != 7
1004 +Recommends: %{name}-plugin-ebpf = %{version}
1005 +%else
1006 +Requires: %{name}-plugin-ebpf = %{version}
1007 +%endif
1008 +
1009 +%description plugin-network-viewer
1010 + This plugin allows the Netdata Agent to provide network connection
1011 + mapping functionality for use in netdata Cloud.
1012 +
1013 +%pre plugin-network-viewer
1014 +if ! getent group %{name} > /dev/null; then
1015 + groupadd --system %{name}
1016 +fi
1017 +
1018 +%files plugin-network-viewer
1019 +%defattr(0750,root,netdata,0750)
1020 +# CAP_SYS_ADMIN, CAP_SYS_PTRACE and CAP_DAC_READ_SEARCH needed for data collection.
1021 +%caps(cap_sys_admin,cap_sys_ptrace,cap_dac_read_search=ep) %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/network-viewer.plugin
1022 +
1023 %changelog
1024 +* Tue Feb 06 2024 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-25
1025 +- Add package for network-viewer plugin
1026 * Thu Oct 26 2023 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-24
1027 - Add package for logs-management plugin
1028 * Tue Sep 19 2023 Austin hemmelgarn <austin@netdata.cloud> 0.0.0-24