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
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!
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
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 \
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
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}"
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
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
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.
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
+