netdata.spec.in 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951
  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. %attr(0755,root,netdata) %{_sysconfdir}/%{name}/edit-config
  429. %attr(0644,root,netdata) %{_sysconfdir}/%{name}/.install-type
  430. %dir %{_sysconfdir}/%{name}/health.d
  431. %dir %{_sysconfdir}/%{name}/statsd.d
  432. %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
  433. %{_libdir}/%{name}
  434. %{_sbindir}/%{name}
  435. %{_sbindir}/netdatacli
  436. %{_sbindir}/netdata-claim.sh
  437. %{_unitdir}/netdata.service
  438. %{_presetdir}/50-netdata.preset
  439. %dir %{_libexecdir}/%{name}
  440. %dir %{_libexecdir}/%{name}/plugins.d
  441. %defattr(0750,root,netdata,0750)
  442. %{_libexecdir}/%{name}/install-service.sh
  443. %{_libexecdir}/%{name}/netdata-updater.sh
  444. %{_libexecdir}/%{name}/netdata-uninstaller.sh
  445. %{_libexecdir}/%{name}/plugins.d/acl.sh
  446. %{_libexecdir}/%{name}/plugins.d/alarm.sh
  447. %{_libexecdir}/%{name}/plugins.d/alarm-email.sh
  448. %{_libexecdir}/%{name}/plugins.d/alarm-notify.sh
  449. %{_libexecdir}/%{name}/plugins.d/alarm-test.sh
  450. %{_libexecdir}/%{name}/plugins.d/anonymous-statistics.sh
  451. %{_libexecdir}/%{name}/plugins.d/cgroup-name.sh
  452. %{_libexecdir}/%{name}/plugins.d/get-kubernetes-labels.sh
  453. %{_libexecdir}/%{name}/plugins.d/health-cmdapi-test.sh
  454. %{_libexecdir}/%{name}/plugins.d/ioping.plugin
  455. %{_libexecdir}/%{name}/plugins.d/loopsleepms.sh.inc
  456. %{_libexecdir}/%{name}/plugins.d/request.sh
  457. %{_libexecdir}/%{name}/plugins.d/system-info.sh
  458. %{_libexecdir}/%{name}/plugins.d/tc-qos-helper.sh
  459. %{_libexecdir}/%{name}/plugins.d/template_dim.sh
  460. # cgroup-network detects the network interfaces of CGROUPs
  461. # it must be able to use setns() and run cgroup-network-helper.sh as root
  462. # the helper script reads /proc/PID/fdinfo/* files, runs virsh, etc.
  463. %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/cgroup-network
  464. %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/cgroup-network-helper.sh
  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. # CUPS belongs to a different sub package
  514. %if 0%{?centos_ver} != 6 && 0%{?centos_ver} != 7
  515. %exclude %{_libexecdir}/%{name}/plugins.d/cups.plugin
  516. %package plugin-cups
  517. Summary: The CUPS metrics collection plugin for the Netdata Agent
  518. Group: Applications/System
  519. Requires: cups >= 1.7
  520. Requires: netdata = %{version}
  521. %description plugin-cups
  522. This plugin allows the Netdata Agent to collect metrics from the Common UNIX Printing System.
  523. %pre plugin-cups
  524. if ! getent group netdata > /dev/null; then
  525. groupadd --system netdata
  526. fi
  527. %files plugin-cups
  528. %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/cups.plugin
  529. %endif
  530. %if 0%{?_have_freeipmi}
  531. %package plugin-freeipmi
  532. Summary: The FreeIPMI metrics collection plugin for the Netdata Agent
  533. Group: Applications/System
  534. Requires: freeipmi
  535. Requires: netdata = %{version}
  536. %description plugin-freeipmi
  537. This plugin allows the Netdata Agent to collect metrics from hardware using FreeIPMI.
  538. %pre plugin-freeipmi
  539. if ! getent group netdata > /dev/null; then
  540. groupadd --system netdata
  541. fi
  542. %files plugin-freeipmi
  543. %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin
  544. %endif
  545. %if 0%{?_have_nfacct}
  546. %package plugin-nfacct
  547. Summary: The NFACCT metrics collection plugin for the Netdata Agent
  548. Group: Applications/System
  549. Requires: netdata = %{version}
  550. Conflicts: netdata < %{version}
  551. %description plugin-nfacct
  552. This plugin allows the Netdata Agent to collect metrics from the firewall using NFACCT objects.
  553. %pre plugin-nfacct
  554. if ! getent group netdata > /dev/null; then
  555. groupadd --system netdata
  556. fi
  557. %files plugin-nfacct
  558. %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/nfacct.plugin
  559. %endif
  560. %package plugin-chartsd
  561. Summary: The charts.d metrics collection plugin for the Netdata Agent
  562. Group: Applications/System
  563. Requires: bash
  564. Requires: netdata = %{version}
  565. Conflicts: netdata < %{version}
  566. %if 0%{?centos_ver} != 7
  567. Suggests: nut
  568. Suggests: apcupsd
  569. Suggests: iw
  570. Suggests: sudo
  571. %endif
  572. %description plugin-chartsd
  573. This plugin adds a selection of additional collectors written in shell script to the Netdata Agent.
  574. It includes collectors for NUT, APCUPSD, LibreSWAN, OpenSIPS, and Wireless access point statistics.
  575. %pre plugin-chartsd
  576. if ! getent group netdata > /dev/null; then
  577. groupadd --system netdata
  578. fi
  579. %files plugin-chartsd
  580. %defattr(0750,root,netdata,0750)
  581. %{_libexecdir}/%{name}/plugins.d/charts.d.plugin
  582. %{_libexecdir}/%{name}/plugins.d/charts.d.dryrun-helper.sh
  583. %{_libexecdir}/%{name}/charts.d/
  584. %defattr(0644,root,netdata,0644)
  585. %{_libdir}/%{name}/conf.d/charts.d.conf
  586. %{_libdir}/%{name}/conf.d/charts.d/
  587. %if 0%{?_have_ebpf}
  588. %package plugin-ebpf
  589. Summary: The eBPF metrics collection plugin for the Netdata Agent
  590. Group: Applications/System
  591. Requires: netdata = %{version}
  592. Conflicts: netdata < %{version}
  593. %if 0%{?centos_ver} != 7
  594. Recommends: netdata-plugin-apps = %{version}
  595. Recommends: netdata-ebpf-legacy-code >= %{version}
  596. %else
  597. Requires: netdata-plugin-apps = %{version}
  598. Requires: netdata-ebpf-legacy-code >= %{version}
  599. %endif
  600. %description plugin-ebpf
  601. This plugin allows the Netdata Agent to use eBPF code to collect more detailed kernel-level metrics for the system.
  602. %pre plugin-ebpf
  603. if ! getent group netdata > /dev/null; then
  604. groupadd --system netdata
  605. fi
  606. %files plugin-ebpf
  607. %defattr(4750,root,netdata,4750)
  608. %{_libexecdir}/%{name}/plugins.d/ebpf.plugin
  609. %defattr(0644,root,netdata,0644)
  610. %{_libdir}/%{name}/conf.d/ebpf.d.conf
  611. %{_libdir}/%{name}/conf.d/ebpf.d
  612. %package ebpf-legacy-code
  613. Summary: Compiled eBPF legacy code for the Netdata eBPF plugin
  614. Group: Applications/System
  615. Requires: netdata-plugin-ebpf = %{version}
  616. Conflicts: netdata < %{version}
  617. %description ebpf-legacy-code
  618. This package provides the pre-compiled eBPF legacy code for use by the Netdata eBPF plugin.
  619. This code is only needed when using the eBPF plugin with kernel versions before 5.10.
  620. %pre ebpf-legacy-code
  621. if ! getent group netdata > /dev/null; then
  622. groupadd --system netdata
  623. fi
  624. %files ebpf-legacy-code
  625. %defattr(0640,root,netdata,0640)
  626. %{_libexecdir}/%{name}/plugins.d/ebpf.d/*.o
  627. %endif
  628. %package plugin-pythond
  629. Summary: The python.d metrics collection plugin for the Netdata Agent
  630. Group: Applications/System
  631. Requires: netdata = %{version}
  632. Conflicts: netdata < %{version}
  633. %if 0%{?centos_ver} == 7 || 0%{?centos_ver} == 6
  634. Requires: python
  635. %else
  636. %if 0%{?centos_ver} == 8
  637. Requires: python38
  638. %else
  639. Requires: python3
  640. %endif
  641. %endif
  642. %if 0%{?centos_ver} != 7
  643. Suggests: sudo
  644. %endif
  645. %description plugin-pythond
  646. This plugin adds a selection of additional collectors written in Python to the Netdata Agent.
  647. Many of the collectors provided by this package are also available in netdata-plugin-go. In msot cases, you probably
  648. want to use those versions instead of the Python versions.
  649. %pre plugin-pythond
  650. if ! getent group netdata > /dev/null; then
  651. groupadd --system netdata
  652. fi
  653. %files plugin-pythond
  654. %defattr(0750,root,netdata,0750)
  655. %{_libexecdir}/%{name}/plugins.d/python.d.plugin
  656. %{_libexecdir}/%{name}/python.d
  657. %defattr(0640,root,netdata,0640)
  658. %{_libdir}/%{name}/conf.d/python.d.conf
  659. %{_libdir}/%{name}/conf.d/python.d
  660. %package plugin-go
  661. Summary: The go.d metrics collection plugin for the Netdata Agent
  662. Group: Applications/System
  663. Requires: netdata = %{version}
  664. Conflicts: netdata < %{version}
  665. %if 0%{?centos_ver} != 7
  666. Suggests: nvme-cli
  667. Suggests: sudo
  668. %endif
  669. %description plugin-go
  670. This plugin adds a selection of additional collectors written in Go to the Netdata Agent
  671. A significant percentage of the application specific collectors provided by Netdata are part of this plugin,
  672. so most users will want it installed.
  673. %pre plugin-go
  674. if ! getent group netdata > /dev/null; then
  675. groupadd --system netdata
  676. fi
  677. %files plugin-go
  678. %defattr(0750,root,netdata,0750)
  679. # CAP_NET_ADMIN needed for WireGuard collector
  680. # CAP_NET_RAW needed for ping collector
  681. %caps(cap_net_admin,cap_net_raw=eip) %{_libexecdir}/%{name}/plugins.d/go.d.plugin
  682. %defattr(0644,root,netdata,0644)
  683. %{_libdir}/%{name}/conf.d/go.d.conf
  684. %{_libdir}/%{name}/conf.d/go.d
  685. %package plugin-apps
  686. Summary: The per-application metrics collection plugin for the Netdata Agent
  687. Group: Applications/System
  688. Requires: netdata = %{version}
  689. Conflicts: netdata < %{version}
  690. %description plugin-apps
  691. This plugin allows the Netdata Agent to collect per-application and per-user metrics without using cgroups.
  692. %pre plugin-apps
  693. if ! getent group netdata > /dev/null; then
  694. groupadd --system netdata
  695. fi
  696. %files plugin-apps
  697. %defattr(0750,root,netdata,0750)
  698. # CAP_DAC_READ_SEARCH and CAP_SYS_PTRACE needed for data collection by the plugin.
  699. %caps(cap_dac_read_search,cap_sys_ptrace=ep) %{_libexecdir}/%{name}/plugins.d/apps.plugin
  700. %defattr(0644,root,netdata,0644)
  701. %{_libdir}/%{name}/conf.d/apps_groups.conf
  702. %package plugin-slabinfo
  703. Summary: The slabinfo metrics collector for the Netdata Agent
  704. Group: Applications/System
  705. Requires: netdata = %{version}
  706. Conflicts: netdata < %{version}
  707. %description plugin-slabinfo
  708. This plugin allows the Netdata Agent to collect perfromance and utilization metrics for the Linux kernel’s SLAB allocator.
  709. %pre plugin-slabinfo
  710. if ! getent group netdata > /dev/null; then
  711. groupadd --system netdata
  712. fi
  713. %files plugin-slabinfo
  714. %defattr(0750,root,netdata,0750)
  715. # CAP_DAC_READ_SEARCH needed to access the files the plugin reads to collect data.
  716. %caps(cap_dac_read_search=ep) %{_libexecdir}/%{name}/plugins.d/slabinfo.plugin
  717. %package plugin-perf
  718. Summary: The perf metrics collector for the Netdata Agent
  719. Group: Applications/System
  720. Requires: netdata = %{version}
  721. Conflicts: netdata < %{version}
  722. %description plugin-perf
  723. This plugin allows the Netdata to collect metrics from the Linux perf subsystem.
  724. %pre plugin-perf
  725. if ! getent group netdata > /dev/null; then
  726. groupadd --system netdata
  727. fi
  728. %files plugin-perf
  729. %defattr(0750,root,netdata,0750)
  730. # Either CAP_SYS_ADMIN or CAP_PERFMON needed for data collection
  731. # PERFMON is newer, so only try to use it on platforms which support it.
  732. %if 0%{?centos_ver} >= 9 || 0%{?fedora} >= 36
  733. %caps(cap_perfmon=ep) %{_libexecdir}/%{name}/plugins.d/perf.plugin
  734. %else
  735. %caps(cap_sys_admin=ep) %{_libexecdir}/%{name}/plugins.d/perf.plugin
  736. %endif
  737. %package plugin-debugfs
  738. Summary: The debugfs metrics collector for the Netdata Agent
  739. Group: Applications/System
  740. Requires: netdata = %{version}
  741. Conflicts: netdata < %{version}
  742. %description plugin-debugfs
  743. This plugin allows the Netdata Agent to collect Linux kernel metrics exposed through debugfs.
  744. %pre plugin-debugfs
  745. if ! getent group netdata > /dev/null; then
  746. groupadd --system netdata
  747. fi
  748. %files plugin-debugfs
  749. %defattr(0750,root,netdata,0750)
  750. # CAP_DAC_READ_SEARCH required for data collection.
  751. %caps(cap_dac_read_search=ep) %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/debugfs.plugin
  752. %changelog
  753. * Wed Jun 14 2023 Konstantin Shalygin <k0ste@k0ste.ru> 0.0.0-20
  754. - Added eBPF build dependency (again)
  755. * Fri Apr 07 2023 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-19
  756. - Split additional plugins out in their own packages.
  757. * Tue Mar 21 2023 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-18
  758. - Fix systemd handling to follow BCP.
  759. - Drop pre-systemd init support.
  760. * Thu Feb 16 2023 Konstantin Shalygin <k0ste@k0ste.ru> 0.0.0-17
  761. - Added eBPF build dependency
  762. * Fri Feb 03 2022 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-16
  763. - Bundle updater script in native packages.
  764. * Mon Oct 11 2021 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-15
  765. - Remove support code for legacy ACLK implementation.
  766. * Wed Sep 16 2020 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-14
  767. - Convert to using 'AutoReq: yes' for library dependencies.
  768. * Thu Feb 13 2020 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-13
  769. - Add handling for custom libmosquitto fork
  770. * Wed Jan 01 2020 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-12
  771. - Add explicit installation of log and cache directories
  772. - Clean up build dependencies.
  773. * Thu Dec 19 2019 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-11
  774. - Fix remaining ownership and permissions issues.
  775. * Mon Nov 04 2019 Konstantinos Natsakis <konstantinos.natsakis@gmail.com> 0.0.0-10
  776. - Fix /etc/netdata permissions
  777. * Mon Sep 23 2019 Konstantinos Natsakis <konstantinos.natsakis@gmail.com> 0.0.0-9
  778. - Do not build CUPS plugin subpackage on CentOS 6 and CentOS 7
  779. * Tue Aug 20 2019 Pavlos Emm. Katsoulakis <paul@netdat.acloud> - 0.0.0-8
  780. - Split CUPS functionality on separate package
  781. * Fri Jun 28 2019 Pavlos Emm. Katsoulakis <paul@netdata.cloud> - 0.0.0-7
  782. - Raise the path overrides to the spec file level, not just the configure.
  783. - Adjust tighter permissions on some folders, based on what we did on our installer
  784. - Introduce go.d plugin download and install, to include it on the package (Temporarily, to become separate package on next iteration)
  785. * Tue Jun 25 2019 Pavlos Emm. Katsoulakis <paul@netdata.cloud> - 0.0.0-6
  786. - Adjust dependency list: Some packages are missing on some distros, adopt to build successfully
  787. * Mon Jun 24 2019 Pavlos Emm. Katsoulakis <paul@netdata.cloud> - 0.0.0-5
  788. Another pass on cleaning up pre/post installation steps
  789. - Sync permission and ownership on files and directories
  790. * Sun Jun 16 2019 Pavlos Emm. Katsoulakis <paul@netdata.cloud> - 0.0.0-4
  791. First draft refactor on package dependencies section
  792. - Remove freeipmi/nfacct plugin flags. We auto-detect all plugins by decision
  793. - Start refactor of package dependencies
  794. - Add missing dependencies, with respect to distro peculiarities
  795. - Adjust existing dependencies, so that distro-specific package names is applied
  796. * Wed Jan 02 2019 Pawel Krupa <pkrupa@redhat.com> - 0.0.0-3
  797. - Temporary set version statically
  798. - Fix changelog ordering
  799. - Comment-out node.d configuration directory
  800. * Wed Jan 02 2019 Pawel Krupa <pkrupa@redhat.com> - 0.0.0-2
  801. - Fix permissions for log files
  802. * Sun Nov 15 2015 Alon Bar-Lev <alonbl@redhat.com> - 0.0.0-1
  803. - Initial add.