netdata.spec.in 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866
  1. # SPDX-License-Identifier: GPL-3.0-or-later
  2. %global contentdir %{_datadir}/netdata
  3. %global version @PACKAGE_VERSION@
  4. #TODO: Temporary fix for the build-id error during go.d plugin set up
  5. %global _missing_build_ids_terminate_build 0
  6. # XXX: We are using automatic `Requires:` generation for libraries
  7. # whenever possible, DO NOT LIST LIBRARY DEPENDENCIES UNLESS THE RESULTANT
  8. # PACKAGE IS BROKEN WITHOUT THEM.
  9. AutoReqProv: yes
  10. # This is temporary and should eventually be resolved. This bypasses
  11. # the default rhel __os_install_post which throws a python compile
  12. # error.
  13. %global __os_install_post %{nil}
  14. # We don’t want LTO as it has a minimal performance impact at runtime
  15. # but a huge impact on build times (we want our CI to not take multiple
  16. # hours to finish).
  17. %global _lto_cflags %nil
  18. # Disable eBPF for architectures other than x86
  19. %ifarch x86_64 i386
  20. %global _have_ebpf 1
  21. %else
  22. %global _have_ebpf 0
  23. %endif
  24. # Mitigate the cross-distro mayhem by strictly defining the libexec destination
  25. %define _prefix /usr
  26. %define _sysconfdir /etc
  27. %define _localstatedir /var
  28. %define _libexecdir /usr/libexec
  29. %define _libdir /usr/lib
  30. # Fedora doesn’t define this, but other distros do
  31. %{!?_presetdir:%global _presetdir %{_libdir}/systemd/system-preset}
  32. # Redefine centos_ver to standardize on a single macro
  33. %{?rhel:%global centos_ver %rhel}
  34. # Disable FreeIPMI on Amazon Linux 2023 and newer
  35. %if 0%{?amzn} >= 2023
  36. %global _have_freeipmi 0
  37. %else
  38. %global _have_freeipmi 1
  39. %endif
  40. # Disable NFACCT for RHEL equivalents and Amazon Linux
  41. %if 0%{?centos_ver} || 0%{?amzn}
  42. %global _have_nfacct 0
  43. %else
  44. %global _have_nfacct 1
  45. %endif
  46. Summary: Real-time performance monitoring, done right!
  47. Name: netdata
  48. Version: %{version}
  49. Release: 1%{?dist}
  50. License: GPLv3+
  51. Group: Applications/System
  52. Source0: https://github.com/netdata/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz
  53. URL: http://my-netdata.io
  54. # Remove conflicting EPEL packages
  55. Obsoletes: %{name}-conf
  56. Obsoletes: %{name}-data
  57. # #####################################################################
  58. # Core build/install/runtime dependencies
  59. # #####################################################################
  60. # Build dependencies
  61. #
  62. BuildRequires: gcc
  63. BuildRequires: gcc-c++
  64. BuildRequires: make
  65. BuildRequires: git-core
  66. BuildRequires: autoconf
  67. %if 0%{?fedora} || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1140
  68. BuildRequires: autoconf-archive
  69. %if 0%{?rhel} <= 8 && 0%{?amzn} < 2023
  70. BuildRequires: autogen
  71. %endif
  72. %endif
  73. BuildRequires: automake
  74. BuildRequires: cmake
  75. BuildRequires: pkgconfig
  76. BuildRequires: curl
  77. BuildRequires: findutils
  78. BuildRequires: zlib-devel
  79. BuildRequires: libuuid-devel
  80. BuildRequires: libuv-devel >= 1
  81. BuildRequires: openssl-devel
  82. %if 0%{?suse_version}
  83. BuildRequires: protobuf-devel
  84. BuildRequires: libprotobuf-c-devel
  85. BuildRequires: liblz4-devel
  86. BuildRequires: libjson-c-devel
  87. BuildRequires: libyaml-devel
  88. %else
  89. %if 0%{?fedora}
  90. BuildRequires: protobuf-devel
  91. BuildRequires: protobuf-c-devel
  92. BuildRequires: lz4-devel
  93. BuildRequires: json-c-devel
  94. BuildRequires: libyaml-devel
  95. %else
  96. %if 0%{?centos_ver} >= 8
  97. BuildRequires: protobuf-devel
  98. BuildRequires: protobuf-c-devel
  99. %endif
  100. BuildRequires: lz4-devel
  101. BuildRequires: json-c-devel
  102. BuildRequires: libyaml-devel
  103. %endif
  104. %endif
  105. # Core build requirements for service install
  106. %if 0%{?suse_version}
  107. BuildRequires: systemd-rpm-macros
  108. %else
  109. BuildRequires: systemd
  110. %endif
  111. # Runtime dependencies
  112. #
  113. %if 0%{?centos_ver} == 7 || 0%{?centos_ver} == 6
  114. Requires: python
  115. %else
  116. %if 0%{?centos_ver} == 8
  117. Requires: python38
  118. %else
  119. Requires: python3
  120. %endif
  121. %endif
  122. # Core requirements for the install to succeed
  123. Requires(pre): /usr/sbin/groupadd
  124. Requires(pre): /usr/sbin/useradd
  125. # #####################################################################
  126. # External plugin package dependencies
  127. # #####################################################################
  128. # CentOS prior to CentOS 8 does not have a new enough version of RPM
  129. # to support weak dependencies. Explicitly requiring our default plugins
  130. # makes it impossible to properly test the packages prior to upload,
  131. # so we just skip depending on them on CentOS 7.
  132. %if 0%{?centos_ver} != 7
  133. %if 0%{?_have_ebpf}
  134. Recommends: netdata-plugin-ebpf
  135. %endif
  136. Recommends: netdata-plugin-apps
  137. Recommends: netdata-plugin-pythond
  138. Recommends: netdata-plugin-go
  139. Recommends: netdata-plugin-debugfs
  140. %if 0%{?_have_freeipmi}
  141. Suggests: netdata-plugin-freeipmi
  142. %endif
  143. %if 0%{?_have_nfacct}
  144. Suggests: netdata-plugin-nfacct
  145. %endif
  146. Suggests: netdata-plugin-cups
  147. Suggests: netdata-plugin-chartsd
  148. Suggests: netdata-plugin-slabinfo
  149. Suggests: netdata-plugin-perf
  150. %endif
  151. # #####################################################################
  152. # Functionality-dependent package dependencies
  153. # #####################################################################
  154. # Note: Some or all of the Packages may be found in the EPEL repo,
  155. # rather than the standard ones
  156. # nfacct plugin dependencies
  157. %if 0%{?_have_nfacct}
  158. BuildRequires: libmnl-devel
  159. BuildRequires: libnetfilter_acct-devel
  160. %endif
  161. # end nfacct plugin dependencies
  162. # freeipmi plugin dependencies
  163. %if 0%{?_have_freeipmi}
  164. BuildRequires: freeipmi-devel
  165. %endif
  166. # end - freeipmi plugin dependencies
  167. # CUPS plugin dependencies
  168. %if 0%{?centos_ver} != 6 && 0%{?centos_ver} != 7
  169. BuildRequires: cups-devel >= 1.7
  170. %endif
  171. # end - cups plugin dependencies
  172. # Prometheus remote write dependencies
  173. BuildRequires: snappy-devel
  174. # end - prometheus remote write dependencies
  175. # #####################################################################
  176. # End of dependency management configuration
  177. # #####################################################################
  178. %description
  179. netdata is the fastest way to visualize metrics. It is a resource
  180. efficient, highly optimized system for collecting and visualizing any
  181. type of realtime timeseries data, from CPU usage, disk activity, SQL
  182. queries, API calls, web site visitors, etc.
  183. netdata tries to visualize the truth of now, in its greatest detail,
  184. so that you can get insights of what is happening now and what just
  185. happened, on your systems and applications.
  186. %prep
  187. %setup -q -n %{name}-%{version}
  188. # Only bundle protobuf on CentOS 7 or earlier
  189. %if 0%{?centos_ver:1}
  190. %if %{centos_ver} < 8
  191. export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-protobuf.sh ${RPM_BUILD_DIR}/%{name}-%{version}
  192. %endif
  193. %endif
  194. %if 0%{?_have_ebpf}
  195. %if 0%{?centos_ver:1}
  196. %if %{centos_ver} < 8
  197. export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-libbpf.sh ${RPM_BUILD_DIR}/%{name}-%{version} centos7
  198. export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-ebpf-co-re.sh ${RPM_BUILD_DIR}/%{name}-%{version}
  199. %else
  200. export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-libbpf.sh ${RPM_BUILD_DIR}/%{name}-%{version} centos8
  201. export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-ebpf-co-re.sh ${RPM_BUILD_DIR}/%{name}-%{version}
  202. %endif
  203. %else
  204. export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-libbpf.sh ${RPM_BUILD_DIR}/%{name}-%{version} other
  205. export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-ebpf-co-re.sh ${RPM_BUILD_DIR}/%{name}-%{version}
  206. %endif
  207. %endif
  208. %build
  209. # Conf step
  210. autoreconf -ivf
  211. %configure \
  212. %if 0%{!?_have_ebpf}
  213. --disable-ebpf
  214. %endif
  215. %if 0%{!?_have_freeipmi}
  216. --disable-plugin-freeipmi
  217. %endif
  218. %if 0%{!?_have_nfacct}
  219. --disable-plugin-nfacct
  220. %endif
  221. %if 0%{?centos_ver:1}
  222. %if %{centos_ver} < 8
  223. --with-bundled-protobuf \
  224. %endif
  225. %endif
  226. --prefix="%{_prefix}" \
  227. --sysconfdir="%{_sysconfdir}" \
  228. --localstatedir="%{_localstatedir}" \
  229. --libexecdir="%{_libexecdir}" \
  230. --libdir="%{_libdir}" \
  231. --with-zlib \
  232. --with-math \
  233. --with-user=netdata \
  234. --disable-dependency-tracking
  235. # Build step
  236. %{__make} %{?_smp_mflags}
  237. %install
  238. # ###########################################################
  239. # Clear the directory, if already exists and install
  240. rm -rf "${RPM_BUILD_ROOT}"
  241. %{__make} %{?_smp_mflags} DESTDIR="${RPM_BUILD_ROOT}" install
  242. install -m 644 -p system/netdata.conf "${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}"
  243. # ###########################################################
  244. # Install updater script
  245. install -m 755 -p packaging/installer/netdata-updater.sh "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/netdata-updater.sh"
  246. # ###########################################################
  247. # logrotate settings
  248. install -m 755 -d "${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d"
  249. install -m 644 -p system/logrotate/netdata "${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name}"
  250. # ###########################################################
  251. # Install freeipmi
  252. %if 0%{?_have_freeipmi}
  253. install -m 4750 -p freeipmi.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/freeipmi.plugin"
  254. %endif
  255. # ###########################################################
  256. # Install apps.plugin
  257. install -m 4750 -p apps.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/apps.plugin"
  258. # ###########################################################
  259. # Install debugfs.plugin
  260. install -m 0750 -p debugfs.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/debugfs.plugin"
  261. # ###########################################################
  262. # Install perf.plugin
  263. install -m 4750 -p perf.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/perf.plugin"
  264. # ###########################################################
  265. # Install ebpf.plugin
  266. %if 0%{?_have_ebpf}
  267. install -m 4750 -p ebpf.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/ebpf.plugin"
  268. %endif
  269. # ###########################################################
  270. # Install cups.plugin
  271. %if 0%{?centos_ver} != 6 && 0%{?centos_ver} != 7
  272. install -m 0750 -p cups.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/cups.plugin"
  273. %endif
  274. # ###########################################################
  275. # Install slabinfo.plugin
  276. install -m 4750 -p slabinfo.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/slabinfo.plugin"
  277. # ###########################################################
  278. # Install cache and log directories
  279. install -m 755 -d "${RPM_BUILD_ROOT}%{_localstatedir}/cache/%{name}"
  280. install -m 755 -d "${RPM_BUILD_ROOT}%{_localstatedir}/log/%{name}"
  281. # ###########################################################
  282. # Install registry directory
  283. install -m 755 -d "${RPM_BUILD_ROOT}%{_localstatedir}/lib/%{name}/registry"
  284. # ###########################################################
  285. # Install uninstaller script
  286. install -m 750 -p packaging/installer/netdata-uninstaller.sh \
  287. "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/netdata-uninstaller.sh"
  288. # ###########################################################
  289. # Install netdata service
  290. install -m 755 -d "${RPM_BUILD_ROOT}%{_unitdir}"
  291. install -m 644 -p system/systemd/netdata.service "${RPM_BUILD_ROOT}%{_unitdir}/netdata.service"
  292. install -m 755 -d "${RPM_BUILD_ROOT}%{_presetdir}"
  293. install -m 644 -p system/systemd/50-netdata.preset "${RPM_BUILD_ROOT}%{_presetdir}/50-netdata.preset"
  294. # ############################################################
  295. # Package Go within netdata (TBD: Package it separately)
  296. safe_sha256sum() {
  297. # Within the context of the installer, we only use -c option that is common between the two commands
  298. # We will have to reconsider if we start non-common options
  299. if command -v sha256sum >/dev/null 2>&1; then
  300. sha256sum $@
  301. elif command -v shasum >/dev/null 2>&1; then
  302. shasum -a 256 $@
  303. else
  304. fatal "I could not find a suitable checksum binary to use"
  305. fi
  306. }
  307. download_go() {
  308. url="${1}"
  309. dest="${2}"
  310. if command -v curl >/dev/null 2>&1; then
  311. curl -sSL --connect-timeout 10 --retry 3 "${url}" > "${dest}"
  312. elif command -v wget >/dev/null 2>&1; then
  313. wget -T 15 -O - "${url}" > "${dest}"
  314. else
  315. echo >&2
  316. echo >&2 "Downloading go.d plugin from '${url}' failed because of missing mandatory packages."
  317. echo >&2 "Either add packages or disable it by issuing '--disable-go' in the installer"
  318. echo >&2
  319. exit 1
  320. fi
  321. }
  322. install_go() {
  323. # When updating this value, ensure correct checksums in packaging/go.d.checksums
  324. GO_PACKAGE_VERSION="$(cat packaging/go.d.version)"
  325. ARCH_MAP=(
  326. 'i386::386'
  327. 'i686::386'
  328. 'x86_64::amd64'
  329. 'aarch64::arm64'
  330. 'armv64::arm64'
  331. 'armv6l::arm'
  332. 'armv7l::arm'
  333. 'armv5tel::arm'
  334. )
  335. if [ -z "${NETDATA_DISABLE_GO+x}" ]; then
  336. echo >&2 "Install go.d.plugin"
  337. ARCH=$(uname -m)
  338. OS=$(uname -s | tr '[:upper:]' '[:lower:]')
  339. for index in "${ARCH_MAP[@]}" ; do
  340. KEY="${index%%::*}"
  341. VALUE="${index##*::}"
  342. if [ "$KEY" = "$ARCH" ]; then
  343. ARCH="${VALUE}"
  344. break
  345. fi
  346. done
  347. tmp=$(mktemp -d /tmp/netdata-go-XXXXXX)
  348. GO_PACKAGE_BASENAME="go.d.plugin-${GO_PACKAGE_VERSION}.${OS}-${ARCH}.tar.gz"
  349. download_go "https://github.com/netdata/go.d.plugin/releases/download/${GO_PACKAGE_VERSION}/${GO_PACKAGE_BASENAME}" "${tmp}/${GO_PACKAGE_BASENAME}"
  350. download_go "https://github.com/netdata/go.d.plugin/releases/download/${GO_PACKAGE_VERSION}/config.tar.gz" "${tmp}/config.tar.gz"
  351. if [ ! -f "${tmp}/${GO_PACKAGE_BASENAME}" ] || [ ! -f "${tmp}/config.tar.gz" ] || [ ! -s "${tmp}/config.tar.gz" ] || [ ! -s "${tmp}/${GO_PACKAGE_BASENAME}" ]; then
  352. echo >&2 "Either check the error or consider disabling it by issuing '--disable-go' in the installer"
  353. echo >&2
  354. return 1
  355. fi
  356. grep "${GO_PACKAGE_BASENAME}\$" "packaging/go.d.checksums" > "${tmp}/sha256sums.txt" 2>/dev/null
  357. grep "config.tar.gz" "packaging/go.d.checksums" >> "${tmp}/sha256sums.txt" 2>/dev/null
  358. # Checksum validation
  359. if ! (cd "${tmp}" && safe_sha256sum -c "sha256sums.txt"); then
  360. echo >&2 "go.d plugin checksum validation failure."
  361. echo >&2 "Either check the error or consider disabling it by issuing '--disable-go' in the installer"
  362. echo >&2
  363. echo "go.d.plugin package files checksum validation failed."
  364. exit 1
  365. fi
  366. # Install files
  367. tar -xf "${tmp}/config.tar.gz" -C "${RPM_BUILD_ROOT}%{_libdir}/%{name}/conf.d/"
  368. tar xf "${tmp}/${GO_PACKAGE_BASENAME}"
  369. mv "${GO_PACKAGE_BASENAME/\.tar\.gz/}" "go.d.plugin"
  370. rm -rf "${tmp}"
  371. fi
  372. return 0
  373. }
  374. install_go
  375. install -m 0640 -p go.d.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/go.d.plugin"
  376. %if 0%{?_have_ebpf}
  377. ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-ebpf.sh ${RPM_BUILD_DIR}/%{name}-%{version} ${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d
  378. %endif
  379. %pre
  380. if ! getent group netdata > /dev/null; then
  381. groupadd --system netdata
  382. fi
  383. if ! getent passwd netdata > /dev/null; then
  384. useradd --system -g netdata --home %{contentdir} --no-create-home -s /sbin/nologin -c "Netdata pseudo user" netdata
  385. fi
  386. # I am not sure that the corresponding group names are exactly the same as in Debian, but we should start somewhere, shouldn't we?
  387. for item in docker nginx varnish haproxy adm nsd proxy squid ceph nobody I2C; do
  388. if getent group $item > /dev/null 2>&1; then
  389. usermod -a -G $item netdata
  390. fi
  391. done
  392. %post
  393. %if 0%{?suse_version}
  394. %service_add_post netdata.service
  395. %else
  396. %systemd_post netdata.service
  397. %endif
  398. %preun
  399. %if 0%{?suse_version}
  400. %service_del_preun netdata.service
  401. %else
  402. %systemd_preun netdata.service
  403. %endif
  404. %postun
  405. %if 0%{?suse_version}
  406. %service_del_postun netdata.service
  407. %else
  408. %systemd_postun_with_restart netdata.service
  409. %endif
  410. %clean
  411. rm -rf "${RPM_BUILD_ROOT}"
  412. %files
  413. %doc README.md
  414. %config(noreplace) %{_sysconfdir}/%{name}/netdata.conf
  415. %attr(0755,root,netdata) %{_sysconfdir}/%{name}/edit-config
  416. %attr(0644,root,netdata) %{_sysconfdir}/%{name}/.install-type
  417. %dir %{_sysconfdir}/%{name}/health.d
  418. %dir %{_sysconfdir}/%{name}/statsd.d
  419. %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
  420. %{_libdir}/%{name}
  421. %{_sbindir}/%{name}
  422. %{_sbindir}/netdatacli
  423. %{_sbindir}/netdata-claim.sh
  424. %{_unitdir}/netdata.service
  425. %{_presetdir}/50-netdata.preset
  426. %dir %{_libexecdir}/%{name}
  427. %dir %{_libexecdir}/%{name}/plugins.d
  428. %defattr(0750,root,netdata,0750)
  429. %{_libexecdir}/%{name}/install-service.sh
  430. %{_libexecdir}/%{name}/netdata-updater.sh
  431. %{_libexecdir}/%{name}/netdata-uninstaller.sh
  432. %{_libexecdir}/%{name}/plugins.d/acl.sh
  433. %{_libexecdir}/%{name}/plugins.d/alarm.sh
  434. %{_libexecdir}/%{name}/plugins.d/alarm-email.sh
  435. %{_libexecdir}/%{name}/plugins.d/alarm-notify.sh
  436. %{_libexecdir}/%{name}/plugins.d/alarm-test.sh
  437. %{_libexecdir}/%{name}/plugins.d/anonymous-statistics.sh
  438. %{_libexecdir}/%{name}/plugins.d/cgroup-name.sh
  439. %{_libexecdir}/%{name}/plugins.d/get-kubernetes-labels.sh
  440. %{_libexecdir}/%{name}/plugins.d/health-cmdapi-test.sh
  441. %{_libexecdir}/%{name}/plugins.d/ioping.plugin
  442. %{_libexecdir}/%{name}/plugins.d/loopsleepms.sh.inc
  443. %{_libexecdir}/%{name}/plugins.d/request.sh
  444. %{_libexecdir}/%{name}/plugins.d/system-info.sh
  445. %{_libexecdir}/%{name}/plugins.d/tc-qos-helper.sh
  446. %{_libexecdir}/%{name}/plugins.d/template_dim.sh
  447. # cgroup-network detects the network interfaces of CGROUPs
  448. # it must be able to use setns() and run cgroup-network-helper.sh as root
  449. # the helper script reads /proc/PID/fdinfo/* files, runs virsh, etc.
  450. %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/cgroup-network
  451. %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/cgroup-network-helper.sh
  452. # Enforce 0644 for files and 0755 for directories
  453. # for the netdata web directory
  454. %defattr(0644,root,root,0755)
  455. %{_datadir}/%{name}/web
  456. # Enforce 0660 for files and 0770 for directories
  457. # for the netdata lib, cache and log dirs
  458. %defattr(0660,root,netdata,0770)
  459. %attr(0770,netdata,netdata) %dir %{_localstatedir}/cache/%{name}
  460. %attr(0755,netdata,root) %dir %{_localstatedir}/log/%{name}
  461. %attr(0770,netdata,netdata) %dir %{_localstatedir}/lib/%{name}
  462. %attr(0770,netdata,netdata) %dir %{_localstatedir}/lib/%{name}/registry
  463. # Free IPMI belongs to a different sub-package
  464. %if 0%{?_have_freeipmi}
  465. %exclude %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin
  466. %endif
  467. # NFACCT belongs to a different sub-package
  468. %if 0%{?_have_nfacct}
  469. %exclude %{_libexecdir}/%{name}/plugins.d/nfacct.plugin
  470. %endif
  471. # Charts.d belongs to a different sub-package
  472. %exclude %{_libexecdir}/%{name}/plugins.d/charts.d.plugin
  473. %exclude %{_libexecdir}/%{name}/plugins.d/charts.d.dryrun-helper.sh
  474. %exclude %{_libexecdir}/%{name}/charts.d/
  475. %exclude %{_libdir}/%{name}/conf.d/charts.d.conf
  476. %exclude %{_libdir}/%{name}/conf.d/charts.d/
  477. # eBPF belongs to a different sub-package
  478. %if 0%{?_have_ebpf}
  479. %exclude %{_libexecdir}/%{name}/plugins.d/ebpf.plugin
  480. %exclude %{_libdir}/%{name}/conf.d/ebpf.d.conf
  481. %exclude %{_libdir}/%{name}/conf.d/ebpf.d
  482. %exclude %{_libexecdir}/%{name}/plugins.d/ebpf.d
  483. %endif
  484. # Python.d belongs to a different sub-package
  485. %exclude %{_libexecdir}/%{name}/plugins.d/python.d.plugin
  486. %exclude %{_libexecdir}/%{name}/python.d
  487. %exclude %{_libdir}/%{name}/conf.d/python.d.conf
  488. %exclude %{_libdir}/%{name}/conf.d/python.d
  489. # Go.d belongs to a different sub-package
  490. %exclude %{_libexecdir}/%{name}/plugins.d/go.d.plugin
  491. %exclude %{_libdir}/%{name}/conf.d/go.d.conf
  492. %exclude %{_libdir}/%{name}/conf.d/go.d
  493. # apps belongs to a different sub-package
  494. %exclude %{_libexecdir}/%{name}/plugins.d/apps.plugin
  495. %exclude %{_libdir}/%{name}/conf.d/apps_groups.conf
  496. # slabinfo belongs to a different sub-package
  497. %exclude %{_libexecdir}/%{name}/plugins.d/slabinfo.plugin
  498. # perf belongs to a different sub-package
  499. %exclude %{_libexecdir}/%{name}/plugins.d/perf.plugin
  500. # CUPS belongs to a different sub package
  501. %if 0%{?centos_ver} != 6 && 0%{?centos_ver} != 7
  502. %exclude %{_libexecdir}/%{name}/plugins.d/cups.plugin
  503. %package plugin-cups
  504. Summary: The CUPS metrics collection plugin for the Netdata Agent
  505. Group: Applications/System
  506. Requires: cups >= 1.7
  507. Requires: netdata = %{version}
  508. %description plugin-cups
  509. This plugin allows the Netdata Agent to collect metrics from the Common UNIX Printing System.
  510. %files plugin-cups
  511. %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/cups.plugin
  512. %endif
  513. %if 0%{?_have_freeipmi}
  514. %package plugin-freeipmi
  515. Summary: The FreeIPMI metrics collection plugin for the Netdata Agent
  516. Group: Applications/System
  517. Requires: freeipmi
  518. Requires: netdata = %{version}
  519. %description plugin-freeipmi
  520. This plugin allows the Netdata Agent to collect metrics from hardware using FreeIPMI.
  521. %files plugin-freeipmi
  522. %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin
  523. %endif
  524. %if 0%{?_have_nfacct}
  525. %package plugin-nfacct
  526. Summary: The NFACCT metrics collection plugin for the Netdata Agent
  527. Group: Applications/System
  528. Requires: libmnl
  529. Requires: netdata = %{version}
  530. Conflicts: netdata < %{version}
  531. %if 0%{?fedora} || 0%{?suse_version} >= 1140
  532. Requires: libnetfilter_acct
  533. %endif
  534. %description plugin-nfacct
  535. This plugin allows the Netdata Agent to collect metrics from the firewall using NFACCT objects.
  536. %files plugin-nfacct
  537. %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/nfacct.plugin
  538. %endif
  539. %package plugin-chartsd
  540. Summary: The charts.d metrics collection plugin for the Netdata Agent
  541. Group: Applications/System
  542. Requires: bash
  543. Requires: netdata = %{version}
  544. Conflicts: netdata < %{version}
  545. %if 0%{?centos_ver} != 7
  546. Suggests: nut
  547. Suggests: apcupsd
  548. Suggests: iw
  549. Suggests: sudo
  550. %endif
  551. %description plugin-chartsd
  552. This plugin adds a selection of additional collectors written in shell script to the Netdata Agent.
  553. It includes collectors for NUT, APCUPSD, LibreSWAN, OpenSIPS, and Wireless access point statistics.
  554. %files plugin-chartsd
  555. %defattr(0750,root,netdata,0750)
  556. %{_libexecdir}/%{name}/plugins.d/charts.d.plugin
  557. %{_libexecdir}/%{name}/plugins.d/charts.d.dryrun-helper.sh
  558. %{_libexecdir}/%{name}/charts.d/
  559. %defattr(0644,root,netdata,0644)
  560. %{_libdir}/%{name}/conf.d/charts.d.conf
  561. %{_libdir}/%{name}/conf.d/charts.d/
  562. %if 0%{?_have_ebpf}
  563. %package plugin-ebpf
  564. Summary: The eBPF metrics collection plugin for the Netdata Agent
  565. Group: Applications/System
  566. Requires: netdata = %{version}
  567. Conflicts: netdata < %{version}
  568. %if 0%{?centos_ver} != 7
  569. Recommends: netdata-plugin-apps = %{version}
  570. Recommends: netdata-ebpf-legacy-code >= %{version}
  571. %else
  572. Requires: netdata-plugin-apps = %{version}
  573. Requires: netdata-ebpf-legacy-code >= %{version}
  574. %endif
  575. %description plugin-ebpf
  576. This plugin allows the Netdata Agent to use eBPF code to collect more detailed kernel-level metrics for the system.
  577. %files plugin-ebpf
  578. %defattr(4750,root,netdata,4750)
  579. %{_libexecdir}/%{name}/plugins.d/ebpf.plugin
  580. %defattr(0644,root,netdata,0644)
  581. %{_libdir}/%{name}/conf.d/ebpf.d.conf
  582. %{_libdir}/%{name}/conf.d/ebpf.d
  583. %package ebpf-legacy-code
  584. Summary: Compiled eBPF legacy code for the Netdata eBPF plugin
  585. Group: Applications/System
  586. Requires: netdata-plugin-ebpf = %{version}
  587. Conflicts: netdata < %{version}
  588. %description ebpf-legacy-code
  589. This package provides the pre-compiled eBPF legacy code for use by the Netdata eBPF plugin.
  590. This code is only needed when using the eBPF plugin with kernel versions before 5.10.
  591. %files ebpf-legacy-code
  592. %defattr(0640,root,netdata,0640)
  593. %{_libexecdir}/%{name}/plugins.d/ebpf.d/*.o
  594. %endif
  595. %package plugin-pythond
  596. Summary: The python.d metrics collection plugin for the Netdata Agent
  597. Group: Applications/System
  598. Requires: netdata = %{version}
  599. Conflicts: netdata < %{version}
  600. %if 0%{?centos_ver} == 7 || 0%{?centos_ver} == 6
  601. Requires: python
  602. %else
  603. %if 0%{?centos_ver} == 8
  604. Requires: python38
  605. %else
  606. Requires: python3
  607. %endif
  608. %endif
  609. %if 0%{?centos_ver} != 7
  610. Suggests: sudo
  611. %endif
  612. %description plugin-pythond
  613. This plugin adds a selection of additional collectors written in Python to the Netdata Agent.
  614. Many of the collectors provided by this package are also available in netdata-plugin-go. In msot cases, you probably
  615. want to use those versions instead of the Python versions.
  616. %files plugin-pythond
  617. %defattr(0750,root,netdata,0750)
  618. %{_libexecdir}/%{name}/plugins.d/python.d.plugin
  619. %{_libexecdir}/%{name}/python.d
  620. %defattr(0640,root,netdata,0640)
  621. %{_libdir}/%{name}/conf.d/python.d.conf
  622. %{_libdir}/%{name}/conf.d/python.d
  623. %package plugin-go
  624. Summary: The go.d metrics collection plugin for the Netdata Agent
  625. Group: Applications/System
  626. Requires: netdata = %{version}
  627. Conflicts: netdata < %{version}
  628. %if 0%{?centos_ver} != 7
  629. Suggests: nvme-cli
  630. Suggests: sudo
  631. %endif
  632. %description plugin-go
  633. This plugin adds a selection of additional collectors written in Go to the Netdata Agent
  634. A significant percentage of the application specific collectors provided by Netdata are part of this plugin,
  635. so most users will want it installed.
  636. %files plugin-go
  637. %defattr(0750,root,netdata,0750)
  638. # CAP_NET_ADMIN needed for WireGuard collector
  639. # CAP_NET_RAW needed for ping collector
  640. %caps(cap_net_admin,cap_net_raw=eip) %{_libexecdir}/%{name}/plugins.d/go.d.plugin
  641. %defattr(0644,root,netdata,0644)
  642. %{_libdir}/%{name}/conf.d/go.d.conf
  643. %{_libdir}/%{name}/conf.d/go.d
  644. %package plugin-apps
  645. Summary: The per-application metrics collection plugin for the Netdata Agent
  646. Group: Applications/System
  647. Requires: netdata = %{version}
  648. Conflicts: netdata < %{version}
  649. %description plugin-apps
  650. This plugin allows the Netdata Agent to collect per-application and per-user metrics without using cgroups.
  651. %files plugin-apps
  652. %defattr(0750,root,netdata,0750)
  653. # CAP_DAC_READ_SEARCH and CAP_SYS_PTRACE needed for data collection by the plugin.
  654. %caps(cap_dac_read_search,cap_sys_ptrace=ep) %{_libexecdir}/%{name}/plugins.d/apps.plugin
  655. %defattr(0644,root,netdata,0644)
  656. %{_libdir}/%{name}/conf.d/apps_groups.conf
  657. %package plugin-slabinfo
  658. Summary: The slabinfo metrics collector for the Netdata Agent
  659. Group: Applications/System
  660. Requires: netdata = %{version}
  661. Conflicts: netdata < %{version}
  662. %description plugin-slabinfo
  663. This plugin allows the Netdata Agent to collect perfromance and utilization metrics for the Linux kernel’s SLAB allocator.
  664. %files plugin-slabinfo
  665. %defattr(0750,root,netdata,0750)
  666. # CAP_DAC_READ_SEARCH needed to access the files the plugin reads to collect data.
  667. %caps(cap_dac_read_search=ep) %{_libexecdir}/%{name}/plugins.d/slabinfo.plugin
  668. %package plugin-perf
  669. Summary: The perf metrics collector for the Netdata Agent
  670. Group: Applications/System
  671. Requires: netdata = %{version}
  672. Conflicts: netdata < %{version}
  673. %description plugin-perf
  674. This plugin allows the Netdata to collect metrics from the Linux perf subsystem.
  675. %files plugin-perf
  676. %defattr(0750,root,netdata,0750)
  677. # Either CAP_SYS_ADMIN or CAP_PERFMON needed for data collection
  678. # PERFMON is newer, so only try to use it on platforms which support it.
  679. %if 0%{?centos_ver} >= 9 || 0%{?fedora} >= 36
  680. %caps(cap_perfmon=ep) %{_libexecdir}/%{name}/plugins.d/perf.plugin
  681. %else
  682. %caps(cap_sys_admin=ep) %{_libexecdir}/%{name}/plugins.d/perf.plugin
  683. %endif
  684. %package plugin-debugfs
  685. Summary: The debugfs metrics collector for the Netdata Agent
  686. Group: Applications/System
  687. Requires: netdata = %{version}
  688. Conflicts: netdata < %{version}
  689. %description plugin-debugfs
  690. This plugin allows the Netdata Agent to collect Linux kernel metrics exposed through debugfs.
  691. %files plugin-debugfs
  692. %defattr(0750,root,netdata,0750)
  693. # CAP_DAC_READ_SEARCH required for data collection.
  694. %caps(cap_dac_read_search=ep) %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/debugfs.plugin
  695. %changelog
  696. * Fri Apr 07 2023 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-19
  697. - Split additional plugins out in their own packages.
  698. * Tue Mar 21 2023 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-18
  699. - Fix systemd handling to follow BCP.
  700. - Drop pre-systemd init support.
  701. * Thu Feb 16 2023 Konstantin Shalygin <k0ste@k0ste.ru> 0.0.0-17
  702. - Added eBPF build dependency
  703. * Fri Feb 03 2022 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-16
  704. - Bundle updater script in native packages.
  705. * Mon Oct 11 2021 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-15
  706. - Remove support code for legacy ACLK implementation.
  707. * Wed Sep 16 2020 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-14
  708. - Convert to using 'AutoReq: yes' for library dependencies.
  709. * Thu Feb 13 2020 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-13
  710. - Add handling for custom libmosquitto fork
  711. * Wed Jan 01 2020 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-12
  712. - Add explicit installation of log and cache directories
  713. - Clean up build dependencies.
  714. * Thu Dec 19 2019 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-11
  715. - Fix remaining ownership and permissions issues.
  716. * Mon Nov 04 2019 Konstantinos Natsakis <konstantinos.natsakis@gmail.com> 0.0.0-10
  717. - Fix /etc/netdata permissions
  718. * Mon Sep 23 2019 Konstantinos Natsakis <konstantinos.natsakis@gmail.com> 0.0.0-9
  719. - Do not build CUPS plugin subpackage on CentOS 6 and CentOS 7
  720. * Tue Aug 20 2019 Pavlos Emm. Katsoulakis <paul@netdat.acloud> - 0.0.0-8
  721. - Split CUPS functionality on separate package
  722. * Fri Jun 28 2019 Pavlos Emm. Katsoulakis <paul@netdata.cloud> - 0.0.0-7
  723. - Raise the path overrides to the spec file level, not just the configure.
  724. - Adjust tighter permissions on some folders, based on what we did on our installer
  725. - Introduce go.d plugin download and install, to include it on the package (Temporarily, to become separate package on next iteration)
  726. * Tue Jun 25 2019 Pavlos Emm. Katsoulakis <paul@netdata.cloud> - 0.0.0-6
  727. - Adjust dependency list: Some packages are missing on some distros, adopt to build successfully
  728. * Mon Jun 24 2019 Pavlos Emm. Katsoulakis <paul@netdata.cloud> - 0.0.0-5
  729. Another pass on cleaning up pre/post installation steps
  730. - Sync permission and ownership on files and directories
  731. * Sun Jun 16 2019 Pavlos Emm. Katsoulakis <paul@netdata.cloud> - 0.0.0-4
  732. First draft refactor on package dependencies section
  733. - Remove freeipmi/nfacct plugin flags. We auto-detect all plugins by decision
  734. - Start refactor of package dependencies
  735. - Add missing dependencies, with respect to distro peculiarities
  736. - Adjust existing dependencies, so that distro-specific package names is applied
  737. * Wed Jan 02 2019 Pawel Krupa <pkrupa@redhat.com> - 0.0.0-3
  738. - Temporary set version statically
  739. - Fix changelog ordering
  740. - Comment-out node.d configuration directory
  741. * Wed Jan 02 2019 Pawel Krupa <pkrupa@redhat.com> - 0.0.0-2
  742. - Fix permissions for log files
  743. * Sun Nov 15 2015 Alon Bar-Lev <alonbl@redhat.com> - 0.0.0-1
  744. - Initial add.