netdata.spec.in 32 KB

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