netdata.spec.in 39 KB

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