common.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. // SPDX-License-Identifier: GPL-3.0-or-later
  2. #ifndef NETDATA_COMMON_H
  3. #define NETDATA_COMMON_H 1
  4. #include "libnetdata/libnetdata.h"
  5. #include "event_loop.h"
  6. // ----------------------------------------------------------------------------
  7. // shortcuts for the default netdata configuration
  8. #define config_load(filename, overwrite_used, section) appconfig_load(&netdata_config, filename, overwrite_used, section)
  9. #define config_get(section, name, default_value) appconfig_get(&netdata_config, section, name, default_value)
  10. #define config_get_number(section, name, value) appconfig_get_number(&netdata_config, section, name, value)
  11. #define config_get_float(section, name, value) appconfig_get_float(&netdata_config, section, name, value)
  12. #define config_get_boolean(section, name, value) appconfig_get_boolean(&netdata_config, section, name, value)
  13. #define config_get_boolean_ondemand(section, name, value) appconfig_get_boolean_ondemand(&netdata_config, section, name, value)
  14. #define config_get_duration(section, name, value) appconfig_get_duration(&netdata_config, section, name, value)
  15. #define config_set(section, name, default_value) appconfig_set(&netdata_config, section, name, default_value)
  16. #define config_set_default(section, name, value) appconfig_set_default(&netdata_config, section, name, value)
  17. #define config_set_number(section, name, value) appconfig_set_number(&netdata_config, section, name, value)
  18. #define config_set_float(section, name, value) appconfig_set_float(&netdata_config, section, name, value)
  19. #define config_set_boolean(section, name, value) appconfig_set_boolean(&netdata_config, section, name, value)
  20. #define config_exists(section, name) appconfig_exists(&netdata_config, section, name)
  21. #define config_move(section_old, name_old, section_new, name_new) appconfig_move(&netdata_config, section_old, name_old, section_new, name_new)
  22. #define config_generate(buffer, only_changed) appconfig_generate(&netdata_config, buffer, only_changed)
  23. #define config_section_option_destroy(section, name) appconfig_section_option_destroy_non_loaded(&netdata_config, section, name)
  24. // ----------------------------------------------------------------------------
  25. // netdata include files
  26. #include "global_statistics.h"
  27. // the netdata database
  28. #include "database/rrd.h"
  29. // the netdata webserver(s)
  30. #include "web/server/web_server.h"
  31. // the new h2o based netdata webserver
  32. #ifdef ENABLE_HTTPD
  33. #include "httpd/http_server.h"
  34. #endif
  35. // streaming metrics between netdata servers
  36. #include "streaming/rrdpush.h"
  37. // health monitoring and alarm notifications
  38. #include "health/health.h"
  39. // anomaly detection
  40. #include "ml/ml.h"
  41. // the netdata registry
  42. // the registry is actually an API feature
  43. #include "registry/registry.h"
  44. // exporting engine for archiving the metrics
  45. #include "exporting/exporting_engine.h"
  46. // the netdata API
  47. #include "web/server/web_client.h"
  48. #include "web/rtc/webrtc.h"
  49. // all data collection plugins
  50. #include "collectors/all.h"
  51. // netdata unit tests
  52. #include "unit_test.h"
  53. // netdata agent claiming
  54. #include "claim/claim.h"
  55. // netdata agent cloud link
  56. #include "aclk/aclk.h"
  57. // global GUID map functions
  58. // netdata agent spawn server
  59. #include "spawn/spawn.h"
  60. // the netdata daemon
  61. #include "daemon.h"
  62. #include "main.h"
  63. #include "static_threads.h"
  64. #include "signals.h"
  65. #include "commands.h"
  66. #include "analytics.h"
  67. // global netdata daemon variables
  68. extern char *netdata_configured_hostname;
  69. extern char *netdata_configured_user_config_dir;
  70. extern char *netdata_configured_stock_config_dir;
  71. extern char *netdata_configured_log_dir;
  72. extern char *netdata_configured_primary_plugins_dir;
  73. extern char *netdata_configured_web_dir;
  74. extern char *netdata_configured_cache_dir;
  75. extern char *netdata_configured_varlib_dir;
  76. extern char *netdata_configured_lock_dir;
  77. extern char *netdata_configured_home_dir;
  78. extern char *netdata_configured_host_prefix;
  79. extern char *netdata_configured_timezone;
  80. extern char *netdata_configured_abbrev_timezone;
  81. extern int32_t netdata_configured_utc_offset;
  82. extern int netdata_zero_metrics_enabled;
  83. extern int netdata_anonymous_statistics_enabled;
  84. extern int netdata_ready;
  85. extern int netdata_cloud_setting;
  86. long get_netdata_cpus(void);
  87. #endif /* NETDATA_COMMON_H */