common.h 4.0 KB

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