CMakeLists.txt 104 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923
  1. # SPDX-License-Identifier: GPL-3.0-or-later
  2. cmake_minimum_required(VERSION 3.13.0...3.28)
  3. #
  4. # version atrocities
  5. #
  6. find_package(Git)
  7. if(GIT_EXECUTABLE)
  8. execute_process(COMMAND ${GIT_EXECUTABLE} describe
  9. WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
  10. RESULT_VARIABLE GIT_DESCRIBE_RESULT
  11. OUTPUT_VARIABLE GIT_DESCRIBE_OUTPUT)
  12. if(GIT_DESCRIBE_RESULT)
  13. file(STRINGS packaging/version GIT_DESCRIBE_OUTPUT)
  14. message(WARNING "using version from packaging/version: '${GIT_DESCRIBE_OUTPUT}'")
  15. endif()
  16. else()
  17. file(STRINGS packaging/version GIT_DESCRIBE_OUTPUT)
  18. message(WARNING "using version from packaging/version: '${GIT_DESCRIBE_OUTPUT}'")
  19. endif()
  20. string(STRIP ${GIT_DESCRIBE_OUTPUT} GIT_DESCRIBE_OUTPUT)
  21. string(REGEX MATCH "v?([0-9]+)\\.([0-9]+)\\.([0-9]+)-?([0-9]+)?-?([0-9a-zA-Z]+)?" MATCHES "${GIT_DESCRIBE_OUTPUT}")
  22. if(CMAKE_MATCH_COUNT EQUAL 3)
  23. set(FIELD_MAJOR ${CMAKE_MATCH_1})
  24. set(FIELD_MINOR ${CMAKE_MATCH_2})
  25. set(FIELD_PATCH ${CMAKE_MATCH_3})
  26. set(FIELD_TWEAK 0)
  27. set(FIELD_DESCR "N/A")
  28. elseif(CMAKE_MATCH_COUNT EQUAL 4)
  29. set(FIELD_MAJOR ${CMAKE_MATCH_1})
  30. set(FIELD_MINOR ${CMAKE_MATCH_2})
  31. set(FIELD_PATCH ${CMAKE_MATCH_3})
  32. set(FIELD_TWEAK ${CMAKE_MATCH_4})
  33. set(FIELD_DESCR "N/A")
  34. elseif(CMAKE_MATCH_COUNT EQUAL 5)
  35. set(FIELD_MAJOR ${CMAKE_MATCH_1})
  36. set(FIELD_MINOR ${CMAKE_MATCH_2})
  37. set(FIELD_PATCH ${CMAKE_MATCH_3})
  38. set(FIELD_TWEAK ${CMAKE_MATCH_4})
  39. set(FIELD_DESCR ${CMAKE_MATCH_5})
  40. else()
  41. message(FATAL_ERROR "Wrong version regex match count ${CMAKE_MATCH_COUNT} (should be in 3, 4 or 5)")
  42. endif()
  43. set(NETDATA_VERSION ${FIELD_MAJOR}.${FIELD_MINOR}.${FIELD_PATCH}.${FIELD_TWEAK})
  44. #
  45. # project
  46. #
  47. project(netdata
  48. VERSION ${NETDATA_VERSION}
  49. HOMEPAGE_URL "https://www.netdata.cloud"
  50. LANGUAGES C CXX)
  51. list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/packaging/cmake/Modules")
  52. include(CMakeDependentOption)
  53. find_package(PkgConfig REQUIRED)
  54. set(CMAKE_C_STANDARD 11)
  55. set(CMAKE_CXX_STANDARD 14)
  56. set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "netdata")
  57. option(USE_CXX_11 "Use C++11 instead of C++14 (should only be used on legacy systems that cannot support C++14, may disable some features)" False)
  58. mark_as_advanced(USE_CXX_11)
  59. if(USE_CXX_11)
  60. set(CMAKE_CXX_STANDARD 11)
  61. endif()
  62. set(CMAKE_C_STANDARD_REQUIRED On)
  63. set(CMAKE_CXX_STANDARD_REQUIRED On)
  64. set(SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
  65. if(NOT CMAKE_BUILD_TYPE)
  66. set(CMAKE_BUILD_TYPE "Release")
  67. endif()
  68. include(NetdataCompilerFlags)
  69. set(CMAKE_EXPORT_COMPILE_COMMANDS On)
  70. # Check for the mold linker and try to use it if available
  71. option(USE_MOLD "If the MOLD linker is available on the system, use it instead of the default linker." TRUE)
  72. if(USE_MOLD)
  73. message(CHECK_START "Searching for MOLD linker")
  74. find_program(MOLD_LINKER NAMES ld.mold mold)
  75. if(MOLD_LINKER)
  76. execute_process(COMMAND ${MOLD_LINKER} --version
  77. RESULT_VARIABLE MOLD_VERSION_RESULT
  78. OUTPUT_VARIABLE MOLD_VERSION)
  79. if(NOT MOLD_VERSION_RESULT)
  80. string(REPLACE "\n" "" MOLD_VERSION "${MOLD_VERSION}")
  81. message(CHECK_PASS "found (version: ${MOLD_VERSION})")
  82. message(STATUS "Using mold instead of the system default for linking.")
  83. add_compile_options("-fuse-ld=mold")
  84. add_link_options("-fuse-ld=mold")
  85. else()
  86. message(CHECK_FAIL "failed")
  87. endif()
  88. else()
  89. message(CHECK_FAIL "failed")
  90. endif()
  91. endif()
  92. set(CONFIG_H_DIR ${CMAKE_BINARY_DIR})
  93. set(CONFIG_H ${CONFIG_H_DIR}/config.h)
  94. # This is intended to make life easier for developers who are working on one
  95. # specific feature.
  96. option(DEFAULT_FEATURE_STATE "Specify the default state for most optional features" True)
  97. mark_as_advanced(DEFAULT_FEATURE_STATE)
  98. # High-level features
  99. option(ENABLE_ACLK "Enable Netdata Cloud support (ACLK)" ${DEFAULT_FEATURE_STATE})
  100. option(ENABLE_CLOUD "Enable Netdata Cloud by default at runtime" ${DEFAULT_FEATURE_STATE})
  101. option(ENABLE_ML "Enable machine learning features" ${DEFAULT_FEATURE_STATE})
  102. option(ENABLE_DBENGINE "Enable dbengine metrics storage" True)
  103. # Data collection plugins
  104. option(ENABLE_PLUGIN_APPS "Enable per-process resource usage monitoring" ${DEFAULT_FEATURE_STATE})
  105. option(ENABLE_PLUGIN_CGROUP_NETWORK "Enable Linux CGroup network usage monitoring" ${DEFAULT_FEATURE_STATE})
  106. option(ENABLE_PLUGIN_CUPS "Enable CUPS monitoring" ${DEFAULT_FEATURE_STATE})
  107. option(ENABLE_PLUGIN_DEBUGFS "Enable Linux DebugFS metric collection" ${DEFAULT_FEATURE_STATE})
  108. option(ENABLE_PLUGIN_EBPF "Enable Linux eBPF metric collection" ${DEFAULT_FEATURE_STATE})
  109. cmake_dependent_option(ENABLE_LEGACY_EBPF_PROGRAMS "Enable eBPF programs for kernels without BTF support" True ENABLE_PLUGIN_EBPF False)
  110. mark_as_advanced(ENABLE_LEGACY_EBPF_PROGRAMS)
  111. option(ENABLE_PLUGIN_FREEIPMI "Enable IPMI monitoring" ${DEFAULT_FEATURE_STATE})
  112. option(ENABLE_PLUGIN_GO "Enable metric collectors written in Go" ${DEFAULT_FEATURE_STATE})
  113. option(ENABLE_PLUGIN_LOCAL_LISTENERS "Enable local listening socket tracking (including service auto-discovery support)" ${DEFAULT_FEATURE_STATE})
  114. option(ENABLE_PLUGIN_LOGS_MANAGEMENT "Enable log collection and monitoring based on Fluent Bit" ${DEFAULT_FEATURE_STATE})
  115. option(ENABLE_PLUGIN_NETWORK_VIEWER "Enable network viewer functionality" ${DEFAULT_FEATURE_STATE})
  116. option(ENABLE_PLUGIN_NFACCT "Enable Linux NFACCT metric collection" ${DEFAULT_FEATURE_STATE})
  117. option(ENABLE_PLUGIN_PERF "Enable Linux performance counter monitoring" ${DEFAULT_FEATURE_STATE})
  118. option(ENABLE_PLUGIN_SLABINFO "Enable Linux kernel SLAB allocator monitoring" ${DEFAULT_FEATURE_STATE})
  119. option(ENABLE_PLUGIN_SYSTEMD_JOURNAL "Enable systemd journal log collection" ${DEFAULT_FEATURE_STATE})
  120. option(ENABLE_PLUGIN_XENSTAT "Enable Xen domain monitoring" ${DEFAULT_FEATURE_STATE})
  121. # Metrics exporters
  122. option(ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE "Enable exporting to Prometheus via remote write API" ${DEFAULT_FEATURE_STATE})
  123. option(ENABLE_EXPORTER_MONGODB "Enable exporting to MongoDB" ${DEFAULT_FEATURE_STATE})
  124. # Vendoring
  125. option(ENABLE_BUNDLED_JSONC "Force use of a vendored copy of JSON-C" False)
  126. option(ENABLE_BUNDLED_YAML "Force use of a vendored copy of libyaml" False)
  127. option(ENABLE_BUNDLED_PROTOBUF "Use a vendored copy of protobuf" False)
  128. # Optional test code
  129. cmake_dependent_option(ENABLE_LOGS_MANAGEMENT_TESTS "Enable test code for logs-management plugin." True "NOT ENABLE_PLUGIN_LOGS_MANAGEMENT" False)
  130. mark_as_advanced(ENABLE_LOGS_MANAGEMENT_TESTS)
  131. # Experimental features
  132. option(ENABLE_WEBRTC "Enable WebRTC dashboard communications (experimental)" False)
  133. mark_as_advanced(ENABLE_WEBRTC)
  134. option(ENABLE_H2O "Enable H2O web server (experimental)" True)
  135. mark_as_advanced(ENABLE_H2O)
  136. # Other optional functionality
  137. option(ENABLE_SENTRY "Build with Sentry Native crash reporting" False)
  138. mark_as_advanced(ENABLE_SENTRY)
  139. option(BUILD_FOR_PACKAGING "Include component files for native packages" False)
  140. mark_as_advanced(BUILD_FOR_PACKAGING)
  141. cmake_dependent_option(FORCE_LEGACY_LIBBPF "Force usage of libbpf 0.0.9 instead of the latest version." False "ENABLE_PLUGIN_EBPF" False)
  142. mark_as_advanced(FORCE_LEGACY_LIBBPF)
  143. if(ENABLE_ACLK OR ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE)
  144. set(NEED_PROTOBUF True)
  145. else()
  146. set(NEED_PROTOBUF False)
  147. endif()
  148. if(ENABLE_PLUGIN_GO)
  149. include(NetdataGoTools)
  150. find_min_go_version("${CMAKE_SOURCE_DIR}/src/go")
  151. find_package(Go "${MIN_GO_VERSION}" REQUIRED)
  152. endif()
  153. if(ENABLE_WEBRTC)
  154. include(FetchContent)
  155. # ignore debhelper
  156. set(FETCHCONTENT_FULLY_DISCONNECTED Off)
  157. set(PREFER_SYSTEM_LIB True)
  158. set(NO_MEDIA True)
  159. set(NO_WEBSOCKET True)
  160. set(HAVE_LIBDATACHANNEL True)
  161. FetchContent_Declare(libdatachannel
  162. GIT_REPOSITORY https://github.com/paullouisageneau/libdatachannel.git
  163. GIT_TAG v0.20.1
  164. )
  165. FetchContent_MakeAvailable(libdatachannel)
  166. endif()
  167. if(NEED_PROTOBUF)
  168. include(NetdataProtobuf)
  169. if(ENABLE_BUNDLED_PROTOBUF)
  170. netdata_bundle_protobuf()
  171. endif()
  172. endif()
  173. #
  174. # detect OS
  175. #
  176. set(LINUX False)
  177. set(FREEBSD False)
  178. set(MACOS False)
  179. if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
  180. set(MACOS True)
  181. set(COMPILED_FOR_MACOS True)
  182. find_library(IOKIT IOKit)
  183. find_library(FOUNDATION Foundation)
  184. elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
  185. set(FREEBSD True)
  186. set(COMPILED_FOR_FREEBSD True)
  187. else()
  188. set(LINUX True)
  189. set(COMPILED_FOR_LINUX True)
  190. add_definitions(-D_GNU_SOURCE)
  191. endif()
  192. if(ENABLE_PLUGIN_EBPF)
  193. include(NetdataLibBPF)
  194. include(NetdataEBPFCORE)
  195. if(NOT LINUX)
  196. message(FATAL_ERROR "The eBPF plugin is not supported on non-Linux systems")
  197. endif()
  198. netdata_bundle_libbpf()
  199. netdata_fetch_ebpf_co_re()
  200. endif()
  201. #
  202. # Libm
  203. #
  204. # checks link with cmake required libs
  205. cmake_policy(SET CMP0075 NEW)
  206. include(CheckFunctionExists)
  207. check_function_exists(log10 HAVE_LOG10)
  208. if(NOT HAVE_LOG10)
  209. unset(HAVE_LOG10 CACHE)
  210. list(APPEND CMAKE_REQUIRED_LIBRARIES m)
  211. check_function_exists(log10 HAVE_LOG10)
  212. if(HAVE_LOG10)
  213. set(LINK_LIBM True)
  214. else()
  215. message(FATAL_ERROR "Can not use log10 with/without libm.")
  216. endif()
  217. endif()
  218. #
  219. # Custom Modules
  220. #
  221. include(NetdataJSONC)
  222. include(NetdataYAML)
  223. if(ENABLE_LEGACY_EBPF_PROGRAMS)
  224. include(NetdataEBPFLegacy)
  225. endif()
  226. if(ENABLE_SENTRY)
  227. include(NetdataSentry)
  228. endif()
  229. #
  230. # Checks from custom modules
  231. #
  232. netdata_detect_jsonc()
  233. netdata_detect_libyaml()
  234. if(ENABLE_LEGACY_EBPF_PROGRAMS)
  235. netdata_fetch_legacy_ebpf_code()
  236. endif()
  237. if(ENABLE_SENTRY)
  238. netdata_bundle_sentry()
  239. endif()
  240. #
  241. # check include files
  242. #
  243. include(CheckIncludeFile)
  244. check_include_file("netinet/in.h" HAVE_NETINET_IN_H)
  245. check_include_file("resolv.h" HAVE_RESOLV_H)
  246. check_include_file("netdb.h" HAVE_NETDB_H)
  247. check_include_file("sys/prctl.h" HAVE_SYS_PRCTL_H)
  248. check_include_file("sys/stat.h" HAVE_SYS_STAT_H)
  249. check_include_file("sys/vfs.h" HAVE_SYS_VFS_H)
  250. check_include_file("sys/statfs.h" HAVE_SYS_STATFS_H)
  251. check_include_file("linux/magic.h" HAVE_LINUX_MAGIC_H)
  252. check_include_file("sys/mount.h" HAVE_SYS_MOUNT_H)
  253. check_include_file("sys/statvfs.h" HAVE_SYS_STATVFS_H)
  254. check_include_file("inttypes.h" HAVE_INTTYPES_H)
  255. check_include_file("stdint.h" HAVE_STDINT_H)
  256. check_include_file("sys/capability.h" HAVE_SYS_CAPABILITY_H)
  257. #
  258. # check symbols
  259. #
  260. include(CheckSymbolExists)
  261. check_symbol_exists(major "sys/sysmacros.h" MAJOR_IN_SYSMACROS)
  262. check_symbol_exists(major "sys/mkdev.h" MAJOR_IN_MKDEV)
  263. check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME)
  264. check_symbol_exists(strerror_r "string.h" HAVE_STRERROR_R)
  265. check_symbol_exists(finite "math.h" HAVE_FINITE)
  266. check_symbol_exists(isfinite "math.h" HAVE_ISFINITE)
  267. check_symbol_exists(dlsym "dlfcn.h" HAVE_DLSYM)
  268. check_function_exists(nice HAVE_NICE)
  269. check_function_exists(recvmmsg HAVE_RECVMMSG)
  270. check_function_exists(getpriority HAVE_GETPRIORITY)
  271. check_function_exists(sched_getscheduler HAVE_SCHED_GETSCHEDULER)
  272. check_function_exists(sched_setscheduler HAVE_SCHED_SETSCHEDULER)
  273. check_function_exists(sched_get_priority_min HAVE_SCHED_GET_PRIORITY_MIN)
  274. check_function_exists(sched_get_priority_max HAVE_SCHED_GET_PRIORITY_MAX)
  275. check_function_exists(close_range HAVE_CLOSE_RANGE)
  276. check_function_exists(backtrace HAVE_BACKTRACE)
  277. #
  278. # check source compilation
  279. #
  280. include(CheckCSourceCompiles)
  281. include(CheckCXXSourceCompiles)
  282. set(CMAKE_REQUIRED_LIBRARIES pthread)
  283. check_c_source_compiles("
  284. #define _GNU_SOURCE
  285. #include <pthread.h>
  286. int main() {
  287. char name[16];
  288. pthread_t thread = pthread_self();
  289. return pthread_getname_np(thread, name, sizeof(name));
  290. }
  291. " HAVE_PTHREAD_GETNAME_NP)
  292. check_c_source_compiles("
  293. #include <stdio.h>
  294. #define mytype(X) _Generic((X), int: 'i', float: 'f', default: 'u')
  295. int main() {
  296. char type = mytype(0);
  297. return 0;
  298. }
  299. " HAVE_C__GENERIC)
  300. check_c_source_compiles("
  301. #include <malloc.h>
  302. int main() {
  303. mallopt(M_ARENA_MAX, 1);
  304. mallopt(M_PERTURB, 0x5A);
  305. return 0;
  306. }
  307. " HAVE_C_MALLOPT)
  308. check_c_source_compiles("
  309. #define _GNU_SOURCE
  310. #include <stdio.h>
  311. #include <sys/socket.h>
  312. int main() {
  313. accept4(0, NULL, NULL, 0);
  314. return 0;
  315. }
  316. " HAVE_ACCEPT4)
  317. check_c_source_compiles("
  318. #define _GNU_SOURCE
  319. #include <string.h>
  320. int main() {
  321. char x = *strerror_r(0, &x, sizeof(x)); return 0;
  322. }
  323. " STRERROR_R_CHAR_P)
  324. check_c_source_compiles("
  325. #ifndef _GNU_SOURCE
  326. #define _GNU_SOURCE
  327. #endif
  328. #include <sched.h>
  329. int main() {
  330. setns(0, 0); return 0;
  331. }
  332. " HAVE_SETNS)
  333. check_cxx_source_compiles("
  334. int main() {
  335. __atomic_load_8(nullptr, 0);
  336. return 0;
  337. }
  338. " HAVE_BUILTIN_ATOMICS)
  339. check_c_source_compiles("
  340. void my_printf(char const *s, ...) __attribute__((format(printf, 1, 2)));
  341. int main() { return 0; }
  342. " HAVE_FUNC_ATTRIBUTE_FORMAT)
  343. check_c_source_compiles("
  344. #include <stdio.h>
  345. #include <stdlib.h>
  346. #include <unistd.h>
  347. void* my_alloc(size_t size) __attribute__((malloc));
  348. int main() {
  349. void *x = my_alloc(1);
  350. free(x);
  351. return 0;
  352. }
  353. void* my_alloc(size_t size) {
  354. void *ret = malloc(size);
  355. if(!ret) exit(1);
  356. return ret;
  357. }
  358. " HAVE_FUNC_ATTRIBUTE_MALLOC)
  359. check_c_source_compiles("
  360. void my_function() __attribute__((noinline));
  361. int main() { my_function(); return 0; }
  362. void my_function() { ; }
  363. " HAVE_FUNC_ATTRIBUTE_NOINLINE)
  364. check_c_source_compiles("
  365. void my_exit_function() __attribute__((noreturn));
  366. int main() {
  367. my_exit_function(); // Call the noreturn function
  368. return 0;
  369. }
  370. void my_exit_function() {
  371. exit(1);
  372. }
  373. " HAVE_FUNC_ATTRIBUTE_NORETURN)
  374. check_c_source_compiles("
  375. #include <stdio.h>
  376. #include <stdlib.h>
  377. #include <unistd.h>
  378. void* my_alloc(size_t size) __attribute__((returns_nonnull));
  379. int main() {
  380. void* ptr = my_alloc(10);
  381. free(ptr);
  382. return 0;
  383. }
  384. void* my_alloc(size_t size) {
  385. void *ret = malloc(size);
  386. if(!ret) exit(1);
  387. return ret;
  388. }
  389. " HAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL)
  390. check_c_source_compiles("
  391. int my_function() __attribute__((warn_unused_result));
  392. int main() {
  393. return my_function();
  394. }
  395. int my_function() {
  396. return 1;
  397. }
  398. " HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT)
  399. if(FREEBSD OR MACOS)
  400. set(HAVE_BUILTIN_ATOMICS True)
  401. endif()
  402. # openssl/crypto
  403. set(ENABLE_OPENSSL True)
  404. pkg_check_modules(OPENSSL openssl)
  405. if(NOT OPENSSL_FOUND)
  406. if(MACOS)
  407. execute_process(COMMAND
  408. brew --prefix --installed openssl
  409. RESULT_VARIABLE BREW_OPENSSL
  410. OUTPUT_VARIABLE BREW_OPENSSL_PREFIX
  411. OUTPUT_STRIP_TRAILING_WHITESPACE)
  412. if((BREW_OPENSSL NOT EQUAL 0) OR (NOT EXISTS "${BREW_OPENSSL_PREFIX}"))
  413. message(FATAL_ERROR "OpenSSL (or LibreSSL) is required for building Netdata, but could not be found.")
  414. endif()
  415. set(OPENSSL_INCLUDE_DIRS "${BREW_OPENSSL_PREFIX}/include")
  416. set(OPENSSL_CFLAGS_OTHER "")
  417. set(OPENSSL_LDFLAGS "-L${BREW_OPENSSL_PREFIX}/lib;-lssl;-lcrypto")
  418. else()
  419. message(FATAL_ERROR "OpenSSL (or LibreSSL) is required for building Netdata, but could not be found.")
  420. endif()
  421. endif()
  422. if(NOT MACOS)
  423. pkg_check_modules(CRYPTO libcrypto)
  424. endif()
  425. #
  426. # figure out if we need protoc/protobuf
  427. #
  428. if(NEED_PROTOBUF)
  429. netdata_detect_protobuf()
  430. endif()
  431. #
  432. # source files
  433. #
  434. set(LIBJUDY_PREV_FILES
  435. src/libnetdata/libjudy/src/JudyL/JudyLPrev.c
  436. src/libnetdata/libjudy/src/JudyL/JudyLPrevEmpty.c
  437. )
  438. set(LIBJUDY_NEXT_FILES
  439. src/libnetdata/libjudy/src/JudyL/JudyLNext.c
  440. src/libnetdata/libjudy/src/JudyL/JudyLNextEmpty.c
  441. )
  442. set(LIBJUDY_SOURCES
  443. src/libnetdata/libjudy/src/Judy.h
  444. src/libnetdata/libjudy/src/JudyCommon/JudyMalloc.c
  445. src/libnetdata/libjudy/src/JudyCommon/JudyPrivate.h
  446. src/libnetdata/libjudy/src/JudyCommon/JudyPrivate1L.h
  447. src/libnetdata/libjudy/src/JudyCommon/JudyPrivateBranch.h
  448. src/libnetdata/libjudy/src/JudyL/JudyL.h
  449. src/libnetdata/libjudy/src/JudyL/JudyLByCount.c
  450. src/libnetdata/libjudy/src/JudyL/JudyLCascade.c
  451. src/libnetdata/libjudy/src/JudyL/JudyLCount.c
  452. src/libnetdata/libjudy/src/JudyL/JudyLCreateBranch.c
  453. src/libnetdata/libjudy/src/JudyL/JudyLDecascade.c
  454. src/libnetdata/libjudy/src/JudyL/JudyLDel.c
  455. src/libnetdata/libjudy/src/JudyL/JudyLFirst.c
  456. src/libnetdata/libjudy/src/JudyL/JudyLFreeArray.c
  457. src/libnetdata/libjudy/src/JudyL/j__udyLGet.c
  458. src/libnetdata/libjudy/src/JudyL/JudyLGet.c
  459. src/libnetdata/libjudy/src/JudyL/JudyLInsArray.c
  460. src/libnetdata/libjudy/src/JudyL/JudyLIns.c
  461. src/libnetdata/libjudy/src/JudyL/JudyLInsertBranch.c
  462. src/libnetdata/libjudy/src/JudyL/JudyLMallocIF.c
  463. src/libnetdata/libjudy/src/JudyL/JudyLMemActive.c
  464. src/libnetdata/libjudy/src/JudyL/JudyLMemUsed.c
  465. src/libnetdata/libjudy/src/JudyL/JudyLTables.c
  466. src/libnetdata/libjudy/src/JudyHS/JudyHS.c
  467. ${LIBJUDY_PREV_FILES}
  468. ${LIBJUDY_NEXT_FILES}
  469. )
  470. set(LIBNETDATA_FILES
  471. ${CONFIG_H}
  472. src/libnetdata/adaptive_resortable_list/adaptive_resortable_list.c
  473. src/libnetdata/adaptive_resortable_list/adaptive_resortable_list.h
  474. src/libnetdata/config/appconfig.c
  475. src/libnetdata/config/appconfig.h
  476. src/libnetdata/aral/aral.c
  477. src/libnetdata/aral/aral.h
  478. src/libnetdata/avl/avl.c
  479. src/libnetdata/avl/avl.h
  480. src/libnetdata/buffer/buffer.c
  481. src/libnetdata/buffer/buffer.h
  482. src/libnetdata/circular_buffer/circular_buffer.c
  483. src/libnetdata/circular_buffer/circular_buffer.h
  484. src/libnetdata/clocks/clocks.c
  485. src/libnetdata/clocks/clocks.h
  486. src/libnetdata/completion/completion.c
  487. src/libnetdata/completion/completion.h
  488. src/libnetdata/datetime/iso8601.c
  489. src/libnetdata/datetime/iso8601.h
  490. src/libnetdata/datetime/rfc7231.c
  491. src/libnetdata/datetime/rfc7231.h
  492. src/libnetdata/datetime/rfc3339.c
  493. src/libnetdata/datetime/rfc3339.h
  494. src/libnetdata/dictionary/dictionary.c
  495. src/libnetdata/dictionary/dictionary.h
  496. src/libnetdata/eval/eval.c
  497. src/libnetdata/eval/eval.h
  498. src/libnetdata/facets/facets.c
  499. src/libnetdata/facets/facets.h
  500. src/libnetdata/functions_evloop/functions_evloop.c
  501. src/libnetdata/functions_evloop/functions_evloop.h
  502. src/libnetdata/gorilla/gorilla.cc
  503. src/libnetdata/gorilla/gorilla.h
  504. src/libnetdata/july/july.c
  505. src/libnetdata/july/july.h
  506. src/libnetdata/inlined.h
  507. src/libnetdata/json/json.c
  508. src/libnetdata/json/json.h
  509. src/libnetdata/json/jsmn.c
  510. src/libnetdata/json/jsmn.h
  511. src/libnetdata/libnetdata.c
  512. src/libnetdata/libnetdata.h
  513. src/libnetdata/line_splitter/line_splitter.c
  514. src/libnetdata/line_splitter/line_splitter.h
  515. src/libnetdata/libnetdata.h
  516. src/libnetdata/locks/locks.c
  517. src/libnetdata/locks/locks.h
  518. src/libnetdata/log/journal.c
  519. src/libnetdata/log/journal.h
  520. src/libnetdata/log/log.c
  521. src/libnetdata/log/log.h
  522. src/libnetdata/os.c
  523. src/libnetdata/os.h
  524. src/libnetdata/simple_hashtable.h
  525. src/libnetdata/byteorder.h
  526. src/libnetdata/onewayalloc/onewayalloc.c
  527. src/libnetdata/onewayalloc/onewayalloc.h
  528. src/libnetdata/popen/popen.c
  529. src/libnetdata/popen/popen.h
  530. src/libnetdata/procfile/procfile.c
  531. src/libnetdata/procfile/procfile.h
  532. src/libnetdata/query_progress/progress.c
  533. src/libnetdata/query_progress/progress.h
  534. src/libnetdata/required_dummies.h
  535. src/libnetdata/socket/security.c
  536. src/libnetdata/socket/security.h
  537. src/libnetdata/simple_pattern/simple_pattern.c
  538. src/libnetdata/simple_pattern/simple_pattern.h
  539. src/libnetdata/socket/socket.c
  540. src/libnetdata/socket/socket.h
  541. src/libnetdata/statistical/statistical.c
  542. src/libnetdata/statistical/statistical.h
  543. src/libnetdata/storage_number/storage_number.c
  544. src/libnetdata/storage_number/storage_number.h
  545. src/libnetdata/string/string.c
  546. src/libnetdata/string/string.h
  547. src/libnetdata/threads/threads.c
  548. src/libnetdata/threads/threads.h
  549. src/libnetdata/url/url.c
  550. src/libnetdata/url/url.h
  551. src/libnetdata/uuid/uuid.c
  552. src/libnetdata/uuid/uuid.h
  553. src/libnetdata/string/utf8.h
  554. src/libnetdata/worker_utilization/worker_utilization.c
  555. src/libnetdata/worker_utilization/worker_utilization.h
  556. src/libnetdata/http/http_access.c
  557. src/libnetdata/http/http_access.h
  558. src/libnetdata/http/http_defs.c
  559. src/libnetdata/http/http_defs.h
  560. src/libnetdata/http/content_type.c
  561. src/libnetdata/http/content_type.h
  562. src/libnetdata/config/dyncfg.c
  563. src/libnetdata/config/dyncfg.h
  564. src/libnetdata/json/json-c-parser-inline.h
  565. src/libnetdata/template-enum.h
  566. src/libnetdata/dictionary/dictionary-internals.h
  567. src/libnetdata/dictionary/dictionary-unittest.c
  568. src/libnetdata/dictionary/thread-cache.c
  569. src/libnetdata/dictionary/thread-cache.h
  570. src/libnetdata/dictionary/dictionary-traversal.c
  571. src/libnetdata/dictionary/dictionary-statistics.h
  572. src/libnetdata/dictionary/dictionary-locks.h
  573. src/libnetdata/dictionary/dictionary-refcount.h
  574. src/libnetdata/dictionary/dictionary-hashtable.h
  575. src/libnetdata/dictionary/dictionary-item.h
  576. src/libnetdata/dictionary/dictionary-callbacks.h
  577. src/libnetdata/linked-lists.h
  578. src/libnetdata/storage-point.h
  579. src/libnetdata/bitmap64.h
  580. )
  581. if(ENABLE_PLUGIN_EBPF)
  582. list(APPEND LIBNETDATA_FILES
  583. src/libnetdata/ebpf/ebpf.c
  584. src/libnetdata/ebpf/ebpf.h
  585. )
  586. endif()
  587. set(LIBH2O_FILES
  588. src/web/server/h2o/libh2o/deps/cloexec/cloexec.c
  589. src/web/server/h2o/libh2o/deps/libgkc/gkc.c
  590. src/web/server/h2o/libh2o/deps/libyrmcds/close.c
  591. src/web/server/h2o/libh2o/deps/libyrmcds/connect.c
  592. src/web/server/h2o/libh2o/deps/libyrmcds/recv.c
  593. src/web/server/h2o/libh2o/deps/libyrmcds/send.c
  594. src/web/server/h2o/libh2o/deps/libyrmcds/send_text.c
  595. src/web/server/h2o/libh2o/deps/libyrmcds/socket.c
  596. src/web/server/h2o/libh2o/deps/libyrmcds/strerror.c
  597. src/web/server/h2o/libh2o/deps/libyrmcds/text_mode.c
  598. src/web/server/h2o/libh2o/deps/picohttpparser/picohttpparser.c
  599. src/web/server/h2o/libh2o/lib/common/cache.c
  600. src/web/server/h2o/libh2o/lib/common/file.c
  601. src/web/server/h2o/libh2o/lib/common/filecache.c
  602. src/web/server/h2o/libh2o/lib/common/hostinfo.c
  603. src/web/server/h2o/libh2o/lib/common/http1client.c
  604. src/web/server/h2o/libh2o/lib/common/memcached.c
  605. src/web/server/h2o/libh2o/lib/common/memory.c
  606. src/web/server/h2o/libh2o/lib/common/multithread.c
  607. src/web/server/h2o/libh2o/lib/common/serverutil.c
  608. src/web/server/h2o/libh2o/lib/common/socket.c
  609. src/web/server/h2o/libh2o/lib/common/socketpool.c
  610. src/web/server/h2o/libh2o/lib/common/string.c
  611. src/web/server/h2o/libh2o/lib/common/time.c
  612. src/web/server/h2o/libh2o/lib/common/timeout.c
  613. src/web/server/h2o/libh2o/lib/common/url.c
  614. src/web/server/h2o/libh2o/lib/core/config.c
  615. src/web/server/h2o/libh2o/lib/core/configurator.c
  616. src/web/server/h2o/libh2o/lib/core/context.c
  617. src/web/server/h2o/libh2o/lib/core/headers.c
  618. src/web/server/h2o/libh2o/lib/core/logconf.c
  619. src/web/server/h2o/libh2o/lib/core/proxy.c
  620. src/web/server/h2o/libh2o/lib/core/request.c
  621. src/web/server/h2o/libh2o/lib/core/token.c
  622. src/web/server/h2o/libh2o/lib/core/util.c
  623. src/web/server/h2o/libh2o/lib/handler/access_log.c
  624. src/web/server/h2o/libh2o/lib/handler/chunked.c
  625. src/web/server/h2o/libh2o/lib/handler/compress.c
  626. src/web/server/h2o/libh2o/lib/handler/compress/gzip.c
  627. src/web/server/h2o/libh2o/lib/handler/errordoc.c
  628. src/web/server/h2o/libh2o/lib/handler/expires.c
  629. src/web/server/h2o/libh2o/lib/handler/fastcgi.c
  630. src/web/server/h2o/libh2o/lib/handler/file.c
  631. src/web/server/h2o/libh2o/lib/handler/headers.c
  632. src/web/server/h2o/libh2o/lib/handler/mimemap.c
  633. src/web/server/h2o/libh2o/lib/handler/proxy.c
  634. src/web/server/h2o/libh2o/lib/handler/redirect.c
  635. src/web/server/h2o/libh2o/lib/handler/reproxy.c
  636. src/web/server/h2o/libh2o/lib/handler/throttle_resp.c
  637. src/web/server/h2o/libh2o/lib/handler/status.c
  638. src/web/server/h2o/libh2o/lib/handler/headers_util.c
  639. src/web/server/h2o/libh2o/lib/handler/status/events.c
  640. src/web/server/h2o/libh2o/lib/handler/status/requests.c
  641. src/web/server/h2o/libh2o/lib/handler/http2_debug_state.c
  642. src/web/server/h2o/libh2o/lib/handler/status/durations.c
  643. src/web/server/h2o/libh2o/lib/handler/configurator/access_log.c
  644. src/web/server/h2o/libh2o/lib/handler/configurator/compress.c
  645. src/web/server/h2o/libh2o/lib/handler/configurator/errordoc.c
  646. src/web/server/h2o/libh2o/lib/handler/configurator/expires.c
  647. src/web/server/h2o/libh2o/lib/handler/configurator/fastcgi.c
  648. src/web/server/h2o/libh2o/lib/handler/configurator/file.c
  649. src/web/server/h2o/libh2o/lib/handler/configurator/headers.c
  650. src/web/server/h2o/libh2o/lib/handler/configurator/proxy.c
  651. src/web/server/h2o/libh2o/lib/handler/configurator/redirect.c
  652. src/web/server/h2o/libh2o/lib/handler/configurator/reproxy.c
  653. src/web/server/h2o/libh2o/lib/handler/configurator/throttle_resp.c
  654. src/web/server/h2o/libh2o/lib/handler/configurator/status.c
  655. src/web/server/h2o/libh2o/lib/handler/configurator/http2_debug_state.c
  656. src/web/server/h2o/libh2o/lib/handler/configurator/headers_util.c
  657. src/web/server/h2o/libh2o/lib/http1.c
  658. src/web/server/h2o/libh2o/lib/tunnel.c
  659. src/web/server/h2o/libh2o/lib/http2/cache_digests.c
  660. src/web/server/h2o/libh2o/lib/http2/casper.c
  661. src/web/server/h2o/libh2o/lib/http2/connection.c
  662. src/web/server/h2o/libh2o/lib/http2/frame.c
  663. src/web/server/h2o/libh2o/lib/http2/hpack.c
  664. src/web/server/h2o/libh2o/lib/http2/scheduler.c
  665. src/web/server/h2o/libh2o/lib/http2/stream.c
  666. src/web/server/h2o/libh2o/lib/http2/http2_debug_state.c
  667. )
  668. set(DAEMON_FILES
  669. src/daemon/buildinfo.c
  670. src/daemon/buildinfo.h
  671. src/daemon/common.c
  672. src/daemon/common.h
  673. src/daemon/daemon.c
  674. src/daemon/daemon.h
  675. src/daemon/event_loop.c
  676. src/daemon/event_loop.h
  677. src/daemon/global_statistics.c
  678. src/daemon/global_statistics.h
  679. src/daemon/analytics.c
  680. src/daemon/analytics.h
  681. src/daemon/main.c
  682. src/daemon/main.h
  683. src/daemon/signals.c
  684. src/daemon/signals.h
  685. src/daemon/service.c
  686. src/daemon/watcher.c
  687. src/daemon/watcher.h
  688. src/daemon/static_threads.c
  689. src/daemon/static_threads.h
  690. src/daemon/commands.c
  691. src/daemon/commands.h
  692. src/daemon/pipename.c
  693. src/daemon/pipename.h
  694. src/daemon/unit_test.c
  695. src/daemon/unit_test.h
  696. src/daemon/config/dyncfg.c
  697. src/daemon/config/dyncfg.h
  698. src/daemon/config/dyncfg-files.c
  699. src/daemon/config/dyncfg-unittest.c
  700. src/daemon/config/dyncfg-inline.c
  701. src/daemon/config/dyncfg-echo.c
  702. src/daemon/config/dyncfg-internals.h
  703. src/daemon/config/dyncfg-intercept.c
  704. src/daemon/config/dyncfg-tree.c
  705. )
  706. set(H2O_FILES
  707. src/web/server/h2o/http_server.c
  708. src/web/server/h2o/http_server.h
  709. src/web/server/h2o/h2o_utils.c
  710. src/web/server/h2o/h2o_utils.h
  711. src/web/server/h2o/streaming.c
  712. src/web/server/h2o/streaming.h
  713. src/web/server/h2o/connlist.c
  714. src/web/server/h2o/connlist.h
  715. )
  716. if(ENABLE_H2O)
  717. list(APPEND DAEMON_FILES ${H2O_FILES})
  718. endif()
  719. set(API_PLUGIN_FILES
  720. src/web/api/web_api.c
  721. src/web/api/web_api.h
  722. src/web/api/web_api_v1.c
  723. src/web/api/web_api_v1.h
  724. src/web/api/web_api_v2.c
  725. src/web/api/web_api_v2.h
  726. src/web/api/http_auth.c
  727. src/web/api/http_auth.h
  728. src/web/api/http_header.c
  729. src/web/api/http_header.h
  730. src/web/api/badges/web_buffer_svg.c
  731. src/web/api/badges/web_buffer_svg.h
  732. src/web/api/exporters/allmetrics.c
  733. src/web/api/exporters/allmetrics.h
  734. src/web/api/exporters/shell/allmetrics_shell.c
  735. src/web/api/exporters/shell/allmetrics_shell.h
  736. src/web/api/queries/rrdr.c
  737. src/web/api/queries/rrdr.h
  738. src/web/api/queries/query.c
  739. src/web/api/queries/query.h
  740. src/web/api/queries/average/average.c
  741. src/web/api/queries/average/average.h
  742. src/web/api/queries/countif/countif.c
  743. src/web/api/queries/countif/countif.h
  744. src/web/api/queries/incremental_sum/incremental_sum.c
  745. src/web/api/queries/incremental_sum/incremental_sum.h
  746. src/web/api/queries/max/max.c
  747. src/web/api/queries/max/max.h
  748. src/web/api/queries/min/min.c
  749. src/web/api/queries/min/min.h
  750. src/web/api/queries/sum/sum.c
  751. src/web/api/queries/sum/sum.h
  752. src/web/api/queries/median/median.c
  753. src/web/api/queries/median/median.h
  754. src/web/api/queries/percentile/percentile.c
  755. src/web/api/queries/percentile/percentile.h
  756. src/web/api/queries/stddev/stddev.c
  757. src/web/api/queries/stddev/stddev.h
  758. src/web/api/queries/ses/ses.c
  759. src/web/api/queries/ses/ses.h
  760. src/web/api/queries/des/des.c
  761. src/web/api/queries/des/des.h
  762. src/web/api/queries/trimmed_mean/trimmed_mean.c
  763. src/web/api/queries/trimmed_mean/trimmed_mean.h
  764. src/web/api/queries/weights.c
  765. src/web/api/queries/weights.h
  766. src/web/api/formatters/rrd2json.c
  767. src/web/api/formatters/rrd2json.h
  768. src/web/api/formatters/csv/csv.c
  769. src/web/api/formatters/csv/csv.h
  770. src/web/api/formatters/json/json.c
  771. src/web/api/formatters/json/json.h
  772. src/web/api/formatters/ssv/ssv.c
  773. src/web/api/formatters/ssv/ssv.h
  774. src/web/api/formatters/value/value.c
  775. src/web/api/formatters/value/value.h
  776. src/web/api/formatters/json_wrapper.c
  777. src/web/api/formatters/json_wrapper.h
  778. src/web/api/formatters/charts2json.c
  779. src/web/api/formatters/charts2json.h
  780. src/web/api/formatters/rrdset2json.c
  781. src/web/api/formatters/rrdset2json.h
  782. src/web/api/ilove/ilove.c
  783. src/web/api/ilove/ilove.h
  784. src/web/rtc/webrtc.c
  785. src/web/rtc/webrtc.h
  786. )
  787. set(EXPORTING_ENGINE_FILES
  788. src/exporting/exporting_engine.c
  789. src/exporting/exporting_engine.h
  790. src/exporting/graphite/graphite.c
  791. src/exporting/graphite/graphite.h
  792. src/exporting/json/json.c
  793. src/exporting/json/json.h
  794. src/exporting/opentsdb/opentsdb.c
  795. src/exporting/opentsdb/opentsdb.h
  796. src/exporting/prometheus/prometheus.c
  797. src/exporting/prometheus/prometheus.h
  798. src/exporting/read_config.c
  799. src/exporting/clean_connectors.c
  800. src/exporting/init_connectors.c
  801. src/exporting/process_data.c
  802. src/exporting/check_filters.c
  803. src/exporting/send_data.c
  804. src/exporting/send_internal_metrics.c
  805. )
  806. set(HEALTH_PLUGIN_FILES
  807. src/health/health.c
  808. src/health/health.h
  809. src/health/health_config.c
  810. src/health/health_json.c
  811. src/health/health_log.c
  812. src/health/health_prototypes.c
  813. src/health/health_prototypes.h
  814. src/health/health_silencers.c
  815. src/health/health_silencers.h
  816. src/health/health_internals.h
  817. src/health/health_notifications.c
  818. src/health/health_event_loop.c
  819. src/health/health_dyncfg.c
  820. src/health/health_variable.c
  821. src/health/rrdcalc.c
  822. src/health/rrdcalc.h
  823. src/health/rrdvar.c
  824. src/health/rrdvar.h
  825. )
  826. set(IDLEJITTER_PLUGIN_FILES src/collectors/idlejitter.plugin/plugin_idlejitter.c)
  827. if(ENABLE_ML)
  828. set(ML_FILES
  829. src/ml/ad_charts.h
  830. src/ml/ad_charts.cc
  831. src/ml/Config.cc
  832. src/ml/dlib/dlib/all/source.cpp
  833. src/ml/ml.h
  834. src/ml/ml.cc
  835. src/ml/ml-private.h
  836. )
  837. else()
  838. set(ML_FILES
  839. src/ml/ml.h
  840. src/ml/ml-dummy.c
  841. )
  842. endif()
  843. set(PLUGINSD_PLUGIN_FILES
  844. src/collectors/plugins.d/plugins_d.c
  845. src/collectors/plugins.d/plugins_d.h
  846. src/collectors/plugins.d/pluginsd_dyncfg.c
  847. src/collectors/plugins.d/pluginsd_dyncfg.h
  848. src/collectors/plugins.d/pluginsd_functions.c
  849. src/collectors/plugins.d/pluginsd_functions.h
  850. src/collectors/plugins.d/pluginsd_internals.c
  851. src/collectors/plugins.d/pluginsd_internals.h
  852. src/collectors/plugins.d/pluginsd_parser.c
  853. src/collectors/plugins.d/pluginsd_parser.h
  854. src/collectors/plugins.d/pluginsd_replication.c
  855. src/collectors/plugins.d/pluginsd_replication.h
  856. )
  857. set(RRD_PLUGIN_FILES
  858. src/database/contexts/api_v1.c
  859. src/database/contexts/api_v2.c
  860. src/database/contexts/context.c
  861. src/database/contexts/instance.c
  862. src/database/contexts/internal.h
  863. src/database/contexts/metric.c
  864. src/database/contexts/query_scope.c
  865. src/database/contexts/query_target.c
  866. src/database/contexts/rrdcontext.c
  867. src/database/contexts/rrdcontext.h
  868. src/database/contexts/worker.c
  869. src/database/rrdcollector.c
  870. src/database/rrdcollector.h
  871. src/database/rrddim.c
  872. src/database/rrdfunctions.c
  873. src/database/rrdfunctions.h
  874. src/database/rrdfunctions-inline.c
  875. src/database/rrdfunctions-inline.h
  876. src/database/rrdfunctions-progress.c
  877. src/database/rrdfunctions-progress.h
  878. src/database/rrdfunctions-streaming.c
  879. src/database/rrdfunctions-streaming.h
  880. src/database/rrdhost.c
  881. src/database/rrdlabels.c
  882. src/database/rrd.c
  883. src/database/rrd.h
  884. src/database/rrdset.c
  885. src/database/storage_engine.c
  886. src/database/storage_engine.h
  887. src/database/ram/rrddim_mem.c
  888. src/database/ram/rrddim_mem.h
  889. src/database/sqlite/sqlite_metadata.c
  890. src/database/sqlite/sqlite_metadata.h
  891. src/database/sqlite/sqlite_functions.c
  892. src/database/sqlite/sqlite_functions.h
  893. src/database/sqlite/sqlite_context.c
  894. src/database/sqlite/sqlite_context.h
  895. src/database/sqlite/sqlite_db_migration.c
  896. src/database/sqlite/sqlite_db_migration.h
  897. src/database/sqlite/sqlite_aclk.c
  898. src/database/sqlite/sqlite_aclk.h
  899. src/database/sqlite/sqlite_health.c
  900. src/database/sqlite/sqlite_health.h
  901. src/database/sqlite/sqlite_aclk_node.c
  902. src/database/sqlite/sqlite_aclk_node.h
  903. src/database/sqlite/sqlite_aclk_alert.c
  904. src/database/sqlite/sqlite_aclk_alert.h
  905. src/database/sqlite/sqlite3.c
  906. src/database/sqlite/sqlite3.h
  907. src/database/sqlite/sqlite3recover.c
  908. src/database/sqlite/sqlite3recover.h
  909. src/database/sqlite/dbdata.c
  910. src/database/KolmogorovSmirnovDist.c
  911. src/database/KolmogorovSmirnovDist.h
  912. src/database/rrdfunctions-inflight.c
  913. src/database/rrdfunctions-inflight.h
  914. src/database/rrdfunctions-exporters.c
  915. src/database/rrdfunctions-exporters.h
  916. src/database/rrdfunctions-internals.h
  917. src/database/rrdcollector-internals.h
  918. )
  919. if(ENABLE_DBENGINE)
  920. list(APPEND RRD_PLUGIN_FILES
  921. src/database/engine/rrdengine.c
  922. src/database/engine/rrdengine.h
  923. src/database/engine/rrddiskprotocol.h
  924. src/database/engine/datafile.c
  925. src/database/engine/datafile.h
  926. src/database/engine/journalfile.c
  927. src/database/engine/journalfile.h
  928. src/database/engine/rrdenginelib.c
  929. src/database/engine/rrdenginelib.h
  930. src/database/engine/rrdengineapi.c
  931. src/database/engine/rrdengineapi.h
  932. src/database/engine/pagecache.c
  933. src/database/engine/pagecache.h
  934. src/database/engine/page_test.cc
  935. src/database/engine/page.c
  936. src/database/engine/page.h
  937. src/database/engine/cache.c
  938. src/database/engine/cache.h
  939. src/database/engine/metric.c
  940. src/database/engine/metric.h
  941. src/database/engine/pdc.c
  942. src/database/engine/pdc.h
  943. src/database/engine/dbengine-unittest.c
  944. src/database/engine/dbengine-stresstest.c
  945. src/database/engine/dbengine-compression.c
  946. src/database/engine/dbengine-compression.h
  947. )
  948. endif()
  949. set(REGISTRY_PLUGIN_FILES
  950. src/registry/registry.c
  951. src/registry/registry.h
  952. src/registry/registry_db.c
  953. src/registry/registry_init.c
  954. src/registry/registry_internals.c
  955. src/registry/registry_internals.h
  956. src/registry/registry_log.c
  957. src/registry/registry_machine.c
  958. src/registry/registry_machine.h
  959. src/registry/registry_person.c
  960. src/registry/registry_person.h
  961. )
  962. set(STATSD_PLUGIN_FILES
  963. src/collectors/statsd.plugin/statsd.c
  964. )
  965. set(SYSTEMD_JOURNAL_PLUGIN_FILES
  966. src/collectors/systemd-journal.plugin/systemd-journal.c
  967. src/collectors/systemd-journal.plugin/systemd-internals.h
  968. src/collectors/systemd-journal.plugin/systemd-main.c
  969. src/collectors/systemd-journal.plugin/systemd-units.c
  970. src/collectors/systemd-journal.plugin/systemd-journal.c
  971. src/collectors/systemd-journal.plugin/systemd-journal-annotations.c
  972. src/collectors/systemd-journal.plugin/systemd-journal-files.c
  973. src/collectors/systemd-journal.plugin/systemd-journal-fstat.c
  974. src/collectors/systemd-journal.plugin/systemd-journal-watcher.c
  975. src/collectors/systemd-journal.plugin/systemd-journal-dyncfg.c
  976. src/libnetdata/maps/system-users.h
  977. src/libnetdata/maps/system-groups.h
  978. )
  979. set(STREAMING_PLUGIN_FILES
  980. src/streaming/rrdpush.c
  981. src/streaming/rrdpush.h
  982. src/streaming/compression.c
  983. src/streaming/compression.h
  984. src/streaming/compression_brotli.c
  985. src/streaming/compression_brotli.h
  986. src/streaming/compression_gzip.c
  987. src/streaming/compression_gzip.h
  988. src/streaming/compression_lz4.c
  989. src/streaming/compression_lz4.h
  990. src/streaming/compression_zstd.c
  991. src/streaming/compression_zstd.h
  992. src/streaming/receiver.c
  993. src/streaming/sender.c
  994. src/streaming/replication.c
  995. src/streaming/replication.h
  996. src/streaming/common.h
  997. )
  998. set(WEB_PLUGIN_FILES
  999. src/web/server/web_client.c
  1000. src/web/server/web_client.h
  1001. src/web/server/web_server.c
  1002. src/web/server/web_server.h
  1003. src/web/server/static/static-threaded.c
  1004. src/web/server/static/static-threaded.h
  1005. src/web/server/web_client_cache.c
  1006. src/web/server/web_client_cache.h
  1007. )
  1008. set(CLAIM_PLUGIN_FILES
  1009. src/claim/claim.c
  1010. src/claim/claim.h
  1011. )
  1012. set(SPAWN_PLUGIN_FILES
  1013. src/spawn/spawn.c
  1014. src/spawn/spawn_server.c
  1015. src/spawn/spawn_client.c
  1016. src/spawn/spawn.h
  1017. )
  1018. set(ACLK_ALWAYS_BUILD
  1019. src/aclk/aclk_rrdhost_state.h
  1020. src/aclk/aclk_proxy.c
  1021. src/aclk/aclk_proxy.h
  1022. src/aclk/aclk.c
  1023. src/aclk/aclk.h
  1024. src/aclk/aclk_capas.c
  1025. src/aclk/aclk_capas.h
  1026. src/aclk/aclk_util.c
  1027. src/aclk/aclk_util.h
  1028. src/aclk/https_client.c
  1029. src/aclk/https_client.h
  1030. )
  1031. set(TIMEX_PLUGIN_FILES
  1032. src/collectors/timex.plugin/plugin_timex.c
  1033. )
  1034. set(PROFILE_PLUGIN_FILES
  1035. src/collectors/profile.plugin/plugin_profile.cc
  1036. )
  1037. set(CGROUPS_PLUGIN_FILES
  1038. src/collectors/cgroups.plugin/sys_fs_cgroup.c
  1039. src/collectors/cgroups.plugin/sys_fs_cgroup.h
  1040. src/collectors/cgroups.plugin/cgroup-internals.h
  1041. src/collectors/cgroups.plugin/cgroup-discovery.c
  1042. src/collectors/cgroups.plugin/cgroup-charts.c
  1043. src/collectors/cgroups.plugin/cgroup-top.c
  1044. )
  1045. set(DISKSPACE_PLUGIN_FILES
  1046. src/collectors/diskspace.plugin/plugin_diskspace.c
  1047. )
  1048. set(MACOS_PLUGIN_FILES
  1049. src/collectors/macos.plugin/plugin_macos.c
  1050. src/collectors/macos.plugin/plugin_macos.h
  1051. src/collectors/macos.plugin/macos_sysctl.c
  1052. src/collectors/macos.plugin/macos_mach_smi.c
  1053. src/collectors/macos.plugin/macos_fw.c
  1054. )
  1055. set(FREEBSD_PLUGIN_FILES
  1056. src/collectors/freebsd.plugin/plugin_freebsd.c
  1057. src/collectors/freebsd.plugin/plugin_freebsd.h
  1058. src/collectors/freebsd.plugin/freebsd_sysctl.c
  1059. src/collectors/freebsd.plugin/freebsd_getmntinfo.c
  1060. src/collectors/freebsd.plugin/freebsd_getifaddrs.c
  1061. src/collectors/freebsd.plugin/freebsd_devstat.c
  1062. src/collectors/freebsd.plugin/freebsd_kstat_zfs.c
  1063. src/collectors/freebsd.plugin/freebsd_ipfw.c
  1064. src/collectors/proc.plugin/zfs_common.c
  1065. src/collectors/proc.plugin/zfs_common.h
  1066. )
  1067. set(PROC_PLUGIN_FILES
  1068. src/collectors/proc.plugin/ipc.c
  1069. src/collectors/proc.plugin/plugin_proc.c
  1070. src/collectors/proc.plugin/plugin_proc.h
  1071. src/collectors/proc.plugin/proc_sys_fs_file_nr.c
  1072. src/collectors/proc.plugin/proc_diskstats.c
  1073. src/collectors/proc.plugin/proc_mdstat.c
  1074. src/collectors/proc.plugin/proc_interrupts.c
  1075. src/collectors/proc.plugin/proc_softirqs.c
  1076. src/collectors/proc.plugin/proc_loadavg.c
  1077. src/collectors/proc.plugin/proc_meminfo.c
  1078. src/collectors/proc.plugin/proc_pagetypeinfo.c
  1079. src/collectors/proc.plugin/proc_net_dev.c
  1080. src/collectors/proc.plugin/proc_net_dev_renames.c
  1081. src/collectors/proc.plugin/proc_net_dev_renames.h
  1082. src/collectors/proc.plugin/proc_net_wireless.c
  1083. src/collectors/proc.plugin/proc_net_ip_vs_stats.c
  1084. src/collectors/proc.plugin/proc_net_netstat.c
  1085. src/collectors/proc.plugin/proc_net_rpc_nfs.c
  1086. src/collectors/proc.plugin/proc_net_rpc_nfsd.c
  1087. src/collectors/proc.plugin/proc_net_sctp_snmp.c
  1088. src/collectors/proc.plugin/proc_net_sockstat.c
  1089. src/collectors/proc.plugin/proc_net_sockstat6.c
  1090. src/collectors/proc.plugin/proc_net_softnet_stat.c
  1091. src/collectors/proc.plugin/proc_net_stat_conntrack.c
  1092. src/collectors/proc.plugin/proc_net_stat_synproxy.c
  1093. src/collectors/proc.plugin/proc_self_mountinfo.c
  1094. src/collectors/proc.plugin/proc_self_mountinfo.h
  1095. src/collectors/proc.plugin/zfs_common.c
  1096. src/collectors/proc.plugin/zfs_common.h
  1097. src/collectors/proc.plugin/proc_spl_kstat_zfs.c
  1098. src/collectors/proc.plugin/proc_stat.c
  1099. src/collectors/proc.plugin/proc_sys_kernel_random_entropy_avail.c
  1100. src/collectors/proc.plugin/proc_vmstat.c
  1101. src/collectors/proc.plugin/proc_uptime.c
  1102. src/collectors/proc.plugin/proc_pressure.c
  1103. src/collectors/proc.plugin/proc_pressure.h
  1104. src/collectors/proc.plugin/sys_kernel_mm_ksm.c
  1105. src/collectors/proc.plugin/sys_block_zram.c
  1106. src/collectors/proc.plugin/sys_devices_system_edac_mc.c
  1107. src/collectors/proc.plugin/sys_devices_system_node.c
  1108. src/collectors/proc.plugin/sys_class_infiniband.c
  1109. src/collectors/proc.plugin/sys_fs_btrfs.c
  1110. src/collectors/proc.plugin/sys_class_power_supply.c
  1111. src/collectors/proc.plugin/sys_devices_pci_aer.c
  1112. src/collectors/proc.plugin/sys_class_drm.c
  1113. )
  1114. set(TC_PLUGIN_FILES
  1115. src/collectors/tc.plugin/plugin_tc.c
  1116. )
  1117. set(LOGS_MANAGEMENT_PLUGIN_FILES
  1118. src/logsmanagement/circular_buffer.c
  1119. src/logsmanagement/circular_buffer.h
  1120. src/logsmanagement/db_api.c
  1121. src/logsmanagement/db_api.h
  1122. src/logsmanagement/defaults.h
  1123. src/logsmanagement/file_info.h
  1124. src/logsmanagement/flb_plugin.c
  1125. src/logsmanagement/flb_plugin.h
  1126. src/logsmanagement/functions.c
  1127. src/logsmanagement/functions.h
  1128. src/logsmanagement/helper.h
  1129. src/logsmanagement/logsmanag_config.c
  1130. src/logsmanagement/logsmanag_config.h
  1131. src/logsmanagement/logsmanagement.c
  1132. src/logsmanagement/parser.c
  1133. src/logsmanagement/parser.h
  1134. src/logsmanagement/query.c
  1135. src/logsmanagement/query.h
  1136. src/logsmanagement/rrd_api/rrd_api_docker_ev.c
  1137. src/logsmanagement/rrd_api/rrd_api_docker_ev.h
  1138. src/logsmanagement/rrd_api/rrd_api_generic.c
  1139. src/logsmanagement/rrd_api/rrd_api_generic.h
  1140. src/logsmanagement/rrd_api/rrd_api_kernel.c
  1141. src/logsmanagement/rrd_api/rrd_api_kernel.h
  1142. src/logsmanagement/rrd_api/rrd_api_mqtt.c
  1143. src/logsmanagement/rrd_api/rrd_api_mqtt.h
  1144. src/logsmanagement/rrd_api/rrd_api_stats.c
  1145. src/logsmanagement/rrd_api/rrd_api_stats.h
  1146. src/logsmanagement/rrd_api/rrd_api_systemd.c
  1147. src/logsmanagement/rrd_api/rrd_api_systemd.h
  1148. src/logsmanagement/rrd_api/rrd_api_web_log.c
  1149. src/logsmanagement/rrd_api/rrd_api_web_log.h
  1150. src/logsmanagement/rrd_api/rrd_api.h
  1151. src/database/sqlite/sqlite3.c
  1152. src/database/sqlite/sqlite3.h
  1153. )
  1154. set(NETDATA_FILES
  1155. src/collectors/all.h
  1156. ${DAEMON_FILES}
  1157. ${API_PLUGIN_FILES}
  1158. ${EXPORTING_ENGINE_FILES}
  1159. ${HEALTH_PLUGIN_FILES}
  1160. ${IDLEJITTER_PLUGIN_FILES}
  1161. ${ML_FILES}
  1162. ${PLUGINSD_PLUGIN_FILES}
  1163. ${RRD_PLUGIN_FILES}
  1164. ${REGISTRY_PLUGIN_FILES}
  1165. ${STATSD_PLUGIN_FILES}
  1166. ${STREAMING_PLUGIN_FILES}
  1167. ${WEB_PLUGIN_FILES}
  1168. ${CLAIM_PLUGIN_FILES}
  1169. ${SPAWN_PLUGIN_FILES}
  1170. ${ACLK_ALWAYS_BUILD}
  1171. ${PROFILE_PLUGIN_FILES}
  1172. )
  1173. if(LINUX)
  1174. list(APPEND NETDATA_FILES
  1175. src/daemon/static_threads_linux.c
  1176. ${CGROUPS_PLUGIN_FILES}
  1177. ${DISKSPACE_PLUGIN_FILES}
  1178. ${PROC_PLUGIN_FILES}
  1179. ${TC_PLUGIN_FILES}
  1180. ${TIMEX_PLUGIN_FILES}
  1181. )
  1182. if(ENABLE_SENTRY)
  1183. list(APPEND NETDATA_FILES
  1184. src/daemon/sentry-native/sentry-native.c
  1185. src/daemon/sentry-native/sentry-native.h)
  1186. endif()
  1187. elseif(MACOS)
  1188. list(APPEND NETDATA_FILES
  1189. src/daemon/static_threads_macos.c
  1190. ${MACOS_PLUGIN_FILES}
  1191. ${TIMEX_PLUGIN_FILES}
  1192. )
  1193. elseif(FREEBSD)
  1194. list(APPEND NETDATA_FILES
  1195. src/daemon/static_threads_freebsd.c
  1196. ${FREEBSD_PLUGIN_FILES}
  1197. ${TIMEX_PLUGIN_FILES}
  1198. )
  1199. endif()
  1200. set(MQTT_WEBSOCKETS_FILES
  1201. src/aclk/mqtt_websockets/mqtt_wss_client.c
  1202. src/aclk/mqtt_websockets/mqtt_wss_client.h
  1203. src/aclk/mqtt_websockets/mqtt_wss_log.c
  1204. src/aclk/mqtt_websockets/mqtt_wss_log.h
  1205. src/aclk/mqtt_websockets/ws_client.c
  1206. src/aclk/mqtt_websockets/ws_client.h
  1207. src/aclk/mqtt_websockets/mqtt_ng.c
  1208. src/aclk/mqtt_websockets/mqtt_ng.h
  1209. src/aclk/mqtt_websockets/common_public.c
  1210. src/aclk/mqtt_websockets/common_public.h
  1211. src/aclk/mqtt_websockets/common_internal.h
  1212. src/aclk/mqtt_websockets/c-rbuf/cringbuffer.c
  1213. src/aclk/mqtt_websockets/c-rbuf/cringbuffer.h
  1214. src/aclk/mqtt_websockets/c-rbuf/cringbuffer_internal.h
  1215. src/aclk/mqtt_websockets/c_rhash/c_rhash.c
  1216. src/aclk/mqtt_websockets/c_rhash/c_rhash.h
  1217. src/aclk/mqtt_websockets/c_rhash/c_rhash_internal.h
  1218. )
  1219. set(ACLK_PROTO_DEFS
  1220. src/aclk/aclk-schemas/proto/aclk/v1/lib.proto
  1221. src/aclk/aclk-schemas/proto/agent/v1/disconnect.proto
  1222. src/aclk/aclk-schemas/proto/agent/v1/connection.proto
  1223. src/aclk/aclk-schemas/proto/alarm/v1/config.proto
  1224. src/aclk/aclk-schemas/proto/alarm/v1/stream.proto
  1225. src/aclk/aclk-schemas/proto/nodeinstance/connection/v1/connection.proto
  1226. src/aclk/aclk-schemas/proto/nodeinstance/create/v1/creation.proto
  1227. src/aclk/aclk-schemas/proto/nodeinstance/info/v1/info.proto
  1228. src/aclk/aclk-schemas/proto/context/v1/context.proto
  1229. src/aclk/aclk-schemas/proto/context/v1/stream.proto
  1230. src/aclk/aclk-schemas/proto/agent/v1/cmds.proto
  1231. )
  1232. set(ACLK_FILES
  1233. src/aclk/aclk_stats.c
  1234. src/aclk/aclk_stats.h
  1235. src/aclk/aclk_query.c
  1236. src/aclk/aclk_query.h
  1237. src/aclk/aclk_query_queue.c
  1238. src/aclk/aclk_query_queue.h
  1239. src/aclk/aclk_otp.c
  1240. src/aclk/aclk_otp.h
  1241. src/aclk/aclk_tx_msgs.c
  1242. src/aclk/aclk_tx_msgs.h
  1243. src/aclk/aclk_rx_msgs.c
  1244. src/aclk/aclk_rx_msgs.h
  1245. src/aclk/aclk_alarm_api.c
  1246. src/aclk/aclk_alarm_api.h
  1247. src/aclk/aclk_contexts_api.c
  1248. src/aclk/aclk_contexts_api.h
  1249. src/aclk/schema-wrappers/connection.cc
  1250. src/aclk/schema-wrappers/connection.h
  1251. src/aclk/schema-wrappers/node_connection.cc
  1252. src/aclk/schema-wrappers/node_connection.h
  1253. src/aclk/schema-wrappers/node_creation.cc
  1254. src/aclk/schema-wrappers/node_creation.h
  1255. src/aclk/schema-wrappers/alarm_stream.cc
  1256. src/aclk/schema-wrappers/alarm_stream.h
  1257. src/aclk/schema-wrappers/alarm_config.cc
  1258. src/aclk/schema-wrappers/alarm_config.h
  1259. src/aclk/schema-wrappers/node_info.cc
  1260. src/aclk/schema-wrappers/node_info.h
  1261. src/aclk/schema-wrappers/capability.cc
  1262. src/aclk/schema-wrappers/capability.h
  1263. src/aclk/schema-wrappers/proto_2_json.cc
  1264. src/aclk/schema-wrappers/proto_2_json.h
  1265. src/aclk/schema-wrappers/context_stream.cc
  1266. src/aclk/schema-wrappers/context_stream.h
  1267. src/aclk/schema-wrappers/context.cc
  1268. src/aclk/schema-wrappers/context.h
  1269. src/aclk/schema-wrappers/schema_wrappers.h
  1270. src/aclk/schema-wrappers/schema_wrapper_utils.cc
  1271. src/aclk/schema-wrappers/schema_wrapper_utils.h
  1272. src/aclk/schema-wrappers/agent_cmds.cc
  1273. src/aclk/schema-wrappers/agent_cmds.h
  1274. src/aclk/helpers/mqtt_wss_pal.h
  1275. src/aclk/helpers/ringbuffer_pal.h
  1276. )
  1277. set(MONGODB_EXPORTING_FILES
  1278. src/exporting/mongodb/mongodb.c
  1279. src/exporting/mongodb/mongodb.h
  1280. )
  1281. set(PROMETHEUS_REMOTE_WRITE_EXPORTING_FILES
  1282. src/exporting/prometheus/remote_write/remote_write.c
  1283. src/exporting/prometheus/remote_write/remote_write.h
  1284. src/exporting/prometheus/remote_write/remote_write_request.cc
  1285. src/exporting/prometheus/remote_write/remote_write_request.h
  1286. )
  1287. #
  1288. # build h2o
  1289. #
  1290. if(ENABLE_H2O)
  1291. add_library(h2o STATIC ${LIBH2O_FILES})
  1292. target_include_directories(h2o BEFORE PUBLIC
  1293. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/include"
  1294. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/cloexec"
  1295. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/brotli/enc"
  1296. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/golombset"
  1297. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/libgkc"
  1298. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/libyrmcds"
  1299. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/klib"
  1300. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/neverbleed"
  1301. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/picohttpparser"
  1302. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/picotest"
  1303. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/yaml/include"
  1304. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/yoml"
  1305. )
  1306. target_compile_options(h2o PRIVATE
  1307. -Wno-all -Wno-extra
  1308. -Wno-shadow
  1309. -Wno-deprecated-declarations
  1310. -Wformat
  1311. )
  1312. target_compile_options(h2o PUBLIC -DH2O_USE_LIBUV=0)
  1313. target_include_directories(h2o BEFORE PRIVATE ${OPENSSL_INCLUDE_DIRS})
  1314. target_compile_options(h2o PRIVATE ${OPENSSL_CFLAGS_OTHER})
  1315. target_link_libraries(h2o PRIVATE ${OPENSSL_LIBRARIES})
  1316. endif()
  1317. #
  1318. # build libjudy
  1319. #
  1320. add_library(judy STATIC ${LIBJUDY_SOURCES})
  1321. target_compile_options(judy PRIVATE
  1322. -Wno-all -Wno-extra
  1323. -Wno-shadow
  1324. -Wformat
  1325. )
  1326. target_compile_definitions(judy PRIVATE
  1327. JUDYL
  1328. $<$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>:JU_64BIT>
  1329. )
  1330. target_include_directories(judy PUBLIC
  1331. src/libnetdata/libjudy/src
  1332. src/libnetdata/libjudy/src/JudyCommon
  1333. )
  1334. set_source_files_properties(${LIBJUDY_PREV_FILES} PROPERTIES COMPILE_OPTIONS "-DJUDYPREV")
  1335. set_source_files_properties(${LIBJUDY_NEXT_FILES} PROPERTIES COMPILE_OPTIONS "-DJUDYNEXT")
  1336. set_source_files_properties(src/libnetdata/libjudy/src/JudyL/j__udyLGet.c PROPERTIES COMPILE_OPTIONS "-DJUDYGETINLINE")
  1337. set_source_files_properties(src/libnetdata/libjudy/src/JudyL/JudyLByCount.c PROPERTIES COMPILE_OPTIONS "-DNOSMARTJBB -DNOSMARTJBU -DNOSMARTJLB")
  1338. set_source_files_properties(JudyLTables.c PROPERTIES COMPILE_OPTIONS "-I${CMAKE_SOURCE_DIR}/src/libnetdata/libjudy/src/JudyL")
  1339. #
  1340. # build libnetdata
  1341. #
  1342. if(LINUX)
  1343. include(NetdataDetectSystemd)
  1344. detect_systemd()
  1345. endif()
  1346. add_library(libnetdata STATIC ${LIBNETDATA_FILES})
  1347. target_include_directories(libnetdata BEFORE PUBLIC ${CONFIG_H_DIR} ${CMAKE_SOURCE_DIR}/src)
  1348. # pthread (FIXME: use find_package for this)
  1349. # set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
  1350. # set(THREADS_PREFER_PTHREAD_FLAG TRUE)
  1351. # find_package(Threads REQUIRED)
  1352. # add_executable(test test.cpp)
  1353. # target_link_libraries(test Threads::Threads)
  1354. target_link_libraries(libnetdata PUBLIC
  1355. "$<$<NOT:$<BOOL:${HAVE_BUILTIN_ATOMICS}>>:atomic>"
  1356. "$<$<OR:$<BOOL:${LINUX}>,$<BOOL:${FREEBSD}>>:pthread;rt>"
  1357. "$<$<BOOL:${LINK_LIBM}>:m>"
  1358. "${SYSTEMD_LDFLAGS}")
  1359. # ebpf
  1360. if(ENABLE_PLUGIN_EBPF)
  1361. netdata_add_libbpf_to_target(libnetdata)
  1362. endif()
  1363. # judy
  1364. target_link_libraries(libnetdata PUBLIC judy)
  1365. netdata_add_jsonc_to_target(libnetdata)
  1366. netdata_add_libyaml_to_target(libnetdata)
  1367. # zlib
  1368. if(MACOS)
  1369. find_package(ZLIB REQUIRED)
  1370. target_include_directories(libnetdata BEFORE PUBLIC ${ZLIB_INCLUDE_DIRS})
  1371. target_link_libraries(libnetdata PUBLIC ZLIB::ZLIB)
  1372. else()
  1373. pkg_check_modules(ZLIB REQUIRED zlib)
  1374. target_include_directories(libnetdata BEFORE PUBLIC ${ZLIB_INCLUDE_DIRS})
  1375. target_compile_definitions(libnetdata PUBLIC ${ZLIB_CFLAGS_OTHER})
  1376. target_link_libraries(libnetdata PUBLIC ${ZLIB_LDFLAGS})
  1377. endif()
  1378. # lz4 - try to find a version that is compatible with streaming compression
  1379. # otherwise pick whichever one we can find to support dbengine but don't set
  1380. # ENABLE_LZ4.
  1381. pkg_check_modules(LIBLZ4 liblz4>=1.9.0)
  1382. if(LIBLZ4_FOUND)
  1383. set(ENABLE_LZ4 On)
  1384. else()
  1385. pkg_check_modules(LIBLZ4 REQUIRED liblz4)
  1386. endif()
  1387. target_include_directories(libnetdata BEFORE PUBLIC ${LIBLZ4_INCLUDE_DIRS})
  1388. target_compile_definitions(libnetdata PUBLIC ${LIBLZ4_CFLAGS_OTHER})
  1389. target_link_libraries(libnetdata PUBLIC ${LIBLZ4_LDFLAGS})
  1390. # zstd
  1391. pkg_check_modules(LIBZSTD libzstd)
  1392. if(LIBZSTD_FOUND)
  1393. set(ENABLE_ZSTD On)
  1394. target_include_directories(libnetdata BEFORE PUBLIC ${LIBZSTD_INCLUDE_DIRS})
  1395. target_compile_definitions(libnetdata PUBLIC ${LIBZSTD_CFLAGS_OTHER})
  1396. target_link_libraries(libnetdata PUBLIC ${LIBZSTD_LDFLAGS})
  1397. endif()
  1398. # brotli
  1399. pkg_check_modules(LIBBROTLI libbrotlidec libbrotlienc libbrotlicommon)
  1400. if(LIBBROTLI_FOUND)
  1401. set(ENABLE_BROTLI On)
  1402. target_include_directories(libnetdata PUBLIC ${LIBBROTLI_INCLUDE_DIRS})
  1403. target_compile_definitions(libnetdata PUBLIC ${LIBBROTLI_CFLAGS_OTHER})
  1404. target_link_libraries(libnetdata PUBLIC ${LIBBROTLI_LDFLAGS})
  1405. endif()
  1406. # uuid
  1407. if(MACOS)
  1408. # UUID functionality is part of the system libraries here, so no extra
  1409. # stuff needed.
  1410. else()
  1411. pkg_check_modules(UUID REQUIRED uuid)
  1412. target_include_directories(libnetdata BEFORE PUBLIC ${UUID_INCLUDE_DIRS})
  1413. target_compile_definitions(libnetdata PUBLIC ${UUID_CFLAGS_OTHER})
  1414. target_link_libraries(libnetdata PUBLIC ${UUID_LDFLAGS})
  1415. endif()
  1416. # uv
  1417. pkg_check_modules(LIBUV REQUIRED libuv)
  1418. target_include_directories(libnetdata BEFORE PUBLIC ${LIBUV_INCLUDE_DIRS})
  1419. target_compile_definitions(libnetdata PUBLIC ${LIBUV_CFLAGS_OTHER})
  1420. target_link_libraries(libnetdata PUBLIC ${LIBUV_LDFLAGS})
  1421. # crypto
  1422. target_include_directories(libnetdata BEFORE PUBLIC ${CRYPTO_INCLUDE_DIRS})
  1423. target_compile_options(libnetdata PUBLIC ${CRYPTO_CFLAGS_OTHER})
  1424. target_link_libraries(libnetdata PUBLIC ${CRYPTO_LDFLAGS})
  1425. # openssl
  1426. target_include_directories(libnetdata BEFORE PUBLIC ${OPENSSL_INCLUDE_DIRS})
  1427. target_compile_options(libnetdata PUBLIC ${OPENSSL_CFLAGS_OTHER})
  1428. target_link_libraries(libnetdata PUBLIC ${OPENSSL_LDFLAGS})
  1429. # mnl
  1430. if(NOT MACOS)
  1431. pkg_check_modules(MNL libmnl)
  1432. if(MNL_FOUND)
  1433. set(HAVE_LIBMNL True)
  1434. endif()
  1435. endif()
  1436. #
  1437. # mqtt library
  1438. #
  1439. if (ENABLE_H2O OR ENABLE_ACLK)
  1440. set(ENABLE_MQTTWEBSOCKETS True)
  1441. endif()
  1442. if(ENABLE_MQTTWEBSOCKETS)
  1443. # include_directories(BEFORE
  1444. # ${CMAKE_SOURCE_DIR}/aclk/mqtt_websockets/src/include
  1445. # ${CMAKE_SOURCE_DIR}/aclk/mqtt_websockets/c-rbuf/include
  1446. # ${CMAKE_SOURCE_DIR}/aclk/mqtt_websockets/c_rhash/include
  1447. # )
  1448. add_library(mqttwebsockets STATIC ${MQTT_WEBSOCKETS_FILES})
  1449. target_compile_options(mqttwebsockets PUBLIC -DMQTT_WSS_CUSTOM_ALLOC
  1450. -DRBUF_CUSTOM_MALLOC
  1451. -DMQTT_WSS_CPUSTATS)
  1452. target_include_directories(mqttwebsockets PUBLIC ${CMAKE_SOURCE_DIR}/aclk/helpers
  1453. ${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/include)
  1454. target_link_libraries(mqttwebsockets PRIVATE libnetdata)
  1455. endif()
  1456. if(ENABLE_ACLK)
  1457. #
  1458. # proto definitions
  1459. #
  1460. netdata_protoc_generate_cpp("${CMAKE_SOURCE_DIR}/src/aclk/aclk-schemas"
  1461. "${CMAKE_SOURCE_DIR}/src/aclk/aclk-schemas"
  1462. ACLK_PROTO_BUILT_SRCS
  1463. ACLK_PROTO_BUILT_HDRS
  1464. ${ACLK_PROTO_DEFS})
  1465. list(APPEND ACLK_FILES ${ACLK_PROTO_BUILT_SRCS}
  1466. ${ACLK_PROTO_BUILT_HDRS})
  1467. endif()
  1468. #
  1469. # build plugins
  1470. #
  1471. if(ENABLE_PLUGIN_DEBUGFS)
  1472. pkg_check_modules(CAP QUIET libcap)
  1473. set(DEBUGFS_PLUGIN_FILES src/collectors/debugfs.plugin/debugfs_plugin.c
  1474. src/collectors/debugfs.plugin/debugfs_plugin.h
  1475. src/collectors/debugfs.plugin/debugfs_extfrag.c
  1476. src/collectors/debugfs.plugin/debugfs_zswap.c
  1477. src/collectors/debugfs.plugin/sys_devices_virtual_powercap.c)
  1478. add_executable(debugfs.plugin ${DEBUGFS_PLUGIN_FILES})
  1479. target_link_libraries(debugfs.plugin libnetdata ${CAP_LIBRARIES})
  1480. target_include_directories(debugfs.plugin PRIVATE ${CAP_INCLUDE_DIRS})
  1481. target_compile_options(debugfs.plugin PRIVATE ${CAP_CFLAGS_OTHER})
  1482. install(TARGETS debugfs.plugin
  1483. COMPONENT plugin-debugfs
  1484. DESTINATION usr/libexec/netdata/plugins.d)
  1485. if(BUILD_FOR_PACKAGING)
  1486. install(FILES
  1487. packaging/cmake/control/copyright
  1488. COMPONENT plugin-debugfs
  1489. DESTINATION usr/share/doc/netdata-plugin-debugfs)
  1490. endif()
  1491. endif()
  1492. if(ENABLE_PLUGIN_APPS)
  1493. pkg_check_modules(CAP QUIET libcap)
  1494. set(APPS_PLUGIN_FILES
  1495. src/collectors/apps.plugin/apps_plugin.c
  1496. src/collectors/apps.plugin/apps_plugin.h
  1497. src/collectors/apps.plugin/apps_functions.c
  1498. src/collectors/apps.plugin/apps_targets.c
  1499. src/collectors/apps.plugin/apps_users_and_groups.c
  1500. src/collectors/apps.plugin/apps_output.c
  1501. src/collectors/apps.plugin/apps_proc_pid_status.c
  1502. src/collectors/apps.plugin/apps_proc_pid_limits.c
  1503. src/collectors/apps.plugin/apps_proc_pid_stat.c
  1504. src/collectors/apps.plugin/apps_proc_pid_cmdline.c
  1505. src/collectors/apps.plugin/apps_proc_pid_io.c
  1506. src/collectors/apps.plugin/apps_proc_stat.c
  1507. src/collectors/apps.plugin/apps_proc_pid_fd.c
  1508. src/collectors/apps.plugin/apps_proc_pids.c
  1509. src/collectors/apps.plugin/apps_proc_meminfo.c
  1510. )
  1511. add_executable(apps.plugin ${APPS_PLUGIN_FILES})
  1512. target_link_libraries(apps.plugin libnetdata ${CAP_LIBRARIES})
  1513. target_include_directories(apps.plugin PRIVATE ${CAP_INCLUDE_DIRS})
  1514. target_compile_options(apps.plugin PRIVATE ${CAP_CFLAGS_OTHER})
  1515. install(TARGETS apps.plugin
  1516. COMPONENT plugin-apps
  1517. DESTINATION usr/libexec/netdata/plugins.d)
  1518. install(FILES src/collectors/apps.plugin/apps_groups.conf
  1519. COMPONENT plugin-apps
  1520. DESTINATION usr/lib/netdata/conf.d)
  1521. if(BUILD_FOR_PACKAGING)
  1522. install(FILES
  1523. packaging/cmake/control/copyright
  1524. COMPONENT plugin-apps
  1525. DESTINATION usr/share/doc/netdata-plugin-apps)
  1526. endif()
  1527. endif()
  1528. if(CAP_FOUND)
  1529. set(HAVE_CAPABILITY True)
  1530. endif()
  1531. if(ENABLE_PLUGIN_FREEIPMI)
  1532. pkg_check_modules(IPMI REQUIRED libipmimonitoring)
  1533. set(FREEIPMI_PLUGIN_FILES src/collectors/freeipmi.plugin/freeipmi_plugin.c)
  1534. add_executable(freeipmi.plugin ${FREEIPMI_PLUGIN_FILES})
  1535. target_link_libraries (freeipmi.plugin libnetdata ${IPMI_LIBRARIES})
  1536. target_include_directories(freeipmi.plugin PRIVATE ${IPMI_INCLUDE_DIRS})
  1537. target_compile_options(freeipmi.plugin PRIVATE ${IPMI_CFLAGS_OTHER})
  1538. install(TARGETS freeipmi.plugin
  1539. COMPONENT plugin-freeipmi
  1540. DESTINATION usr/libexec/netdata/plugins.d)
  1541. if(BUILD_FOR_PACKAGING)
  1542. install(FILES
  1543. packaging/cmake/control/copyright
  1544. COMPONENT plugin-freeipmi
  1545. DESTINATION usr/share/doc/netdata-plugin-freeipmi)
  1546. endif()
  1547. endif()
  1548. if(ENABLE_PLUGIN_NFACCT)
  1549. if (NOT MNL_FOUND)
  1550. message(FATAL_ERROR "Can not build nfacct.plugin because MNL library could not be found.")
  1551. endif()
  1552. pkg_check_modules(NFACCT REQUIRED libnetfilter_acct)
  1553. set(NFACCT_PLUGIN_FILES src/collectors/nfacct.plugin/plugin_nfacct.c)
  1554. add_executable(nfacct.plugin ${NFACCT_PLUGIN_FILES})
  1555. target_link_libraries (nfacct.plugin libnetdata ${MNL_LIBRARIES} ${NFACCT_LIBRARIES})
  1556. target_include_directories(nfacct.plugin PRIVATE ${MNL_INCLUDE_DIRS} ${NFACCT_INCLUDE_DIRS})
  1557. target_compile_options(nfacct.plugin PRIVATE ${MNL_CFLAGS_OTHER} ${NFACCT_CFLAGS_OTHER})
  1558. install(TARGETS nfacct.plugin
  1559. COMPONENT plugin-nfacct
  1560. DESTINATION usr/libexec/netdata/plugins.d)
  1561. if(BUILD_FOR_PACKAGING)
  1562. install(FILES
  1563. packaging/cmake/control/copyright
  1564. COMPONENT plugin-nfacct
  1565. DESTINATION usr/share/doc/netdata-plugin-nfacct)
  1566. endif()
  1567. endif()
  1568. if(ENABLE_PLUGIN_XENSTAT)
  1569. pkg_check_modules(XENSTAT REQUIRED xenstat)
  1570. pkg_check_modules(XENLIGHT REQUIRED xenlight)
  1571. set(XENSTAT_PLUGIN_FILES src/collectors/xenstat.plugin/xenstat_plugin.c)
  1572. add_executable(xenstat.plugin ${XENSTAT_PLUGIN_FILES})
  1573. target_link_libraries (xenstat.plugin libnetdata ${XENLIGHT_LIBRARIES} ${XENSTAT_LIBRARIES})
  1574. target_include_directories(xenstat.plugin PRIVATE ${XENLIGHT_INCLUDE_DIRS} ${XENSTAT_INCLUDE_DIRS})
  1575. target_compile_options(xenstat.plugin PRIVATE ${XENLIGHT_CFLAGS_OTHER} ${XENSTAT_CFLAGS_OTHER})
  1576. install(TARGETS xenstat.plugin
  1577. COMPONENT plugin-xenstat
  1578. DESTINATION usr/libexec/netdata/plugins.d)
  1579. if(BUILD_FOR_PACKAGING)
  1580. install(FILES
  1581. packaging/cmake/control/copyright
  1582. COMPONENT plugin-xenstat
  1583. DESTINATION usr/share/doc/netdata-plugin-xenstat)
  1584. endif()
  1585. endif()
  1586. if(ENABLE_PLUGIN_PERF)
  1587. set(PERF_PLUGIN_FILES src/collectors/perf.plugin/perf_plugin.c)
  1588. add_executable(perf.plugin ${PERF_PLUGIN_FILES})
  1589. target_link_libraries(perf.plugin libnetdata)
  1590. install(TARGETS perf.plugin
  1591. COMPONENT plugin-perf
  1592. DESTINATION usr/libexec/netdata/plugins.d)
  1593. if(BUILD_FOR_PACKAGING)
  1594. install(FILES
  1595. packaging/cmake/control/copyright
  1596. COMPONENT plugin-perf
  1597. DESTINATION usr/share/doc/netdata-plugin-perf)
  1598. endif()
  1599. endif()
  1600. if(ENABLE_PLUGIN_SLABINFO)
  1601. set(SLABINFO_PLUGIN_FILES src/collectors/slabinfo.plugin/slabinfo.c)
  1602. add_executable(slabinfo.plugin ${SLABINFO_PLUGIN_FILES})
  1603. target_link_libraries(slabinfo.plugin libnetdata)
  1604. install(TARGETS slabinfo.plugin
  1605. COMPONENT plugin-slabinfo
  1606. DESTINATION usr/libexec/netdata/plugins.d)
  1607. if(BUILD_FOR_PACKAGING)
  1608. install(FILES
  1609. packaging/cmake/control/copyright
  1610. COMPONENT plugin-slabinfo
  1611. DESTINATION usr/share/doc/netdata-plugin-slabinfo)
  1612. endif()
  1613. endif()
  1614. if(ENABLE_PLUGIN_LOGS_MANAGEMENT)
  1615. set(ENABLE_LOGSMANAGEMENT True)
  1616. if(ENABLE_LOGS_MANAGEMENT_TESTS)
  1617. list(APPEND LOGS_MANAGEMENT_PLUGIN_FILES src/logsmanagement/unit_test/unit_test.c
  1618. src/logsmanagement/unit_test/unit_test.h)
  1619. set(ENABLE_LOGSMANAGEMENT_TESTS True)
  1620. endif()
  1621. add_executable(logs-management.plugin ${LOGS_MANAGEMENT_PLUGIN_FILES})
  1622. target_link_libraries(logs-management.plugin libnetdata)
  1623. install(TARGETS logs-management.plugin
  1624. COMPONENT plugin-logs-management
  1625. DESTINATION usr/libexec/netdata/plugins.d)
  1626. install(DIRECTORY src/logsmanagement/stock_conf/logsmanagement.d
  1627. COMPONENT plugin-logs-management
  1628. DESTINATION usr/lib/netdata/conf.d)
  1629. install(DIRECTORY
  1630. COMPONENT plugin-logs-management
  1631. DESTINATION etc/netdata/logsmanagement.d)
  1632. configure_file(src/logsmanagement/stock_conf/logsmanagement.d.conf.in
  1633. src/logsmanagement/stock_conf/logsmanagement.d.conf
  1634. @ONLY)
  1635. install(FILES ${CMAKE_BINARY_DIR}/src/logsmanagement/stock_conf/logsmanagement.d.conf
  1636. COMPONENT plugin-logs-management
  1637. DESTINATION usr/lib/netdata/conf.d)
  1638. if(BUILD_FOR_PACKAGING)
  1639. install(FILES
  1640. packaging/cmake/control/copyright
  1641. COMPONENT plugin-logs-management
  1642. DESTINATION usr/share/doc/netdata-plugin-logs-management)
  1643. endif()
  1644. endif()
  1645. if(ENABLE_PLUGIN_CUPS)
  1646. pkg_check_modules(CUPS libcups)
  1647. if(NOT CUPS_LIBRARIES)
  1648. pkg_check_modules(CUPS cups)
  1649. if(NOT CUPS_LIBRARIES)
  1650. find_program(CUPS_CONFIG cups-config)
  1651. if(CUPS_CONFIG)
  1652. execute_process(COMMAND ${CUPS_CONFIG} --api-version OUTPUT_VARIABLE CUPS_API_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
  1653. if(CUPS_API_VERSION VERSION_LESS "1.7")
  1654. set(CUPS_FOUND False)
  1655. else()
  1656. execute_process(COMMAND ${CUPS_CONFIG} --cflags OUTPUT_VARIABLE CUPS_CFLAGS_OTHER OUTPUT_STRIP_TRAILING_WHITESPACE)
  1657. execute_process(COMMAND ${CUPS_CONFIG} --libs OUTPUT_VARIABLE CUPS_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE)
  1658. set(CUPS_FOUND True)
  1659. endif()
  1660. endif()
  1661. endif()
  1662. endif()
  1663. if(NOT CUPS_FOUND)
  1664. message(WARNING "Could not find cups cflags and libs.")
  1665. else()
  1666. set(CUPS_PLUGIN_FILES src/collectors/cups.plugin/cups_plugin.c)
  1667. add_executable(cups.plugin ${CUPS_PLUGIN_FILES})
  1668. target_link_libraries (cups.plugin libnetdata ${CUPS_LIBRARIES})
  1669. target_compile_options(cups.plugin PRIVATE ${CUPS_CFLAGS_OTHER})
  1670. install(TARGETS cups.plugin
  1671. COMPONENT plugin-cups
  1672. DESTINATION usr/libexec/netdata/plugins.d)
  1673. if(BUILD_FOR_PACKAGING)
  1674. install(FILES
  1675. packaging/cmake/control/copyright
  1676. COMPONENT plugin-cups
  1677. DESTINATION usr/share/doc/netdata-plugin-cups)
  1678. endif()
  1679. endif()
  1680. endif()
  1681. set(NDSUDO_FILES src/collectors/plugins.d/ndsudo.c)
  1682. add_executable(ndsudo ${NDSUDO_FILES})
  1683. install(TARGETS ndsudo
  1684. COMPONENT netdata
  1685. DESTINATION usr/libexec/netdata/plugins.d)
  1686. if(ENABLE_PLUGIN_CGROUP_NETWORK)
  1687. set(CGROUP_NETWORK_FILES src/collectors/cgroups.plugin/cgroup-network.c)
  1688. add_executable(cgroup-network ${CGROUP_NETWORK_FILES})
  1689. target_link_libraries(cgroup-network libnetdata)
  1690. install(TARGETS cgroup-network
  1691. COMPONENT netdata
  1692. DESTINATION usr/libexec/netdata/plugins.d)
  1693. endif()
  1694. if(ENABLE_PLUGIN_SYSTEMD_JOURNAL)
  1695. if(NOT SYSTEMD_FOUND)
  1696. message(FATAL_ERROR "Systemd journal plugin requires systemd, but systemd was not found.")
  1697. endif()
  1698. add_executable(systemd-journal.plugin ${SYSTEMD_JOURNAL_PLUGIN_FILES})
  1699. target_link_libraries(systemd-journal.plugin libnetdata)
  1700. install(TARGETS systemd-journal.plugin
  1701. COMPONENT plugin-systemd-journal
  1702. DESTINATION usr/libexec/netdata/plugins.d)
  1703. if(BUILD_FOR_PACKAGING)
  1704. install(FILES
  1705. packaging/cmake/control/copyright
  1706. COMPONENT plugin-systemd-journal
  1707. DESTINATION usr/share/doc/netdata-plugin-systemd-journal)
  1708. endif()
  1709. endif()
  1710. if(ENABLE_PLUGIN_EBPF)
  1711. set(EBPF_PLUGIN_FILES
  1712. src/collectors/ebpf.plugin/ebpf.c
  1713. src/collectors/ebpf.plugin/ebpf.h
  1714. src/collectors/ebpf.plugin/ebpf_cachestat.c
  1715. src/collectors/ebpf.plugin/ebpf_cachestat.h
  1716. src/collectors/ebpf.plugin/ebpf_dcstat.c
  1717. src/collectors/ebpf.plugin/ebpf_dcstat.h
  1718. src/collectors/ebpf.plugin/ebpf_disk.c
  1719. src/collectors/ebpf.plugin/ebpf_disk.h
  1720. src/collectors/ebpf.plugin/ebpf_fd.c
  1721. src/collectors/ebpf.plugin/ebpf_fd.h
  1722. src/collectors/ebpf.plugin/ebpf_hardirq.c
  1723. src/collectors/ebpf.plugin/ebpf_hardirq.h
  1724. src/collectors/ebpf.plugin/ebpf_mdflush.c
  1725. src/collectors/ebpf.plugin/ebpf_mdflush.h
  1726. src/collectors/ebpf.plugin/ebpf_mount.c
  1727. src/collectors/ebpf.plugin/ebpf_mount.h
  1728. src/collectors/ebpf.plugin/ebpf_filesystem.c
  1729. src/collectors/ebpf.plugin/ebpf_filesystem.h
  1730. src/collectors/ebpf.plugin/ebpf_oomkill.c
  1731. src/collectors/ebpf.plugin/ebpf_oomkill.h
  1732. src/collectors/ebpf.plugin/ebpf_process.c
  1733. src/collectors/ebpf.plugin/ebpf_process.h
  1734. src/collectors/ebpf.plugin/ebpf_shm.c
  1735. src/collectors/ebpf.plugin/ebpf_shm.h
  1736. src/collectors/ebpf.plugin/ebpf_socket.c
  1737. src/collectors/ebpf.plugin/ebpf_socket.h
  1738. src/collectors/ebpf.plugin/ebpf_softirq.c
  1739. src/collectors/ebpf.plugin/ebpf_softirq.h
  1740. src/collectors/ebpf.plugin/ebpf_sync.c
  1741. src/collectors/ebpf.plugin/ebpf_sync.h
  1742. src/collectors/ebpf.plugin/ebpf_swap.c
  1743. src/collectors/ebpf.plugin/ebpf_swap.h
  1744. src/collectors/ebpf.plugin/ebpf_vfs.c
  1745. src/collectors/ebpf.plugin/ebpf_vfs.h
  1746. src/collectors/ebpf.plugin/ebpf_apps.c
  1747. src/collectors/ebpf.plugin/ebpf_apps.h
  1748. src/collectors/ebpf.plugin/ebpf_cgroup.c
  1749. src/collectors/ebpf.plugin/ebpf_cgroup.h
  1750. src/collectors/ebpf.plugin/ebpf_unittest.c
  1751. src/collectors/ebpf.plugin/ebpf_unittest.h
  1752. src/collectors/ebpf.plugin/ebpf_functions.c
  1753. src/collectors/ebpf.plugin/ebpf_functions.h
  1754. )
  1755. add_executable(ebpf.plugin ${EBPF_PLUGIN_FILES})
  1756. target_link_libraries(ebpf.plugin libnetdata)
  1757. netdata_add_ebpf_co_re_to_target(ebpf.plugin)
  1758. install(TARGETS ebpf.plugin
  1759. COMPONENT plugin-ebpf
  1760. DESTINATION usr/libexec/netdata/plugins.d)
  1761. install(FILES
  1762. src/collectors/ebpf.plugin/ebpf.d.conf
  1763. COMPONENT plugin-ebpf
  1764. DESTINATION usr/lib/netdata/conf.d)
  1765. install(FILES
  1766. src/collectors/ebpf.plugin/ebpf.d/cachestat.conf
  1767. src/collectors/ebpf.plugin/ebpf.d/dcstat.conf
  1768. src/collectors/ebpf.plugin/ebpf.d/disk.conf
  1769. src/collectors/ebpf.plugin/ebpf.d/ebpf_kernel_reject_list.txt
  1770. src/collectors/ebpf.plugin/ebpf.d/fd.conf
  1771. src/collectors/ebpf.plugin/ebpf.d/filesystem.conf
  1772. src/collectors/ebpf.plugin/ebpf.d/hardirq.conf
  1773. src/collectors/ebpf.plugin/ebpf.d/mdflush.conf
  1774. src/collectors/ebpf.plugin/ebpf.d/mount.conf
  1775. src/collectors/ebpf.plugin/ebpf.d/network.conf
  1776. src/collectors/ebpf.plugin/ebpf.d/oomkill.conf
  1777. src/collectors/ebpf.plugin/ebpf.d/process.conf
  1778. src/collectors/ebpf.plugin/ebpf.d/shm.conf
  1779. src/collectors/ebpf.plugin/ebpf.d/softirq.conf
  1780. src/collectors/ebpf.plugin/ebpf.d/swap.conf
  1781. src/collectors/ebpf.plugin/ebpf.d/sync.conf
  1782. src/collectors/ebpf.plugin/ebpf.d/vfs.conf
  1783. COMPONENT plugin-ebpf
  1784. DESTINATION usr/lib/netdata/conf.d/ebpf.d)
  1785. if(BUILD_FOR_PACKAGING)
  1786. install(FILES
  1787. packaging/cmake/control/copyright
  1788. COMPONENT plugin-ebpf
  1789. DESTINATION usr/share/doc/netdata-plugin-ebpf)
  1790. endif()
  1791. if(ENABLE_LEGACY_EBPF_PROGRAMS)
  1792. netdata_install_legacy_ebpf_code()
  1793. endif()
  1794. endif()
  1795. if(ENABLE_PLUGIN_LOCAL_LISTENERS)
  1796. set(LOCAL_LISTENERS_FILES
  1797. src/collectors/plugins.d/local_listeners.c
  1798. src/libnetdata/maps/local-sockets.h
  1799. )
  1800. add_executable(local-listeners ${LOCAL_LISTENERS_FILES})
  1801. target_compile_options(local-listeners PRIVATE
  1802. "$<$<BOOL:${MNL_FOUND}>:${MNL_CFLAGS_OTHER}>")
  1803. target_include_directories(local-listeners PRIVATE
  1804. "$<$<BOOL:${MNL_FOUND}>:${MNL_INCLUDE_DIRS}>")
  1805. target_link_libraries(local-listeners libnetdata
  1806. "$<$<BOOL:${MNL_FOUND}>:${MNL_LIBRARIES}>")
  1807. install(TARGETS local-listeners
  1808. COMPONENT netdata
  1809. DESTINATION usr/libexec/netdata/plugins.d)
  1810. endif()
  1811. if(ENABLE_PLUGIN_NETWORK_VIEWER)
  1812. set(NETWORK_VIEWER_FILES
  1813. src/libnetdata/maps/local-sockets.h
  1814. src/libnetdata/maps/system-users.h
  1815. src/collectors/network-viewer.plugin/network-viewer.c
  1816. )
  1817. add_executable(network-viewer.plugin ${NETWORK_VIEWER_FILES})
  1818. target_compile_options(network-viewer.plugin PRIVATE
  1819. "$<$<BOOL:${MNL_FOUND}>:${MNL_CFLAGS_OTHER}>")
  1820. target_include_directories(network-viewer.plugin PRIVATE
  1821. "$<$<BOOL:${MNL_FOUND}>:${MNL_INCLUDE_DIRS}>")
  1822. target_link_libraries(network-viewer.plugin libnetdata
  1823. "$<$<BOOL:${MNL_FOUND}>:${MNL_LIBRARIES}>")
  1824. install(TARGETS network-viewer.plugin
  1825. COMPONENT plugin-network-viewer
  1826. DESTINATION usr/libexec/netdata/plugins.d)
  1827. if(BUILD_FOR_PACKAGING)
  1828. install(FILES
  1829. packaging/cmake/control/copyright
  1830. COMPONENT plugin-network-viewer
  1831. DESTINATION usr/share/doc/netdata-plugin-network-viewer)
  1832. endif()
  1833. endif()
  1834. #
  1835. # exporters
  1836. #
  1837. if(ENABLE_EXPORTER_MONGODB)
  1838. pkg_check_modules(MONGOC libmongoc-1.0>=1.7)
  1839. if(MONGOC_FOUND)
  1840. SET(HAVE_MONGOC True)
  1841. else()
  1842. SET(ENABLE_EXPORTER_MONGODB False)
  1843. endif()
  1844. endif()
  1845. if(ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE)
  1846. pkg_check_modules(SNAPPY snappy)
  1847. if (NOT SNAPPY_FOUND)
  1848. include(CheckLibraryExists)
  1849. check_library_exists(snappy snappy_compress "" HAVE_SNAPPY_LIB)
  1850. if(HAVE_SNAPPY_LIB)
  1851. set(SNAPPY_INCLUDE_DIRS "")
  1852. set(SNAPPY_CFLAGS_OTHER "")
  1853. set(SNAPPY_LIBRARIES "-lsnappy")
  1854. else()
  1855. message(FATAL_ERROR "Could not find snappy libraries with pkg-config or internal cmake checks.")
  1856. endif()
  1857. endif()
  1858. netdata_protoc_generate_cpp("${CMAKE_SOURCE_DIR}/src/exporting/prometheus/remote_write"
  1859. "${CMAKE_SOURCE_DIR}/src/exporting/prometheus/remote_write"
  1860. PROMETHEUS_REMOTE_WRITE_BUILT_SRCS
  1861. PROMETHEUS_REMOTE_WRITE_BUILT_HDRS
  1862. "src/exporting/prometheus/remote_write/remote_write.proto")
  1863. list(APPEND PROMETHEUS_REMOTE_WRITE_EXPORTING_FILES
  1864. ${PROMETHEUS_REMOTE_WRITE_BUILT_SRCS}
  1865. ${PROMETHEUS_REMOTE_WRITE_BUILT_HDRS})
  1866. set(ENABLE_PROMETHEUS_REMOTE_WRITE True)
  1867. endif()
  1868. #
  1869. # build netdata (only Linux ATM)
  1870. #
  1871. add_executable(netdata
  1872. ${NETDATA_FILES}
  1873. "$<$<BOOL:${ENABLE_ACLK}>:${ACLK_FILES}>"
  1874. "$<$<BOOL:${ENABLE_H2O}>:${H2O_FILES}>"
  1875. "$<$<BOOL:${ENABLE_EXPORTER_MONGODB}>:${MONGODB_EXPORTING_FILES}>"
  1876. "$<$<BOOL:${ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE}>:${PROMETHEUS_REMOTE_WRITE_EXPORTING_FILES}>"
  1877. )
  1878. target_compile_definitions(netdata PRIVATE
  1879. "$<$<BOOL:${ENABLE_ML}>:DLIB_NO_GUI_SUPPORT>"
  1880. "$<$<BOOL:${ENABLE_EXPORTER_MONGODB}>:${MONGOC_CFLAGS_OTHER}>"
  1881. "$<$<BOOL:${ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE}>:${SNAPPY_CFLAGS_OTHER}>"
  1882. )
  1883. target_include_directories(netdata PRIVATE
  1884. "$<$<BOOL:${ENABLE_ACLK}>:${CMAKE_SOURCE_DIR}/src/aclk/aclk-schemas>"
  1885. "$<$<BOOL:${ENABLE_EXPORTER_MONGODB}>:${MONGOC_INCLUDE_DIRS}>"
  1886. "$<$<BOOL:${ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE}>:${SNAPPY_INCLUDE_DIRS}>"
  1887. )
  1888. target_link_libraries(netdata PRIVATE
  1889. m
  1890. libnetdata
  1891. "$<$<BOOL:${LINUX}>:rt>"
  1892. "$<$<BOOL:${ENABLE_MQTTWEBSOCKETS}>:mqttwebsockets>"
  1893. "$<$<BOOL:${ENABLE_EXPORTER_MONGODB}>:${MONGOC_LIBRARIES}>"
  1894. "$<$<BOOL:${ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE}>:${SNAPPY_LIBRARIES}>"
  1895. "$<$<BOOL:${MACOS}>:${IOKIT};${FOUNDATION}>"
  1896. "$<$<BOOL:${ENABLE_SENTRY}>:sentry>"
  1897. "$<$<BOOL:${ENABLE_WEBRTC}>:LibDataChannel::LibDataChannelStatic>"
  1898. "$<$<BOOL:${ENABLE_H2O}>:h2o>"
  1899. )
  1900. if(NEED_PROTOBUF)
  1901. netdata_add_protobuf(netdata)
  1902. endif()
  1903. #
  1904. # build systemd-cat-native
  1905. #
  1906. set(SYSTEMD_CAT_NATIVE_FILES src/libnetdata/log/systemd-cat-native.c
  1907. src/libnetdata/log/systemd-cat-native.h)
  1908. add_executable(systemd-cat-native ${SYSTEMD_CAT_NATIVE_FILES})
  1909. target_link_libraries(systemd-cat-native libnetdata)
  1910. install(TARGETS systemd-cat-native
  1911. COMPONENT netdata
  1912. DESTINATION usr/sbin)
  1913. #
  1914. # build log2journal
  1915. #
  1916. pkg_check_modules(PCRE2 libpcre2-8)
  1917. if(PCRE2_FOUND)
  1918. set(LOG2JOURNAL_FILES
  1919. ${CONFIG_H}
  1920. src/collectors/log2journal/log2journal.h
  1921. src/collectors/log2journal/log2journal.c
  1922. src/collectors/log2journal/log2journal-help.c
  1923. src/collectors/log2journal/log2journal-yaml.c
  1924. src/collectors/log2journal/log2journal-json.c
  1925. src/collectors/log2journal/log2journal-logfmt.c
  1926. src/collectors/log2journal/log2journal-pcre2.c
  1927. src/collectors/log2journal/log2journal-params.c
  1928. src/collectors/log2journal/log2journal-inject.c
  1929. src/collectors/log2journal/log2journal-pattern.c
  1930. src/collectors/log2journal/log2journal-replace.c
  1931. src/collectors/log2journal/log2journal-rename.c
  1932. src/collectors/log2journal/log2journal-rewrite.c
  1933. )
  1934. add_executable(log2journal ${LOG2JOURNAL_FILES})
  1935. target_include_directories(log2journal BEFORE PUBLIC ${CONFIG_H_DIR} ${CMAKE_SOURCE_DIR}/src ${PCRE2_INCLUDE_DIRS})
  1936. target_compile_definitions(log2journal PUBLIC ${PCRE2_CFLAGS_OTHER})
  1937. target_link_libraries(log2journal PUBLIC "${PCRE2_LDFLAGS}")
  1938. netdata_add_libyaml_to_target(log2journal)
  1939. install(TARGETS log2journal
  1940. COMPONENT netdata
  1941. DESTINATION usr/sbin)
  1942. install(DIRECTORY src/collectors/log2journal/log2journal.d
  1943. COMPONENT netdata
  1944. DESTINATION usr/lib/netdata/conf.d)
  1945. endif()
  1946. #
  1947. # build netdatacli
  1948. #
  1949. set(NETDATACLI_FILES
  1950. src/daemon/commands.h
  1951. src/daemon/pipename.c
  1952. src/daemon/pipename.h
  1953. src/cli/cli.c
  1954. )
  1955. add_executable(netdatacli ${NETDATACLI_FILES})
  1956. target_link_libraries(netdatacli libnetdata)
  1957. install(TARGETS netdatacli
  1958. COMPONENT netdata
  1959. DESTINATION usr/sbin)
  1960. #
  1961. # Build go.d.plugin
  1962. #
  1963. if(ENABLE_PLUGIN_GO)
  1964. add_go_target(go-plugin go.d.plugin src/go/collectors/go.d.plugin cmd/godplugin)
  1965. install(PROGRAMS ${CMAKE_BINARY_DIR}/go.d.plugin
  1966. COMPONENT plugin-go
  1967. DESTINATION usr/libexec/netdata/plugins.d)
  1968. endif()
  1969. #
  1970. # Generate config file
  1971. #
  1972. if(NOT CMAKE_INSTALL_PREFIX STREQUAL "")
  1973. string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
  1974. endif()
  1975. set(CACHE_DIR "${CMAKE_INSTALL_PREFIX}/var/cache/netdata")
  1976. set(CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/etc/netdata")
  1977. set(LIBCONFIG_DIR "${CMAKE_INSTALL_PREFIX}/usr/lib/netdata/conf.d")
  1978. set(LOG_DIR "${CMAKE_INSTALL_PREFIX}/var/log/netdata")
  1979. set(PLUGINS_DIR "${CMAKE_INSTALL_PREFIX}/usr/libexec/netdata/plugins.d")
  1980. set(VARLIB_DIR "${CMAKE_INSTALL_PREFIX}/var/lib/netdata")
  1981. # A non-default value is only used when building Debian packages (/var/lib/netdata/www)
  1982. if(NOT DEFINED WEB_DIR)
  1983. set(WEB_DIR "usr/share/netdata/web")
  1984. else()
  1985. string(REGEX REPLACE "^/" "" WEB_DIR "${WEB_DIR}")
  1986. endif()
  1987. set(WEB_DEST "${WEB_DIR}")
  1988. set(WEB_DIR "${CMAKE_INSTALL_PREFIX}/${WEB_DEST}")
  1989. set(CONFIGURE_COMMAND "dummy-configure-command")
  1990. if (NOT NETDATA_USER)
  1991. set(NETDATA_USER "netdata")
  1992. endif()
  1993. set(VERSION "${GIT_DESCRIBE_OUTPUT}")
  1994. configure_file(packaging/cmake/config.cmake.h.in config.h)
  1995. #
  1996. # install
  1997. #
  1998. install(TARGETS netdata COMPONENT netdata DESTINATION usr/sbin)
  1999. install(DIRECTORY COMPONENT netdata DESTINATION var/cache/netdata)
  2000. install(DIRECTORY COMPONENT netdata DESTINATION var/log/netdata)
  2001. install(DIRECTORY COMPONENT netdata DESTINATION var/lib/netdata/registry)
  2002. install(DIRECTORY COMPONENT netdata DESTINATION var/lib/netdata/cloud.d)
  2003. install(DIRECTORY COMPONENT netdata DESTINATION var/run/netdata)
  2004. install(DIRECTORY COMPONENT netdata DESTINATION etc/netdata)
  2005. install(DIRECTORY COMPONENT netdata DESTINATION etc/netdata/custom-plugins.d)
  2006. install(DIRECTORY COMPONENT netdata DESTINATION etc/netdata/go.d)
  2007. install(DIRECTORY COMPONENT netdata DESTINATION etc/netdata/health.d)
  2008. install(DIRECTORY COMPONENT netdata DESTINATION etc/netdata/python.d)
  2009. install(DIRECTORY COMPONENT netdata DESTINATION etc/netdata/ssl)
  2010. install(DIRECTORY COMPONENT netdata DESTINATION etc/netdata/statsd.d)
  2011. install(DIRECTORY COMPONENT netdata DESTINATION usr/lib/netdata/conf.d)
  2012. install(DIRECTORY COMPONENT netdata DESTINATION usr/lib/netdata/conf.d/schema.d)
  2013. install(DIRECTORY COMPONENT netdata DESTINATION usr/libexec/netdata/plugins.d)
  2014. install(DIRECTORY COMPONENT netdata DESTINATION ${WEB_DEST})
  2015. set(libsysdir_POST "${CMAKE_INSTALL_PREFIX}/usr/lib/netdata/system")
  2016. set(pkglibexecdir_POST "${CMAKE_INSTALL_PREFIX}/usr/libexec/netdata")
  2017. set(localstatedir_POST "${CMAKE_INSTALL_PREFIX}/var")
  2018. set(sbindir_POST "${CMAKE_INSTALL_PREFIX}/usr/sbin")
  2019. set(configdir_POST "${CMAKE_INSTALL_PREFIX}/etc/netdata")
  2020. set(libconfigdir_POST "${CMAKE_INSTALL_PREFIX}/usr/lib/netdata/conf.d")
  2021. set(cachedir_POST "${CMAKE_INSTALL_PREFIX}/var/cache/netdata")
  2022. set(registrydir_POST "${CMAKE_INSTALL_PREFIX}/var/lib/netdata/registry")
  2023. set(varlibdir_POST "${CMAKE_INSTALL_PREFIX}/var/lib/netdata")
  2024. set(netdata_user_POST "${NETDATA_USER}")
  2025. # netdata-claim.sh
  2026. if(ENABLE_CLOUD)
  2027. set(enable_cloud_POST "yes")
  2028. else()
  2029. set(enable_cloud_POST "no")
  2030. endif()
  2031. if(ENABLE_ACLK)
  2032. set(enable_aclk_POST "yes")
  2033. else()
  2034. set(enable_aclk_POST "no")
  2035. endif()
  2036. configure_file(src/claim/netdata-claim.sh.in src/claim/netdata-claim.sh @ONLY)
  2037. install(PROGRAMS
  2038. ${CMAKE_BINARY_DIR}/src/claim/netdata-claim.sh
  2039. COMPONENT netdata
  2040. DESTINATION usr/sbin)
  2041. #
  2042. # We don't check ENABLE_PLUGIN_CGROUP_NETWORK because rpm builds assume
  2043. # the files exists unconditionally.
  2044. #
  2045. configure_file(src/collectors/cgroups.plugin/cgroup-network-helper.sh.in
  2046. src/collectors/cgroups.plugin/cgroup-network-helper.sh @ONLY)
  2047. install(PROGRAMS
  2048. ${CMAKE_BINARY_DIR}/src/collectors/cgroups.plugin/cgroup-network-helper.sh
  2049. COMPONENT netdata
  2050. DESTINATION usr/libexec/netdata/plugins.d)
  2051. configure_file(src/collectors/cgroups.plugin/cgroup-name.sh.in
  2052. src/collectors/cgroups.plugin/cgroup-name.sh @ONLY)
  2053. install(PROGRAMS
  2054. ${CMAKE_BINARY_DIR}/src/collectors/cgroups.plugin/cgroup-name.sh
  2055. COMPONENT netdata
  2056. DESTINATION usr/libexec/netdata/plugins.d)
  2057. #
  2058. # statsd
  2059. #
  2060. install(FILES
  2061. src/collectors/statsd.plugin/asterisk.conf
  2062. src/collectors/statsd.plugin/example.conf
  2063. src/collectors/statsd.plugin/k6.conf
  2064. COMPONENT netdata
  2065. DESTINATION usr/lib/netdata/conf.d/statsd.d)
  2066. #
  2067. # exporting
  2068. #
  2069. install(FILES
  2070. src/exporting/exporting.conf
  2071. COMPONENT netdata
  2072. DESTINATION usr/lib/netdata/conf.d)
  2073. #
  2074. # ioping.plugin
  2075. #
  2076. install(FILES
  2077. src/collectors/ioping.plugin/ioping.conf
  2078. COMPONENT netdata
  2079. DESTINATION usr/lib/netdata/conf.d)
  2080. #
  2081. # streaming
  2082. #
  2083. install(FILES
  2084. src/streaming/stream.conf
  2085. COMPONENT netdata
  2086. DESTINATION usr/lib/netdata/conf.d)
  2087. #
  2088. # swagger
  2089. #
  2090. install(FILES
  2091. src/web/api/netdata-swagger.json
  2092. src/web/api/netdata-swagger.yaml
  2093. COMPONENT netdata
  2094. DESTINATION ${WEB_DEST})
  2095. #
  2096. # service files
  2097. #
  2098. configure_file(system/install-service.sh.in system/install-service.sh @ONLY)
  2099. install(PROGRAMS
  2100. ${CMAKE_BINARY_DIR}/system/install-service.sh
  2101. COMPONENT netdata
  2102. DESTINATION usr/libexec/netdata)
  2103. configure_file(system/cron/netdata-updater-daily.in system/cron/netdata-updater-daily @ONLY)
  2104. install(FILES
  2105. ${CMAKE_BINARY_DIR}/system/cron/netdata-updater-daily
  2106. COMPONENT netdata
  2107. DESTINATION usr/lib/netdata/system/cron)
  2108. configure_file(system/launchd/netdata.plist.in system/launchd/netdata.plist @ONLY)
  2109. install(FILES
  2110. ${CMAKE_BINARY_DIR}/system/launchd/netdata.plist
  2111. COMPONENT netdata
  2112. DESTINATION usr/lib/netdata/system/launchd)
  2113. configure_file(system/freebsd/rc.d/netdata.in system/freebsd/rc.d/netdata @ONLY)
  2114. install(PROGRAMS
  2115. ${CMAKE_BINARY_DIR}/system/freebsd/rc.d/netdata
  2116. COMPONENT netdata
  2117. DESTINATION usr/lib/netdata/system/freebsd/rc.d)
  2118. configure_file(system/initd/init.d/netdata.in system/initd/init.d/netdata @ONLY)
  2119. install(PROGRAMS
  2120. ${CMAKE_BINARY_DIR}/system/initd/init.d/netdata
  2121. COMPONENT netdata
  2122. DESTINATION usr/lib/netdata/system/initd/init.d)
  2123. configure_file(system/logrotate/netdata.in system/logrotate/netdata @ONLY)
  2124. install(FILES
  2125. ${CMAKE_BINARY_DIR}/system/logrotate/netdata
  2126. COMPONENT netdata
  2127. DESTINATION usr/lib/netdata/system/logrotate)
  2128. install(FILES
  2129. ${CMAKE_BINARY_DIR}/system/logrotate/netdata
  2130. COMPONENT netdata
  2131. DESTINATION etc/logrotate.d)
  2132. configure_file(system/lsb/init.d/netdata.in system/lsb/init.d/netdata @ONLY)
  2133. install(PROGRAMS
  2134. ${CMAKE_BINARY_DIR}/system/lsb/init.d/netdata
  2135. COMPONENT netdata
  2136. DESTINATION usr/lib/netdata/system/lsb/init.d)
  2137. configure_file(system/openrc/conf.d/netdata.in system/openrc/conf.d/netdata @ONLY)
  2138. install(FILES
  2139. ${CMAKE_BINARY_DIR}/system/openrc/conf.d/netdata
  2140. COMPONENT netdata
  2141. DESTINATION usr/lib/netdata/system/openrc/conf.d)
  2142. configure_file(system/openrc/init.d/netdata.in system/openrc/init.d/netdata @ONLY)
  2143. install(PROGRAMS
  2144. ${CMAKE_BINARY_DIR}/system/openrc/init.d/netdata
  2145. COMPONENT netdata
  2146. DESTINATION usr/lib/netdata/system/openrc/init.d)
  2147. configure_file(system/runit/run.in system/runit/run @ONLY)
  2148. install(PROGRAMS
  2149. ${CMAKE_BINARY_DIR}/system/runit/run
  2150. COMPONENT netdata
  2151. DESTINATION usr/lib/netdata/system/runit)
  2152. configure_file(system/dinit/netdata.in system/dinit/netdata @ONLY)
  2153. install(FILES
  2154. ${CMAKE_BINARY_DIR}/system/dinit/netdata
  2155. COMPONENT netdata
  2156. DESTINATION usr/lib/netdata/system/dinit)
  2157. configure_file(system/systemd/netdata.service.in system/systemd/netdata.service @ONLY)
  2158. install(FILES
  2159. ${CMAKE_BINARY_DIR}/system/systemd/netdata.service
  2160. COMPONENT netdata
  2161. DESTINATION usr/lib/netdata/system/systemd)
  2162. if(BUILD_FOR_PACKAGING)
  2163. install(FILES
  2164. ${CMAKE_BINARY_DIR}/system/systemd/netdata.service
  2165. COMPONENT netdata
  2166. DESTINATION lib/systemd/system)
  2167. endif()
  2168. configure_file(system/systemd/netdata.service.v235.in system/systemd/netdata.service.v235 @ONLY)
  2169. install(FILES
  2170. ${CMAKE_BINARY_DIR}/system/systemd/netdata.service.v235
  2171. COMPONENT netdata
  2172. DESTINATION usr/lib/netdata/system/systemd)
  2173. configure_file(system/systemd/netdata-updater.service.in system/systemd/netdata-updater.service @ONLY)
  2174. install(FILES
  2175. ${CMAKE_BINARY_DIR}/system/systemd/netdata-updater.service
  2176. COMPONENT netdata
  2177. DESTINATION usr/lib/netdata/system/systemd)
  2178. install(FILES
  2179. system/systemd/netdata-updater.timer
  2180. COMPONENT netdata
  2181. DESTINATION usr/lib/netdata/system/systemd)
  2182. install(FILES
  2183. system/systemd/50-netdata.preset
  2184. COMPONENT netdata
  2185. DESTINATION usr/lib/netdata/system/systemd)
  2186. install(FILES
  2187. system/vnodes/vnodes.conf
  2188. COMPONENT netdata
  2189. DESTINATION usr/lib/netdata/conf.d/vnodes)
  2190. install(FILES
  2191. system/.install-type
  2192. COMPONENT netdata
  2193. DESTINATION etc/netdata)
  2194. install(PROGRAMS
  2195. system/edit-config
  2196. COMPONENT netdata
  2197. DESTINATION etc/netdata)
  2198. if(BUILD_FOR_PACKAGING)
  2199. set(NETDATA_CONF_DEST "etc/netdata")
  2200. else()
  2201. set(NETDATA_CONF_DEST "usr/lib/netdata/conf.d")
  2202. endif()
  2203. install(FILES
  2204. system/netdata.conf
  2205. system/netdata-updater.conf
  2206. COMPONENT netdata
  2207. DESTINATION ${NETDATA_CONF_DEST})
  2208. #
  2209. # misc files
  2210. #
  2211. if(BUILD_FOR_PACKAGING)
  2212. install(FILES
  2213. packaging/cmake/control/netdata/etc/default/netdata
  2214. COMPONENT netdata
  2215. DESTINATION etc/default)
  2216. endif()
  2217. if(BUILD_FOR_PACKAGING)
  2218. install(PROGRAMS
  2219. packaging/cmake/control/netdata/etc/init.d/netdata
  2220. COMPONENT netdata
  2221. DESTINATION etc/init.d)
  2222. endif()
  2223. install(PROGRAMS
  2224. packaging/installer/netdata-updater.sh
  2225. COMPONENT netdata
  2226. DESTINATION usr/libexec/netdata)
  2227. #
  2228. # TODO: check the following files for correct substitutions
  2229. #
  2230. configure_file(src/daemon/anonymous-statistics.sh.in src/daemon/anonymous-statistics.sh @ONLY)
  2231. install(PROGRAMS
  2232. ${CMAKE_BINARY_DIR}/src/daemon/anonymous-statistics.sh
  2233. COMPONENT netdata
  2234. DESTINATION usr/libexec/netdata/plugins.d)
  2235. configure_file(src/daemon/get-kubernetes-labels.sh.in src/daemon/get-kubernetes-labels.sh @ONLY)
  2236. install(PROGRAMS
  2237. ${CMAKE_BINARY_DIR}/src/daemon/get-kubernetes-labels.sh
  2238. COMPONENT netdata
  2239. DESTINATION usr/libexec/netdata/plugins.d)
  2240. install(PROGRAMS
  2241. src/daemon/system-info.sh
  2242. COMPONENT netdata
  2243. DESTINATION usr/libexec/netdata/plugins.d)
  2244. #
  2245. # health files
  2246. #
  2247. file(GLOB_RECURSE HEALTH_CONF_FILES "src/health/health.d/*.conf")
  2248. install(FILES
  2249. ${HEALTH_CONF_FILES}
  2250. COMPONENT netdata
  2251. DESTINATION usr/lib/netdata/conf.d/health.d)
  2252. configure_file(src/health/notifications/alarm-notify.sh.in src/health/notifications/alarm-notify.sh @ONLY)
  2253. install(PROGRAMS
  2254. ${CMAKE_BINARY_DIR}/src/health/notifications/alarm-notify.sh
  2255. COMPONENT netdata
  2256. DESTINATION usr/libexec/netdata/plugins.d)
  2257. install(PROGRAMS
  2258. src/health/notifications/alarm-email.sh
  2259. src/health/notifications/alarm-test.sh
  2260. COMPONENT netdata
  2261. DESTINATION usr/libexec/netdata/plugins.d)
  2262. install(FILES
  2263. src/health/notifications/health_alarm_notify.conf
  2264. src/health/notifications/health_email_recipients.conf
  2265. COMPONENT netdata
  2266. DESTINATION usr/lib/netdata/conf.d)
  2267. #
  2268. # test/ files
  2269. #
  2270. configure_file(tests/health_mgmtapi/health-cmdapi-test.sh.in tests/health_mgmtapi/health-cmdapi-test.sh @ONLY)
  2271. configure_file(tests/acls/acl.sh.in tests/acls/acl.sh @ONLY)
  2272. configure_file(tests/urls/request.sh.in tests/urls/request.sh @ONLY)
  2273. configure_file(tests/alarm_repetition/alarm.sh.in tests/alarm_repetition/alarm.sh @ONLY)
  2274. configure_file(tests/template_dimension/template_dim.sh.in tests/template_dimension/template_dim.sh @ONLY)
  2275. configure_file(tests/ebpf/ebpf_thread_function.sh.in tests/ebpf/ebpf_thread_function.sh @ONLY)
  2276. install(FILES
  2277. ${CMAKE_BINARY_DIR}/tests/health_mgmtapi/health-cmdapi-test.sh
  2278. ${CMAKE_BINARY_DIR}/tests/acls/acl.sh
  2279. ${CMAKE_BINARY_DIR}/tests/urls/request.sh
  2280. ${CMAKE_BINARY_DIR}/tests/alarm_repetition/alarm.sh
  2281. ${CMAKE_BINARY_DIR}/tests/template_dimension/template_dim.sh
  2282. ${CMAKE_BINARY_DIR}/tests/ebpf/ebpf_thread_function.sh
  2283. DESTINATION usr/libexec/netdata/plugins.d)
  2284. #
  2285. # charts.d plugin
  2286. #
  2287. install(DIRECTORY COMPONENT plugin-chartsd DESTINATION etc/netdata/charts.d)
  2288. configure_file(src/collectors/charts.d.plugin/charts.d.plugin.in src/collectors/charts.d.plugin/charts.d.plugin @ONLY)
  2289. install(PROGRAMS
  2290. ${CMAKE_BINARY_DIR}/src/collectors/charts.d.plugin/charts.d.plugin
  2291. COMPONENT plugin-chartsd
  2292. DESTINATION usr/libexec/netdata/plugins.d)
  2293. install(PROGRAMS
  2294. src/collectors/charts.d.plugin/charts.d.dryrun-helper.sh
  2295. COMPONENT plugin-chartsd
  2296. DESTINATION usr/libexec/netdata/plugins.d)
  2297. # loopsleepms is used by the tc.plugin -> ship it in the netdata component
  2298. install(FILES
  2299. src/collectors/charts.d.plugin/loopsleepms.sh.inc
  2300. COMPONENT netdata
  2301. DESTINATION usr/libexec/netdata/plugins.d)
  2302. install(FILES
  2303. src/collectors/charts.d.plugin/charts.d.conf
  2304. COMPONENT plugin-chartsd
  2305. DESTINATION usr/lib/netdata/conf.d)
  2306. install(PROGRAMS
  2307. src/collectors/charts.d.plugin/ap/ap.chart.sh
  2308. src/collectors/charts.d.plugin/apcupsd/apcupsd.chart.sh
  2309. src/collectors/charts.d.plugin/example/example.chart.sh
  2310. src/collectors/charts.d.plugin/libreswan/libreswan.chart.sh
  2311. src/collectors/charts.d.plugin/opensips/opensips.chart.sh
  2312. src/collectors/charts.d.plugin/sensors/sensors.chart.sh
  2313. COMPONENT plugin-chartsd
  2314. DESTINATION usr/libexec/netdata/charts.d)
  2315. install(FILES
  2316. src/collectors/charts.d.plugin/ap/ap.conf
  2317. src/collectors/charts.d.plugin/apcupsd/apcupsd.conf
  2318. src/collectors/charts.d.plugin/example/example.conf
  2319. src/collectors/charts.d.plugin/libreswan/libreswan.conf
  2320. src/collectors/charts.d.plugin/opensips/opensips.conf
  2321. src/collectors/charts.d.plugin/sensors/sensors.conf
  2322. COMPONENT plugin-chartsd
  2323. DESTINATION usr/lib/netdata/conf.d/charts.d)
  2324. if(BUILD_FOR_PACKAGING)
  2325. install(FILES
  2326. packaging/cmake/control/copyright
  2327. COMPONENT plugin-chartsd
  2328. DESTINATION usr/share/doc/netdata-plugin-chartsd)
  2329. endif()
  2330. #
  2331. # tc-qos-helper
  2332. #
  2333. configure_file(src/collectors/tc.plugin/tc-qos-helper.sh.in src/collectors/tc.plugin/tc-qos-helper.sh @ONLY)
  2334. install(PROGRAMS
  2335. ${CMAKE_BINARY_DIR}/src/collectors/tc.plugin/tc-qos-helper.sh
  2336. COMPONENT netdata
  2337. DESTINATION usr/libexec/netdata/plugins.d)
  2338. # confs
  2339. install(FILES
  2340. src/collectors/systemd-journal.plugin/schema.d/systemd-journal:monitored-directories.json
  2341. src/health/schema.d/health:alert:prototype.json
  2342. COMPONENT netdata
  2343. DESTINATION usr/lib/netdata/conf.d/schema.d)
  2344. #
  2345. # python.d plugin
  2346. #
  2347. configure_file(src/collectors/python.d.plugin/python.d.plugin.in src/collectors/python.d.plugin/python.d.plugin @ONLY)
  2348. install(PROGRAMS ${CMAKE_BINARY_DIR}/src/collectors/python.d.plugin/python.d.plugin
  2349. COMPONENT plugin-pythond
  2350. DESTINATION usr/libexec/netdata/plugins.d)
  2351. install(DIRECTORY src/collectors/python.d.plugin/python_modules
  2352. COMPONENT plugin-pythond
  2353. DESTINATION usr/libexec/netdata/python.d)
  2354. install(FILES src/collectors/python.d.plugin/python.d.conf
  2355. COMPONENT plugin-pythond
  2356. DESTINATION usr/lib/netdata/conf.d)
  2357. install(FILES
  2358. src/collectors/python.d.plugin/alarms/alarms.conf
  2359. src/collectors/python.d.plugin/am2320/am2320.conf
  2360. src/collectors/python.d.plugin/anomalies/anomalies.conf
  2361. src/collectors/python.d.plugin/beanstalk/beanstalk.conf
  2362. src/collectors/python.d.plugin/bind_rndc/bind_rndc.conf
  2363. src/collectors/python.d.plugin/boinc/boinc.conf
  2364. src/collectors/python.d.plugin/ceph/ceph.conf
  2365. src/collectors/python.d.plugin/changefinder/changefinder.conf
  2366. src/collectors/python.d.plugin/dovecot/dovecot.conf
  2367. src/collectors/python.d.plugin/example/example.conf
  2368. src/collectors/python.d.plugin/exim/exim.conf
  2369. src/collectors/python.d.plugin/gearman/gearman.conf
  2370. src/collectors/python.d.plugin/go_expvar/go_expvar.conf
  2371. src/collectors/python.d.plugin/haproxy/haproxy.conf
  2372. src/collectors/python.d.plugin/hpssa/hpssa.conf
  2373. src/collectors/python.d.plugin/icecast/icecast.conf
  2374. src/collectors/python.d.plugin/ipfs/ipfs.conf
  2375. src/collectors/python.d.plugin/litespeed/litespeed.conf
  2376. src/collectors/python.d.plugin/memcached/memcached.conf
  2377. src/collectors/python.d.plugin/monit/monit.conf
  2378. src/collectors/python.d.plugin/nsd/nsd.conf
  2379. src/collectors/python.d.plugin/nvidia_smi/nvidia_smi.conf
  2380. src/collectors/python.d.plugin/openldap/openldap.conf
  2381. src/collectors/python.d.plugin/oracledb/oracledb.conf
  2382. src/collectors/python.d.plugin/pandas/pandas.conf
  2383. src/collectors/python.d.plugin/postfix/postfix.conf
  2384. src/collectors/python.d.plugin/puppet/puppet.conf
  2385. src/collectors/python.d.plugin/rethinkdbs/rethinkdbs.conf
  2386. src/collectors/python.d.plugin/retroshare/retroshare.conf
  2387. src/collectors/python.d.plugin/riakkv/riakkv.conf
  2388. src/collectors/python.d.plugin/samba/samba.conf
  2389. src/collectors/python.d.plugin/spigotmc/spigotmc.conf
  2390. src/collectors/python.d.plugin/squid/squid.conf
  2391. src/collectors/python.d.plugin/tomcat/tomcat.conf
  2392. src/collectors/python.d.plugin/tor/tor.conf
  2393. src/collectors/python.d.plugin/traefik/traefik.conf
  2394. src/collectors/python.d.plugin/uwsgi/uwsgi.conf
  2395. src/collectors/python.d.plugin/varnish/varnish.conf
  2396. src/collectors/python.d.plugin/w1sensor/w1sensor.conf
  2397. src/collectors/python.d.plugin/zscores/zscores.conf
  2398. COMPONENT plugin-pythond
  2399. DESTINATION usr/lib/netdata/conf.d/python.d)
  2400. install(FILES
  2401. src/collectors/python.d.plugin/alarms/alarms.chart.py
  2402. src/collectors/python.d.plugin/am2320/am2320.chart.py
  2403. src/collectors/python.d.plugin/anomalies/anomalies.chart.py
  2404. src/collectors/python.d.plugin/beanstalk/beanstalk.chart.py
  2405. src/collectors/python.d.plugin/bind_rndc/bind_rndc.chart.py
  2406. src/collectors/python.d.plugin/boinc/boinc.chart.py
  2407. src/collectors/python.d.plugin/ceph/ceph.chart.py
  2408. src/collectors/python.d.plugin/changefinder/changefinder.chart.py
  2409. src/collectors/python.d.plugin/dovecot/dovecot.chart.py
  2410. src/collectors/python.d.plugin/example/example.chart.py
  2411. src/collectors/python.d.plugin/exim/exim.chart.py
  2412. src/collectors/python.d.plugin/gearman/gearman.chart.py
  2413. src/collectors/python.d.plugin/go_expvar/go_expvar.chart.py
  2414. src/collectors/python.d.plugin/haproxy/haproxy.chart.py
  2415. src/collectors/python.d.plugin/hpssa/hpssa.chart.py
  2416. src/collectors/python.d.plugin/icecast/icecast.chart.py
  2417. src/collectors/python.d.plugin/ipfs/ipfs.chart.py
  2418. src/collectors/python.d.plugin/litespeed/litespeed.chart.py
  2419. src/collectors/python.d.plugin/memcached/memcached.chart.py
  2420. src/collectors/python.d.plugin/monit/monit.chart.py
  2421. src/collectors/python.d.plugin/nsd/nsd.chart.py
  2422. src/collectors/python.d.plugin/nvidia_smi/nvidia_smi.chart.py
  2423. src/collectors/python.d.plugin/openldap/openldap.chart.py
  2424. src/collectors/python.d.plugin/oracledb/oracledb.chart.py
  2425. src/collectors/python.d.plugin/pandas/pandas.chart.py
  2426. src/collectors/python.d.plugin/postfix/postfix.chart.py
  2427. src/collectors/python.d.plugin/puppet/puppet.chart.py
  2428. src/collectors/python.d.plugin/rethinkdbs/rethinkdbs.chart.py
  2429. src/collectors/python.d.plugin/retroshare/retroshare.chart.py
  2430. src/collectors/python.d.plugin/riakkv/riakkv.chart.py
  2431. src/collectors/python.d.plugin/samba/samba.chart.py
  2432. src/collectors/python.d.plugin/spigotmc/spigotmc.chart.py
  2433. src/collectors/python.d.plugin/squid/squid.chart.py
  2434. src/collectors/python.d.plugin/tomcat/tomcat.chart.py
  2435. src/collectors/python.d.plugin/tor/tor.chart.py
  2436. src/collectors/python.d.plugin/traefik/traefik.chart.py
  2437. src/collectors/python.d.plugin/uwsgi/uwsgi.chart.py
  2438. src/collectors/python.d.plugin/varnish/varnish.chart.py
  2439. src/collectors/python.d.plugin/w1sensor/w1sensor.chart.py
  2440. src/collectors/python.d.plugin/zscores/zscores.chart.py
  2441. COMPONENT plugin-pythond
  2442. DESTINATION usr/libexec/netdata/python.d)
  2443. if(BUILD_FOR_PACKAGING)
  2444. install(FILES
  2445. packaging/cmake/control/copyright
  2446. COMPONENT plugin-pythond
  2447. DESTINATION usr/share/doc/netdata-plugin-pythond)
  2448. endif()
  2449. #
  2450. # ioping.plugin
  2451. #
  2452. configure_file(src/collectors/ioping.plugin/ioping.plugin.in src/collectors/ioping.plugin/ioping.plugin @ONLY)
  2453. install(PROGRAMS ${CMAKE_BINARY_DIR}/src/collectors/ioping.plugin/ioping.plugin
  2454. COMPONENT netdata
  2455. DESTINATION usr/libexec/netdata/plugins.d)
  2456. #
  2457. # go.d.plugin
  2458. #
  2459. if(ENABLE_PLUGIN_GO)
  2460. install(FILES src/go/collectors/go.d.plugin/config/go.d.conf
  2461. COMPONENT plugin-go
  2462. DESTINATION usr/lib/netdata/conf.d)
  2463. install(DIRECTORY
  2464. COMPONENT plugin-go
  2465. DESTINATION usr/lib/netdata/conf.d/go.d)
  2466. file(GLOB GO_CONF_FILES src/go/collectors/go.d.plugin/config/go.d/*.conf)
  2467. install(FILES ${GO_CONF_FILES}
  2468. COMPONENT plugin-go
  2469. DESTINATION usr/lib/netdata/conf.d/go.d)
  2470. install(DIRECTORY
  2471. COMPONENT plugin-go
  2472. DESTINATION usr/lib/netdata/conf.d/go.d/sd)
  2473. file(GLOB GO_SD_CONF_FILES src/go/collectors/go.d.plugin/config/go.d/sd/*.conf)
  2474. install(FILES ${GO_SD_CONF_FILES}
  2475. COMPONENT plugin-go
  2476. DESTINATION usr/lib/netdata/conf.d/go.d/sd)
  2477. if(BUILD_FOR_PACKAGING)
  2478. install(FILES
  2479. packaging/cmake/control/copyright
  2480. COMPONENT plugin-go
  2481. DESTINATION usr/share/doc/netdata-plugin-go)
  2482. endif()
  2483. endif()
  2484. #
  2485. # dashboard
  2486. #
  2487. include(src/web/gui/v1/dashboard_v1.cmake)
  2488. include(src/web/gui/v2/dashboard_v2.cmake)
  2489. include(src/web/gui/gui.cmake)
  2490. function(cat IN_FILE OUT_FILE)
  2491. file(READ ${IN_FILE} CONTENTS)
  2492. file(APPEND ${OUT_FILE} "${CONTENTS}")
  2493. endfunction()
  2494. file(WRITE ${CMAKE_BINARY_DIR}/src/web/gui/dashboard.js.in "")
  2495. foreach(JS_FILE ${DASHBOARD_JS_FILES})
  2496. cat(${JS_FILE} ${CMAKE_BINARY_DIR}/dashboard.js.in)
  2497. endforeach()
  2498. configure_file(${CMAKE_BINARY_DIR}/dashboard.js.in
  2499. ${CMAKE_BINARY_DIR}/dashboard.js COPYONLY)
  2500. install(FILES
  2501. ${CMAKE_BINARY_DIR}/dashboard.js
  2502. COMPONENT netdata
  2503. DESTINATION ${WEB_DEST})
  2504. install(FILES
  2505. src/web/gui/dashboard_info_custom_example.js
  2506. src/web/gui/dashboard_info.js
  2507. src/web/gui/index.html
  2508. src/web/gui/main.css
  2509. src/web/gui/main.js
  2510. src/web/gui/registry-access.html
  2511. src/web/gui/registry-alert-redirect.html
  2512. src/web/gui/registry-hello.html
  2513. src/web/gui/switch.html
  2514. src/web/gui/ilove.html
  2515. COMPONENT netdata
  2516. DESTINATION ${WEB_DEST})
  2517. install(FILES
  2518. src/web/gui/old/index.html
  2519. COMPONENT netdata
  2520. DESTINATION ${WEB_DEST}/old)
  2521. install(FILES
  2522. src/web/gui/static/img/netdata-logomark.svg
  2523. COMPONENT netdata
  2524. DESTINATION ${WEB_DEST}/static/img)
  2525. install(FILES
  2526. src/web/gui/css/morris-0.5.1.css
  2527. src/web/gui/css/c3-0.4.18.min.css
  2528. COMPONENT netdata
  2529. DESTINATION ${WEB_DEST}/css)
  2530. install(FILES
  2531. src/web/gui/.well-known/dnt/cookies
  2532. COMPONENT netdata
  2533. DESTINATION ${WEB_DEST}/.well-known/dnt)
  2534. # v0 dashboard
  2535. install(FILES
  2536. src/web/gui/v0/index.html
  2537. COMPONENT netdata
  2538. DESTINATION ${WEB_DEST}/v0)
  2539. include(Packaging)