netdata.spec.in 31 KB

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