netdata.spec.in 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174
  1. # SPDX-License-Identifier: GPL-3.0-or-later
  2. %global contentdir %{_datadir}/netdata
  3. %global version @PACKAGE_VERSION@
  4. %global go_version @GO_PACKAGE_VERSION@
  5. %global go_name go.d.plugin
  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. # Use our custom CMake version from our package builders if we can’t find cmake.
  15. %if 0%{?centos_ver} == 7
  16. %global __cmake /cmake/bin/cmake
  17. %global __cmake_builddir .
  18. %global cmake %{__cmake}
  19. %global cmake_build %{__cmake} --build %{__cmake_builddir} --verbose --parallel $(nproc)
  20. %global cmake_install DESTDIR="%{buildroot}" %{__cmake} --install %{__cmake_builddir}
  21. %global _have_ml 0
  22. %endif
  23. %if 0%{?amazon_linux} == 2
  24. %global __cmake /cmake/bin/cmake
  25. %global __cmake_builddir .
  26. %global cmake %{__cmake}
  27. %global cmake_build %{__cmake} --build %{__cmake_builddir} --verbose --parallel $(nproc)
  28. %global cmake_install DESTDIR="%{buildroot}" %{__cmake} --install %{__cmake_builddir}
  29. %global _have_ml 0
  30. %endif
  31. # openSUSE requires us to explicity ask for ninja for builds.
  32. # We also need to specify the build directory since they do not.
  33. %if 0%{?suse_version}
  34. %global __builder ninja
  35. %global __cmake_builddir %{__builddir}
  36. %endif
  37. # Disable go.d.plugin build on outdated golang distros
  38. %if 0
  39. %if 0%{?centos_ver:1}
  40. %if 0%{?centos_ver} >= 10 && 0%{?almalinux_ver:1} && 0%{?rocky_ver:1}
  41. %global _golang_build 1
  42. %else
  43. %global _golang_build 0
  44. %global _missing_build_ids_terminate_build 0
  45. %endif
  46. %endif
  47. %endif
  48. # Disable eBPF for architectures other than x86
  49. %ifarch x86_64 i386
  50. %global _have_ebpf 1
  51. %else
  52. %global _have_ebpf 0
  53. %endif
  54. # Mitigate the cross-distro mayhem by strictly defining the libexec destination
  55. %define _prefix /usr
  56. %define _sysconfdir /etc
  57. %define _localstatedir /var
  58. %define _libexecdir /usr/libexec
  59. %define _libdir /usr/lib
  60. # Fedora doesn’t define this, but other distros do
  61. %{!?_presetdir:%global _presetdir %{_libdir}/systemd/system-preset}
  62. # Redefine centos_ver to standardize on a single macro
  63. %{?rhel:%global centos_ver %rhel}
  64. # Disable FreeIPMI on Amazon Linux 2023 and newer
  65. %if 0%{?amzn} >= 2023
  66. %global _have_freeipmi 0
  67. %else
  68. %global _have_freeipmi 1
  69. %endif
  70. # Disable CUPS on old RHEL systems.
  71. %if 0%{?centos_ver} != 6 && 0%{?centos_ver} != 7 && 0%{?amazon_linux} != 2
  72. %global _have_cups 1
  73. %else
  74. %global _have_cups 0
  75. %endif
  76. # Disable NFACCT for RHEL equivalents and Amazon Linux
  77. %if 0%{?centos_ver} || 0%{?amzn}
  78. %global _have_nfacct 0
  79. %else
  80. %global _have_nfacct 1
  81. %endif
  82. # Disable xenstat if we’re not on Fedora or openSUSE
  83. %if 0%{?suse_version} || 0%{?fedora}
  84. %if 0%{!?amzm:1}
  85. %global _have_xenstat 0
  86. %else
  87. %global _have_xenstat 1
  88. %endif
  89. %else
  90. %global _have_xenstat 0
  91. %endif
  92. # Skip MongoDB exporter on known problem platforms
  93. %if 0%{?oraclelinux} || 0%{?suse_version} || 0%{?amzn}
  94. %global _have_mongo_exporter 0
  95. %else
  96. %global _have_mongo_exporter 1
  97. %endif
  98. # If ML hasn’t been explicitly disabled or enabled yet, enable it now.
  99. %if 0%{!?_have_ml:1}
  100. %global _have_ml 1
  101. %endif
  102. # Filter known bogus deps that would be caught by AutoReqProv.
  103. %global __requires_exclude_from ^%{_libdir}/%{name}/system/.*$
  104. Summary: Real-time performance monitoring, done right!
  105. Name: netdata
  106. Version: %{version}
  107. Release: 1%{?dist}
  108. License: GPLv3+
  109. Group: Applications/System
  110. Source0: https://github.com/%{name}/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz
  111. Source1: https://github.com/%{name}/%{go_name}/releases/download/v%{go_version}/config.tar.gz
  112. Source2: https://github.com/%{name}/%{go_name}/archive/refs/tags/v%{go_version}.tar.gz
  113. URL: http://my-%{name}.io
  114. # Remove conflicting EPEL packages
  115. Obsoletes: %{name}-conf
  116. Obsoletes: %{name}-data
  117. # #####################################################################
  118. # Core build/install/runtime dependencies
  119. # #####################################################################
  120. # Build dependencies
  121. #
  122. BuildRequires: gcc
  123. BuildRequires: gcc-c++
  124. BuildRequires: make
  125. BuildRequires: git-core
  126. BuildRequires: cmake
  127. %if 0%{!?suse_version:1}
  128. BuildRequires: ninja-build
  129. %else
  130. BuildRequires: ninja
  131. %endif
  132. BuildRequires: pkgconfig
  133. BuildRequires: curl
  134. BuildRequires: findutils
  135. BuildRequires: pkgconfig(zlib)
  136. BuildRequires: pkgconfig(uuid)
  137. BuildRequires: pkgconfig(libuv)
  138. BuildRequires: pkgconfig(openssl)
  139. BuildRequires: pkgconfig(libcurl)
  140. BuildRequires: pkgconfig(liblz4)
  141. BuildRequires: pkgconfig(yaml-0.1)
  142. BuildRequires: pkgconfig(json-c)
  143. %if 0%{?suse_version}
  144. # log2journal is not available on these systems
  145. %else
  146. BuildRequires: pkgconfig(libpcre2-8)
  147. %endif
  148. %if 0%{?suse_version}
  149. BuildRequires: protobuf-devel
  150. BuildRequires: libprotobuf-c-devel
  151. %else
  152. %if 0%{?fedora}
  153. BuildRequires: protobuf-devel
  154. BuildRequires: protobuf-c-devel
  155. %else
  156. %if 0%{?centos_ver} >= 8
  157. BuildRequires: protobuf-devel
  158. BuildRequires: protobuf-c-devel
  159. %endif
  160. %endif
  161. %endif
  162. # Core build requirements for service install
  163. %if 0%{?suse_version}
  164. BuildRequires: systemd-rpm-macros
  165. %else
  166. BuildRequires: systemd
  167. %endif
  168. # Core requirements for the install to succeed
  169. Requires(pre): /usr/sbin/groupadd
  170. Requires(pre): /usr/sbin/useradd
  171. # #####################################################################
  172. # External plugin package dependencies
  173. # #####################################################################
  174. # CentOS prior to CentOS 8 does not have a new enough version of RPM
  175. # to support weak dependencies. Explicitly requiring our default plugins
  176. # makes it impossible to properly test the packages prior to upload,
  177. # so we just skip depending on them on CentOS 7.
  178. %if 0%{?_have_ebpf}
  179. Requires: %{name}-plugin-ebpf = %{version}
  180. %endif
  181. Requires: %{name}-plugin-apps = %{version}
  182. Requires: %{name}-plugin-pythond = %{version}
  183. Requires: %{name}-plugin-go = %{version}
  184. Requires: %{name}-plugin-debugfs = %{version}
  185. Requires: %{name}-plugin-chartsd = %{version}
  186. Requires: %{name}-plugin-slabinfo = %{version}
  187. Requires: %{name}-plugin-perf = %{version}
  188. %if %{_have_nfacct}
  189. Requires: %{name}-plugin-nfacct = %{version}
  190. %endif
  191. %if %{_have_xenstat}
  192. Suggests: %{name}-plugin-xenstat = %{version}
  193. %endif
  194. %if %{_have_freeipmi} && 0%{?centos_ver} != 6 && 0%{?centos_ver} != 7 && 0%{?amazon_linux} != 2
  195. Suggests: %{name}-plugin-freeipmi = %{version}
  196. %endif
  197. %if 0%{?centos_ver} != 7 && 0%{?amazon_linux} != 2
  198. %if %{_have_cups}
  199. Suggests: %{name}-plugin-cups = %{version}
  200. %endif
  201. Recommends: %{name}-plugin-systemd-journal = %{version}
  202. Recommends: %{name}-plugin-logs-management = %{version}
  203. %else
  204. Requires: %{name}-plugin-systemd-journal = %{version}
  205. %endif
  206. # #####################################################################
  207. # Functionality-dependent package dependencies
  208. # #####################################################################
  209. # Note: Some or all of the Packages may be found in the EPEL repo,
  210. # rather than the standard ones
  211. # epbf plugin dependencies
  212. %if %{_have_ebpf}
  213. BuildRequires: pkgconfig(libelf)
  214. %endif
  215. # end ebpf plugin dependencies
  216. # nfacct plugin dependencies
  217. %if %{_have_nfacct}
  218. BuildRequires: pkgconfig(libmnl)
  219. BuildRequires: pkgconfig(libnetfilter_acct)
  220. %endif
  221. # end nfacct plugin dependencies
  222. # freeipmi plugin dependencies
  223. %if %{_have_freeipmi}
  224. BuildRequires: pkgconfig(libipmimonitoring)
  225. %endif
  226. # end - freeipmi plugin dependencies
  227. # CUPS plugin dependencies
  228. %if %{_have_cups}
  229. BuildRequires: cups-devel
  230. %endif
  231. # end - cups plugin dependencies
  232. # go.d.plugin dependencies
  233. %if 0%{?_golang_build}
  234. %if 0%{?suse_version}
  235. BuildRequires: go
  236. %else
  237. BuildRequires: golang
  238. %endif
  239. %endif
  240. # end - go.d.plugin plugin dependencies
  241. # systemd-journal dependencies
  242. BuildRequires: pkgconfig(libsystemd)
  243. # end - systemd-journal dependencies
  244. # Prometheus remote write dependencies
  245. %if 0%{?suse_version}
  246. BuildRequires: snappy-devel
  247. %else
  248. %if 0%{?centos_ver} != 7
  249. BuildRequires: pkgconfig(snappy)
  250. %else
  251. BuildRequires: snappy-devel
  252. %endif
  253. %endif
  254. # end - prometheus remote write dependencies
  255. # Xenstat dependencies
  256. %if %{_have_xenstat}
  257. BuildRequires: pkgconfig(xenstat)
  258. BuildRequires: pkgconfig(xenlight)
  259. %endif
  260. # end - xenstat dependencies
  261. # MongoDB exporter dependencies
  262. %if %{_have_mongo_exporter}
  263. BuildRequires: pkgconfig(libmongoc-1.0)
  264. %endif
  265. # end - mongodb expoerter dependencies
  266. # logs-management dependencies
  267. BuildRequires: bison
  268. BuildRequires: flex
  269. # end - logs-management dependencies
  270. # #####################################################################
  271. # End of dependency management configuration
  272. # #####################################################################
  273. %description
  274. netdata is the fastest way to visualize metrics. It is a resource
  275. efficient, highly optimized system for collecting and visualizing any
  276. type of realtime timeseries data, from CPU usage, disk activity, SQL
  277. queries, API calls, web site visitors, etc.
  278. netdata tries to visualize the truth of now, in its greatest detail,
  279. so that you can get insights of what is happening now and what just
  280. happened, on your systems and applications.
  281. %prep
  282. %setup -q -n "%{name}-%{version}"
  283. # Only bundle protobuf on CentOS 7 or earlier
  284. %if 0%{?centos_ver:1}
  285. %if %{centos_ver} < 8
  286. export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-protobuf.sh ${RPM_BUILD_DIR}/%{name}-%{version}
  287. %endif
  288. %endif
  289. %if 0%{?_have_ebpf}
  290. %if 0%{?centos_ver:1}
  291. %if %{centos_ver} < 8
  292. export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-libbpf.sh ${RPM_BUILD_DIR}/%{name}-%{version} centos7
  293. export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-ebpf-co-re.sh ${RPM_BUILD_DIR}/%{name}-%{version}
  294. %else
  295. export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-libbpf.sh ${RPM_BUILD_DIR}/%{name}-%{version} centos8
  296. export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-ebpf-co-re.sh ${RPM_BUILD_DIR}/%{name}-%{version}
  297. %endif
  298. %else
  299. export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-libbpf.sh ${RPM_BUILD_DIR}/%{name}-%{version} other
  300. export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-ebpf-co-re.sh ${RPM_BUILD_DIR}/%{name}-%{version}
  301. %endif
  302. %endif
  303. # go.d.plugin
  304. %if 0%{?_golang_build}
  305. mkdir -p "%{_builddir}/%{go_name}"
  306. tar -xzf "%{SOURCE1}" -C "%{_builddir}/%{go_name}"
  307. tar -xzf "%{SOURCE2}" -C "%{_builddir}/%{go_name}"
  308. cd "%{_builddir}/%{go_name}/%{go_name}-%{go_version}"
  309. make download
  310. %endif
  311. %build
  312. # Conf step
  313. %cmake -G Ninja \
  314. -DCMAKE_INSTALL_PREFIX=/ \
  315. %if %{_have_cups}
  316. -DENABLE_PLUGIN_CUPS=On \
  317. %else
  318. -DENABLE_PLUGIN_CUPS=Off \
  319. %endif
  320. %if %{_have_ebpf}
  321. -DENABLE_PLUGIN_EBPF=On \
  322. %else
  323. -DENABLE_PLUGIN_EBPF=Off \
  324. %endif
  325. %if %{_have_freeipmi}
  326. -DENABLE_PLUGIN_FREEIPMI=On \
  327. %else
  328. -DENABLE_PLUGIN_FREEIPMI=Off \
  329. %endif
  330. %if %{_have_nfacct}
  331. -DENABLE_PLUGIN_NFACCT=On \
  332. %else
  333. -DENABLE_PLUGIN_NFACCT=Off \
  334. %endif
  335. %if %{_have_xenstat}
  336. -DENABLE_PLUGIN_XENSTAT=On \
  337. %else
  338. -DENABLE_PLUGIN_XENSTAT=Off \
  339. %endif
  340. %if 0%{?centos_ver:1}
  341. %if %{centos_ver} < 8
  342. -DENABLE_BUNDLED_PROTOBUF=On \
  343. %else
  344. -DENABLE_BUNDLED_PROTOBUF=Off \
  345. %endif
  346. %else
  347. -DENABLE_BUNDLED_PROTOBUF=Off \
  348. %endif
  349. %if %{_have_ml}
  350. -DENABLE_ML=On \
  351. %else
  352. -DENABLE_ML=Off \
  353. %endif
  354. %if %{_have_mongo_exporter}
  355. -DENABLE_EXPORTER_MONGODB=On \
  356. %else
  357. -DENABLE_EXPORTER_MONGODB=Off \
  358. %endif
  359. -DENABLE_ACLK=On \
  360. -DENABLE_CLOUD=On \
  361. -DENABLE_DBENGINE=On \
  362. -DENABLE_H2O=On \
  363. -DENABLE_PLUGIN_APPS=On \
  364. -DENABLE_PLUGIN_CGROUP_NETWORK=On \
  365. -DENABLE_PLUGIN_DEBUGFS=On \
  366. -DENABLE_PLUGIN_LOCAL_LISTENERS=On \
  367. -DENABLE_PLUGIN_PERF=On \
  368. -DENABLE_PLUGIN_SLABINFO=On \
  369. -DENABLE_PLUGIN_SYSTEMD_JOURNAL=On \
  370. -DENABLE_PLUGIN_LOGS_MANAGEMENT=On \
  371. -DENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE=On \
  372. -DENABLE_BUNDLED_JSONC=Off \
  373. -DENABLE_BUNDLED_YAML=Off
  374. # Build step
  375. %{cmake_build}
  376. # Build go.d.plugin
  377. %if 0%{?_golang_build}
  378. cd "%{_builddir}/%{go_name}/%{go_name}-%{go_version}"
  379. sed -i 's|CGO_ENABLED=0 ||' "hack/go-build.sh"
  380. TRAVIS_TAG="%{go_version}" %{__make} build
  381. %endif
  382. %install
  383. # ###########################################################
  384. # Clear the directory, if already exists and install
  385. rm -rf "${RPM_BUILD_ROOT}"
  386. %{cmake_install}
  387. install -m 644 -p "system/%{name}.conf" "${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}"
  388. # ###########################################################
  389. # Install updater script
  390. install -m 755 -p packaging/installer/%{name}-updater.sh "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/%{name}-updater.sh"
  391. # ###########################################################
  392. # logrotate settings
  393. install -m 755 -d "${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d"
  394. install -m 644 -p "%{__cmake_builddir}/system/logrotate/%{name}" "${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name}"
  395. # ###########################################################
  396. # Install cache and log directories
  397. install -m 755 -d "${RPM_BUILD_ROOT}%{_localstatedir}/cache/%{name}"
  398. install -m 755 -d "${RPM_BUILD_ROOT}%{_localstatedir}/log/%{name}"
  399. # ###########################################################
  400. # Install registry directory
  401. install -m 755 -d "${RPM_BUILD_ROOT}%{_localstatedir}/lib/%{name}/registry"
  402. # ###########################################################
  403. # Install uninstaller script
  404. install -m 750 -p packaging/installer/%{name}-uninstaller.sh \
  405. "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/%{name}-uninstaller.sh"
  406. # ###########################################################
  407. # Install netdata service
  408. install -m 755 -d "${RPM_BUILD_ROOT}%{_unitdir}"
  409. %if 0%{?centos_ver} != 7 && 0%{?amazon_linux} != 2
  410. install -m 644 -p "%{__cmake_builddir}/system/systemd/%{name}.service" "${RPM_BUILD_ROOT}%{_unitdir}/%{name}.service"
  411. %else
  412. install -m 644 -p "%{__cmake_builddir}/system/systemd/%{name}.service.v235" "${RPM_BUILD_ROOT}%{_unitdir}/%{name}.service"
  413. %endif
  414. install -m 755 -d "${RPM_BUILD_ROOT}%{_presetdir}"
  415. install -m 644 -p "system/systemd/50-%{name}.preset" "${RPM_BUILD_ROOT}%{_presetdir}/50-%{name}.preset"
  416. # ############################################################
  417. # Package Go within netdata
  418. # Install builded go.d.plugin
  419. %if 0%{?_golang_build}
  420. install -m 0640 "%{_builddir}/%{go_name}/%{go_name}-%{go_version}/bin/godplugin" \
  421. "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/%{go_name}"
  422. cp -r "%{_builddir}/%{go_name}/go.d.conf" "%{_builddir}/%{go_name}/go.d" \
  423. "${RPM_BUILD_ROOT}%{_libdir}/%{name}/conf.d/"
  424. %else
  425. # Install binary go.d.plugin
  426. safe_sha256sum() {
  427. # Within the context of the installer, we only use -c option that is common between the two commands
  428. # We will have to reconsider if we start non-common options
  429. if command -v sha256sum >/dev/null 2>&1; then
  430. sha256sum $@
  431. elif command -v shasum >/dev/null 2>&1; then
  432. shasum -a 256 $@
  433. else
  434. fatal "I could not find a suitable checksum binary to use"
  435. fi
  436. }
  437. download_go() {
  438. url="${1}"
  439. dest="${2}"
  440. if command -v curl >/dev/null 2>&1; then
  441. curl -sSL --connect-timeout 10 --retry 3 "${url}" > "${dest}"
  442. elif command -v wget >/dev/null 2>&1; then
  443. wget -T 15 -O - "${url}" > "${dest}"
  444. else
  445. echo >&2
  446. echo >&2 "Downloading go.d plugin from '${url}' failed because of missing mandatory packages."
  447. echo >&2 "Either add packages or disable it by issuing '--disable-go' in the installer"
  448. echo >&2
  449. exit 1
  450. fi
  451. }
  452. install_go() {
  453. # When updating this value, ensure correct checksums in packaging/go.d.checksums
  454. GO_PACKAGE_VERSION="$(cat packaging/go.d.version)"
  455. ARCH_MAP=(
  456. 'i386::386'
  457. 'i686::386'
  458. 'x86_64::amd64'
  459. 'aarch64::arm64'
  460. 'armv64::arm64'
  461. 'armv6l::arm'
  462. 'armv7l::arm'
  463. 'armv5tel::arm'
  464. )
  465. if [ -z "${NETDATA_DISABLE_GO+x}" ]; then
  466. ARCH="%{_arch}"
  467. OS=$(uname -s | tr '[:upper:]' '[:lower:]')
  468. echo >&2 "Install go.d.plugin (ARCH=${ARCH}, OS=${OS})"
  469. for index in "${ARCH_MAP[@]}" ; do
  470. KEY="${index%%::*}"
  471. VALUE="${index##*::}"
  472. if [ "$KEY" = "$ARCH" ]; then
  473. ARCH="${VALUE}"
  474. break
  475. fi
  476. done
  477. tmp=$(mktemp -d /tmp/netdata-go-XXXXXX)
  478. GO_PACKAGE_BASENAME="go.d.plugin-${GO_PACKAGE_VERSION}.${OS}-${ARCH}.tar.gz"
  479. download_go "https://github.com/netdata/go.d.plugin/releases/download/${GO_PACKAGE_VERSION}/${GO_PACKAGE_BASENAME}" "${tmp}/${GO_PACKAGE_BASENAME}"
  480. download_go "https://github.com/netdata/go.d.plugin/releases/download/${GO_PACKAGE_VERSION}/config.tar.gz" "${tmp}/config.tar.gz"
  481. if [ ! -f "${tmp}/${GO_PACKAGE_BASENAME}" ] || [ ! -f "${tmp}/config.tar.gz" ] || [ ! -s "${tmp}/config.tar.gz" ] || [ ! -s "${tmp}/${GO_PACKAGE_BASENAME}" ]; then
  482. echo >&2 "Either check the error or consider disabling it by issuing '--disable-go' in the installer"
  483. echo >&2
  484. return 1
  485. fi
  486. grep "${GO_PACKAGE_BASENAME}\$" "packaging/go.d.checksums" > "${tmp}/sha256sums.txt" 2>/dev/null
  487. grep "config.tar.gz" "packaging/go.d.checksums" >> "${tmp}/sha256sums.txt" 2>/dev/null
  488. # Checksum validation
  489. if ! (cd "${tmp}" && safe_sha256sum -c "sha256sums.txt"); then
  490. echo >&2 "go.d plugin checksum validation failure."
  491. echo >&2 "Either check the error or consider disabling it by issuing '--disable-go' in the installer"
  492. echo >&2
  493. echo "go.d.plugin package files checksum validation failed."
  494. exit 1
  495. fi
  496. # Install files
  497. tar -xf "${tmp}/config.tar.gz" -C "${RPM_BUILD_ROOT}%{_libdir}/%{name}/conf.d/"
  498. tar xf "${tmp}/${GO_PACKAGE_BASENAME}"
  499. mv "${GO_PACKAGE_BASENAME/\.tar\.gz/}" "go.d.plugin"
  500. rm -rf "${tmp}"
  501. fi
  502. return 0
  503. }
  504. install_go
  505. install -m 0640 -p "%{go_name}" "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/%{go_name}"
  506. %endif
  507. %if 0%{?_have_ebpf}
  508. ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-ebpf.sh ${RPM_BUILD_DIR}/%{name}-%{version} \
  509. ${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d
  510. %endif
  511. %pre
  512. if ! getent group %{name} > /dev/null; then
  513. groupadd --system %{name}
  514. fi
  515. if ! getent passwd %{name} > /dev/null; then
  516. useradd --system -g %{name} --home %{contentdir} --no-create-home -s /sbin/nologin -c "Netdata pseudo user" %{name}
  517. fi
  518. # I am not sure that the corresponding group names are exactly the same as in Debian, but we should start somewhere, shouldn't we?
  519. for item in docker nginx varnish haproxy adm nsd proxy squid ceph nobody I2C; do
  520. if getent group $item > /dev/null 2>&1; then
  521. usermod -a -G ${item} %{name}
  522. fi
  523. done
  524. %post
  525. %if 0%{?suse_version}
  526. %service_add_post %{name}.service
  527. %else
  528. %systemd_post %{name}.service
  529. %endif
  530. %preun
  531. %if 0%{?suse_version}
  532. %service_del_preun %{name}.service
  533. %else
  534. %systemd_preun %{name}.service
  535. %endif
  536. %postun
  537. %if 0%{?suse_version}
  538. %service_del_postun %{name}.service
  539. %else
  540. %systemd_postun_with_restart %{name}.service
  541. %endif
  542. %clean
  543. rm -rf "${RPM_BUILD_ROOT}"
  544. %files
  545. %doc README.md
  546. %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
  547. %config(noreplace) %{_sysconfdir}/%{name}/%{name}-updater.conf
  548. %attr(0755,root,netdata) %{_sysconfdir}/%{name}/edit-config
  549. %attr(0644,root,netdata) %{_sysconfdir}/%{name}/.install-type
  550. %dir %{_sysconfdir}/%{name}/health.d
  551. %dir %{_sysconfdir}/%{name}/statsd.d
  552. %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
  553. %{_libdir}/%{name}
  554. %{_sbindir}/%{name}
  555. %{_sbindir}/netdatacli
  556. %if 0%{?suse_version}
  557. # log2journal is not available on these systems
  558. %else
  559. %{_sbindir}/log2journal
  560. %endif
  561. %{_sbindir}/systemd-cat-native
  562. %{_sbindir}/%{name}-claim.sh
  563. %{_unitdir}/%{name}.service
  564. %{_presetdir}/50-%{name}.preset
  565. %dir %{_libexecdir}/%{name}
  566. %dir %{_libexecdir}/%{name}/plugins.d
  567. %defattr(0750,root,netdata,0750)
  568. %{_libexecdir}/%{name}/install-service.sh
  569. %{_libexecdir}/%{name}/%{name}-updater.sh
  570. %{_libexecdir}/%{name}/%{name}-uninstaller.sh
  571. %{_libexecdir}/%{name}/plugins.d/acl.sh
  572. %{_libexecdir}/%{name}/plugins.d/alarm.sh
  573. %{_libexecdir}/%{name}/plugins.d/alarm-email.sh
  574. %{_libexecdir}/%{name}/plugins.d/alarm-notify.sh
  575. %{_libexecdir}/%{name}/plugins.d/alarm-test.sh
  576. %{_libexecdir}/%{name}/plugins.d/anonymous-statistics.sh
  577. %{_libexecdir}/%{name}/plugins.d/cgroup-name.sh
  578. %{_libexecdir}/%{name}/plugins.d/get-kubernetes-labels.sh
  579. %{_libexecdir}/%{name}/plugins.d/health-cmdapi-test.sh
  580. %{_libexecdir}/%{name}/plugins.d/ioping.plugin
  581. %{_libexecdir}/%{name}/plugins.d/loopsleepms.sh.inc
  582. %{_libexecdir}/%{name}/plugins.d/request.sh
  583. %{_libexecdir}/%{name}/plugins.d/system-info.sh
  584. %{_libexecdir}/%{name}/plugins.d/tc-qos-helper.sh
  585. %{_libexecdir}/%{name}/plugins.d/template_dim.sh
  586. %{_libexecdir}/%{name}/plugins.d/ebpf_thread_function.sh
  587. # cgroup-network detects the network interfaces of CGROUPs
  588. # it must be able to use setns() and run cgroup-network-helper.sh as root
  589. # the helper script reads /proc/PID/fdinfo/* files, runs virsh, etc.
  590. %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/cgroup-network
  591. %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/cgroup-network-helper.sh
  592. # local-listeners detects the local processes that are listening for connections
  593. %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/local-listeners
  594. # network-viewer.plugin, detects all system sockets and classifies them
  595. %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/network-viewer.plugin
  596. # ndsudo a helper to run privileged commands
  597. %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/ndsudo
  598. # Enforce 0644 for files and 0755 for directories
  599. # for the netdata web directory
  600. %defattr(0644,root,root,0755)
  601. %{_datadir}/%{name}/web
  602. # Enforce 0660 for files and 0770 for directories
  603. # for the netdata lib, cache and log dirs
  604. %defattr(0660,root,netdata,0770)
  605. %attr(0770,netdata,netdata) %dir %{_localstatedir}/cache/%{name}
  606. %attr(0755,netdata,root) %dir %{_localstatedir}/log/%{name}
  607. %attr(0770,netdata,netdata) %dir %{_localstatedir}/lib/%{name}
  608. %attr(0770,netdata,netdata) %dir %{_localstatedir}/lib/%{name}/registry
  609. %attr(0770,netdata,netdata) %dir %{_localstatedir}/lib/%{name}/cloud.d
  610. # Free IPMI belongs to a different sub-package
  611. %if %{_have_freeipmi}
  612. %exclude %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin
  613. %endif
  614. # NFACCT belongs to a different sub-package
  615. %if %{_have_nfacct}
  616. %exclude %{_libexecdir}/%{name}/plugins.d/nfacct.plugin
  617. %endif
  618. # Charts.d belongs to a different sub-package
  619. %exclude %{_libexecdir}/%{name}/plugins.d/charts.d.plugin
  620. %exclude %{_libexecdir}/%{name}/plugins.d/charts.d.dryrun-helper.sh
  621. %exclude %{_libexecdir}/%{name}/charts.d/
  622. %exclude %{_libdir}/%{name}/conf.d/charts.d.conf
  623. %exclude %{_libdir}/%{name}/conf.d/charts.d/
  624. # eBPF belongs to a different sub-package
  625. %if %{_have_ebpf}
  626. %exclude %{_libexecdir}/%{name}/plugins.d/ebpf.plugin
  627. %exclude %{_libdir}/%{name}/conf.d/ebpf.d.conf
  628. %exclude %{_libdir}/%{name}/conf.d/ebpf.d
  629. %exclude %{_libexecdir}/%{name}/plugins.d/ebpf.d
  630. %endif
  631. # Python.d belongs to a different sub-package
  632. %exclude %{_libexecdir}/%{name}/plugins.d/python.d.plugin
  633. %exclude %{_libexecdir}/%{name}/python.d
  634. %exclude %{_libdir}/%{name}/conf.d/python.d.conf
  635. %exclude %{_libdir}/%{name}/conf.d/python.d
  636. # Go.d belongs to a different sub-package
  637. %exclude %{_libexecdir}/%{name}/plugins.d/%{go_name}
  638. %exclude %{_libdir}/%{name}/conf.d/go.d.conf
  639. %exclude %{_libdir}/%{name}/conf.d/go.d
  640. # apps belongs to a different sub-package
  641. %exclude %{_libexecdir}/%{name}/plugins.d/apps.plugin
  642. %exclude %{_libdir}/%{name}/conf.d/apps_groups.conf
  643. # slabinfo belongs to a different sub-package
  644. %exclude %{_libexecdir}/%{name}/plugins.d/slabinfo.plugin
  645. # perf belongs to a different sub-package
  646. %exclude %{_libexecdir}/%{name}/plugins.d/perf.plugin
  647. # systemd-journal belongs to a different sub-package
  648. %exclude %{_libexecdir}/%{name}/plugins.d/systemd-journal.plugin
  649. # xenstat belongs to a different sub-package
  650. %exclude %{_libexecdir}/%{name}/plugins.d/xenstat.plugin
  651. # logs management belongs to a different sub-package
  652. %exclude %{_libexecdir}/%{name}/plugins.d/logs-management.plugin
  653. %exclude %{_libdir}/%{name}/conf.d/logsmanagement.d.conf
  654. %exclude %{_libdir}/%{name}/conf.d/logsmanagement.d
  655. # CUPS belongs to a different sub package
  656. %if %{_have_cups}
  657. %exclude %{_libexecdir}/%{name}/plugins.d/cups.plugin
  658. %package plugin-cups
  659. Summary: The CUPS metrics collection plugin for the Netdata Agent
  660. Group: Applications/System
  661. Requires: %{name} = %{version}
  662. %description plugin-cups
  663. This plugin allows the Netdata Agent to collect metrics from the Common UNIX Printing System.
  664. %pre plugin-cups
  665. if ! getent group %{name} > /dev/null; then
  666. groupadd --system %{name}
  667. fi
  668. %files plugin-cups
  669. %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/cups.plugin
  670. %endif
  671. %if 0%{?_have_freeipmi}
  672. %package plugin-freeipmi
  673. Summary: The FreeIPMI metrics collection plugin for the Netdata Agent
  674. Group: Applications/System
  675. Requires: freeipmi
  676. Requires: %{name} = %{version}
  677. %description plugin-freeipmi
  678. This plugin allows the Netdata Agent to collect metrics from hardware using FreeIPMI.
  679. %pre plugin-freeipmi
  680. if ! getent group %{name} > /dev/null; then
  681. groupadd --system %{name}
  682. fi
  683. %files plugin-freeipmi
  684. %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin
  685. %endif
  686. %if %{_have_nfacct}
  687. %package plugin-nfacct
  688. Summary: The NFACCT metrics collection plugin for the Netdata Agent
  689. Group: Applications/System
  690. Requires: %{name} = %{version}
  691. Conflicts: %{name} < %{version}
  692. %description plugin-nfacct
  693. This plugin allows the Netdata Agent to collect metrics from the firewall using NFACCT objects.
  694. %pre plugin-nfacct
  695. if ! getent group %{name} > /dev/null; then
  696. groupadd --system %{name}
  697. fi
  698. %files plugin-nfacct
  699. %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/nfacct.plugin
  700. %endif
  701. %package plugin-chartsd
  702. Summary: The charts.d metrics collection plugin for the Netdata Agent
  703. Group: Applications/System
  704. Requires: bash
  705. Requires: %{name} = %{version}
  706. Conflicts: %{name} < %{version}
  707. %if 0%{?centos_ver} != 7
  708. Suggests: nut
  709. Suggests: apcupsd
  710. Suggests: iw
  711. Suggests: sudo
  712. %endif
  713. %description plugin-chartsd
  714. This plugin adds a selection of additional collectors written in shell script to the Netdata Agent.
  715. It includes collectors for NUT, APCUPSD, LibreSWAN, OpenSIPS, and Wireless access point statistics.
  716. %pre plugin-chartsd
  717. if ! getent group %{name} > /dev/null; then
  718. groupadd --system %{name}
  719. fi
  720. %files plugin-chartsd
  721. %defattr(0750,root,netdata,0750)
  722. %{_libexecdir}/%{name}/plugins.d/charts.d.plugin
  723. %{_libexecdir}/%{name}/plugins.d/charts.d.dryrun-helper.sh
  724. %{_libexecdir}/%{name}/charts.d/
  725. %defattr(0644,root,netdata,0755)
  726. %{_libdir}/%{name}/conf.d/charts.d.conf
  727. %{_libdir}/%{name}/conf.d/charts.d/
  728. %if 0%{?_have_ebpf}
  729. %package plugin-ebpf
  730. Summary: The eBPF metrics collection plugin for the Netdata Agent
  731. Group: Applications/System
  732. Requires: %{name} = %{version}
  733. Conflicts: %{name} < %{version}
  734. %if 0%{?centos_ver} != 7
  735. Recommends: %{name}-plugin-apps = %{version}
  736. Recommends: %{name}-ebpf-legacy-code >= %{version}
  737. %else
  738. Requires: %{name}-plugin-apps = %{version}
  739. Requires: %{name}-ebpf-legacy-code >= %{version}
  740. %endif
  741. %description plugin-ebpf
  742. This plugin allows the Netdata Agent to use eBPF code to collect more detailed kernel-level metrics for the system.
  743. %pre plugin-ebpf
  744. if ! getent group %{name} > /dev/null; then
  745. groupadd --system %{name}
  746. fi
  747. %files plugin-ebpf
  748. %defattr(4750,root,netdata,4750)
  749. %{_libexecdir}/%{name}/plugins.d/ebpf.plugin
  750. %defattr(0644,root,netdata,0755)
  751. %{_libdir}/%{name}/conf.d/ebpf.d.conf
  752. %{_libdir}/%{name}/conf.d/ebpf.d
  753. %package ebpf-legacy-code
  754. Summary: Compiled eBPF legacy code for the Netdata eBPF plugin
  755. Group: Applications/System
  756. Requires: %{name}-plugin-ebpf = %{version}
  757. Conflicts: %{name} < %{version}
  758. %description ebpf-legacy-code
  759. This package provides the pre-compiled eBPF legacy code for use by the Netdata eBPF plugin.
  760. This code is only needed when using the eBPF plugin with kernel versions before 5.10.
  761. %pre ebpf-legacy-code
  762. if ! getent group %{name} > /dev/null; then
  763. groupadd --system %{name}
  764. fi
  765. %files ebpf-legacy-code
  766. %defattr(0640,root,netdata,0640)
  767. %{_libexecdir}/%{name}/plugins.d/ebpf.d/*.o
  768. %endif
  769. %package plugin-pythond
  770. Summary: The python.d metrics collection plugin for the Netdata Agent
  771. Group: Applications/System
  772. Requires: %{name} = %{version}
  773. Conflicts: %{name} < %{version}
  774. %if 0%{?centos_ver} == 7 || 0%{?centos_ver} == 6
  775. Requires: python
  776. %else
  777. Requires: python3
  778. %endif
  779. %if 0%{?centos_ver} != 7
  780. Suggests: sudo
  781. %endif
  782. %description plugin-pythond
  783. This plugin adds a selection of additional collectors written in Python to the Netdata Agent.
  784. Many of the collectors provided by this package are also available in netdata-plugin-go. In msot cases, you probably
  785. want to use those versions instead of the Python versions.
  786. %pre plugin-pythond
  787. if ! getent group %{name} > /dev/null; then
  788. groupadd --system %{name}
  789. fi
  790. %files plugin-pythond
  791. %defattr(0750,root,netdata,0750)
  792. %{_libexecdir}/%{name}/plugins.d/python.d.plugin
  793. %{_libexecdir}/%{name}/python.d
  794. %defattr(0644,root,netdata,0755)
  795. %{_libdir}/%{name}/conf.d/python.d.conf
  796. %{_libdir}/%{name}/conf.d/python.d
  797. %package plugin-go
  798. Summary: The go.d metrics collection plugin for the Netdata Agent
  799. Group: Applications/System
  800. Requires: %{name} = %{version}
  801. Conflicts: %{name} < %{version}
  802. %if 0%{?centos_ver} != 7
  803. Suggests: nvme-cli
  804. Suggests: sudo
  805. %endif
  806. %description plugin-go
  807. This plugin adds a selection of additional collectors written in Go to the Netdata Agent
  808. A significant percentage of the application specific collectors provided by Netdata are part of this plugin,
  809. so most users will want it installed.
  810. %pre plugin-go
  811. if ! getent group %{name} > /dev/null; then
  812. groupadd --system %{name}
  813. fi
  814. %files plugin-go
  815. %defattr(0750,root,netdata,0750)
  816. # CAP_NET_ADMIN needed for WireGuard collector
  817. # CAP_NET_RAW needed for ping collector
  818. %caps(cap_dac_read_search,cap_net_admin,cap_net_raw=eip) %{_libexecdir}/%{name}/plugins.d/%{go_name}
  819. %defattr(0644,root,netdata,0755)
  820. %{_libdir}/%{name}/conf.d/go.d.conf
  821. %{_libdir}/%{name}/conf.d/go.d
  822. %package plugin-apps
  823. Summary: The per-application metrics collection plugin for the Netdata Agent
  824. Group: Applications/System
  825. Requires: %{name} = %{version}
  826. Conflicts: %{name} < %{version}
  827. %description plugin-apps
  828. This plugin allows the Netdata Agent to collect per-application and per-user metrics without using cgroups.
  829. %pre plugin-apps
  830. if ! getent group %{name} > /dev/null; then
  831. groupadd --system %{name}
  832. fi
  833. %files plugin-apps
  834. %defattr(0750,root,netdata,0750)
  835. # CAP_DAC_READ_SEARCH and CAP_SYS_PTRACE needed for data collection by the plugin.
  836. %caps(cap_dac_read_search,cap_sys_ptrace=ep) %{_libexecdir}/%{name}/plugins.d/apps.plugin
  837. %defattr(0644,root,netdata,0755)
  838. %{_libdir}/%{name}/conf.d/apps_groups.conf
  839. %package plugin-slabinfo
  840. Summary: The slabinfo metrics collector for the Netdata Agent
  841. Group: Applications/System
  842. Requires: %{name} = %{version}
  843. Conflicts: %{name} < %{version}
  844. %description plugin-slabinfo
  845. This plugin allows the Netdata Agent to collect perfromance and utilization metrics for the Linux kernel’s SLAB allocator.
  846. %pre plugin-slabinfo
  847. if ! getent group %{name} > /dev/null; then
  848. groupadd --system %{name}
  849. fi
  850. %files plugin-slabinfo
  851. %defattr(0750,root,netdata,0750)
  852. # CAP_DAC_READ_SEARCH needed to access the files the plugin reads to collect data.
  853. %caps(cap_dac_read_search=ep) %{_libexecdir}/%{name}/plugins.d/slabinfo.plugin
  854. %package plugin-perf
  855. Summary: The perf metrics collector for the Netdata Agent
  856. Group: Applications/System
  857. Requires: %{name} = %{version}
  858. Conflicts: %{name} < %{version}
  859. %description plugin-perf
  860. This plugin allows the Netdata to collect metrics from the Linux perf subsystem.
  861. %pre plugin-perf
  862. if ! getent group %{name} > /dev/null; then
  863. groupadd --system %{name}
  864. fi
  865. %files plugin-perf
  866. %defattr(0750,root,netdata,0750)
  867. # Either CAP_SYS_ADMIN or CAP_PERFMON needed for data collection
  868. # PERFMON is newer, so only try to use it on platforms which support it.
  869. %if 0%{?centos_ver} >= 9 || 0%{?fedora} >= 36
  870. %caps(cap_perfmon=ep) %{_libexecdir}/%{name}/plugins.d/perf.plugin
  871. %else
  872. %caps(cap_sys_admin=ep) %{_libexecdir}/%{name}/plugins.d/perf.plugin
  873. %endif
  874. %package plugin-debugfs
  875. Summary: The debugfs metrics collector for the Netdata Agent
  876. Group: Applications/System
  877. Requires: %{name} = %{version}
  878. Conflicts: %{name} < %{version}
  879. %description plugin-debugfs
  880. This plugin allows the Netdata Agent to collect Linux kernel metrics exposed through debugfs.
  881. %pre plugin-debugfs
  882. if ! getent group %{name} > /dev/null; then
  883. groupadd --system %{name}
  884. fi
  885. %files plugin-debugfs
  886. %defattr(0750,root,netdata,0750)
  887. # CAP_DAC_READ_SEARCH required for data collection.
  888. %caps(cap_dac_read_search=ep) %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/debugfs.plugin
  889. %package plugin-systemd-journal
  890. Summary: The systemd-journal plugin for the Netdata Agent
  891. Group: Applications/System
  892. Requires: %{name} = %{version}
  893. Conflicts: %{name} < %{version}
  894. %description plugin-systemd-journal
  895. This plugin allows the Netdata Agent to present entries from the systemd
  896. journal on Netdata Cloud or the local Agent Dashboard.
  897. %pre plugin-systemd-journal
  898. if ! getent group %{name} > /dev/null; then
  899. groupadd --system %{name}
  900. fi
  901. %files plugin-systemd-journal
  902. %defattr(0750,root,netdata,0750)
  903. # CAP_DAC_READ_SEARCH required for data collection.
  904. %caps(cap_dac_read_search=ep) %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/systemd-journal.plugin
  905. %if %{_have_xenstat}
  906. %package plugin-xenstat
  907. Summary: The xenstat plugin for the Netdata Agent
  908. Group: Applications/System
  909. Requires: %{name} = %{version}
  910. Conflicts: %{name} < %{version}
  911. %description plugin-xenstat
  912. This plugin allows Netdata to collect metrics from the Xen Hypervisor.
  913. %pre plugin-xenstat
  914. if ! getent group %{name} > /dev/null; then
  915. groupadd --system %{name}
  916. fi
  917. %files plugin-xenstat
  918. %defattr(0750,root,netdata,0750)
  919. # SUID needed for data collection
  920. %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/xenstat.plugin
  921. %endif
  922. %package plugin-logs-management
  923. Summary: The logs-management plugin for the Netdata Agent
  924. Group: Applications/System
  925. Requires: %{name} = %{version}
  926. Conflicts: %{name} < %{version}
  927. %description plugin-logs-management
  928. This plugin allows the Netdata Agent to collect logs from the system
  929. and parse them to extract metrics.
  930. %pre plugin-logs-management
  931. if ! getent group %{name} > /dev/null; then
  932. groupadd --system %{name}
  933. fi
  934. %files plugin-logs-management
  935. %defattr(0644,root,netdata,0755)
  936. %{_libdir}/%{name}/conf.d/logsmanagement.d.conf
  937. %{_libdir}/%{name}/conf.d/logsmanagement.d
  938. %defattr(0750,root,netdata,0750)
  939. # CAP_DAC_READ_SEARCH and CAP_SYSLOG needed for data collection.
  940. %caps(cap_dac_read_search,cap_syslog=ep) %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/logs-management.plugin
  941. %changelog
  942. * Thu Oct 26 2023 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-24
  943. - Add package for logs-management plugin
  944. * Tue Sep 19 2023 Austin hemmelgarn <austin@netdata.cloud> 0.0.0-24
  945. - Switch to using cmake for builds.
  946. * Mon Aug 28 2023 Konstantin Shalygin <k0ste@k0ste.ru> 0.0.0-23
  947. - Build go.d.plugin natively for CentOS Stream distro
  948. * Mon Aug 21 2023 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-22
  949. - Explicitly depend on version-matched plugins in native packages
  950. * Thu Aug 03 2023 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-21
  951. - Added systemd-journal plugin handling
  952. * Wed Jun 14 2023 Konstantin Shalygin <k0ste@k0ste.ru> 0.0.0-20
  953. - Added eBPF build dependency (again)
  954. * Fri Apr 07 2023 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-19
  955. - Split additional plugins out in their own packages.
  956. * Tue Mar 21 2023 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-18
  957. - Fix systemd handling to follow BCP.
  958. - Drop pre-systemd init support.
  959. * Thu Feb 16 2023 Konstantin Shalygin <k0ste@k0ste.ru> 0.0.0-17
  960. - Added eBPF build dependency
  961. * Thu Feb 03 2022 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-16
  962. - Bundle updater script in native packages.
  963. * Mon Oct 11 2021 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-15
  964. - Remove support code for legacy ACLK implementation.
  965. * Wed Sep 16 2020 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-14
  966. - Convert to using 'AutoReq: yes' for library dependencies.
  967. * Thu Feb 13 2020 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-13
  968. - Add handling for custom libmosquitto fork
  969. * Wed Jan 01 2020 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-12
  970. - Add explicit installation of log and cache directories
  971. - Clean up build dependencies.
  972. * Thu Dec 19 2019 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-11
  973. - Fix remaining ownership and permissions issues.
  974. * Mon Nov 04 2019 Konstantinos Natsakis <konstantinos.natsakis@gmail.com> 0.0.0-10
  975. - Fix /etc/netdata permissions
  976. * Mon Sep 23 2019 Konstantinos Natsakis <konstantinos.natsakis@gmail.com> 0.0.0-9
  977. - Do not build CUPS plugin subpackage on CentOS 6 and CentOS 7
  978. * Tue Aug 20 2019 Pavlos Emm. Katsoulakis <paul@netdat.acloud> - 0.0.0-8
  979. - Split CUPS functionality on separate package
  980. * Fri Jun 28 2019 Pavlos Emm. Katsoulakis <paul@netdata.cloud> - 0.0.0-7
  981. - Raise the path overrides to the spec file level, not just the configure.
  982. - Adjust tighter permissions on some folders, based on what we did on our installer
  983. - Introduce go.d plugin download and install, to include it on the package (Temporarily, to become separate package on next iteration)
  984. * Tue Jun 25 2019 Pavlos Emm. Katsoulakis <paul@netdata.cloud> - 0.0.0-6
  985. - Adjust dependency list: Some packages are missing on some distros, adopt to build successfully
  986. * Mon Jun 24 2019 Pavlos Emm. Katsoulakis <paul@netdata.cloud> - 0.0.0-5
  987. Another pass on cleaning up pre/post installation steps
  988. - Sync permission and ownership on files and directories
  989. * Sun Jun 16 2019 Pavlos Emm. Katsoulakis <paul@netdata.cloud> - 0.0.0-4
  990. First draft refactor on package dependencies section
  991. - Remove freeipmi/nfacct plugin flags. We auto-detect all plugins by decision
  992. - Start refactor of package dependencies
  993. - Add missing dependencies, with respect to distro peculiarities
  994. - Adjust existing dependencies, so that distro-specific package names is applied
  995. * Wed Jan 02 2019 Pawel Krupa <pkrupa@redhat.com> - 0.0.0-3
  996. - Temporary set version statically
  997. - Fix changelog ordering
  998. - Comment-out node.d configuration directory
  999. * Wed Jan 02 2019 Pawel Krupa <pkrupa@redhat.com> - 0.0.0-2
  1000. - Fix permissions for log files
  1001. * Sun Nov 15 2015 Alon Bar-Lev <alonbl@redhat.com> - 0.0.0-1
  1002. - Initial add.