common.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. // ----------------------------------------------------------------------------
  23. // netdata include files
  24. #include "global_statistics.h"
  25. // the netdata database
  26. #include "database/rrd.h"
  27. // the netdata webserver(s)
  28. #include "web/server/web_server.h"
  29. // streaming metrics between netdata servers
  30. #include "streaming/rrdpush.h"
  31. // health monitoring and alarm notifications
  32. #include "health/health.h"
  33. // anomaly detection
  34. #include "ml/ml.h"
  35. // the netdata registry
  36. // the registry is actually an API feature
  37. #include "registry/registry.h"
  38. // exporting engine for archiving the metrics
  39. #include "exporting/exporting_engine.h"
  40. // the netdata API
  41. #include "web/api/web_api_v1.h"
  42. // all data collection plugins
  43. #include "collectors/all.h"
  44. // netdata unit tests
  45. #include "unit_test.h"
  46. // netdata agent claiming
  47. #include "claim/claim.h"
  48. // netdata agent cloud link
  49. #include "aclk/aclk_api.h"
  50. // global GUID map functions
  51. // netdata agent spawn server
  52. #include "spawn/spawn.h"
  53. // the netdata daemon
  54. #include "daemon.h"
  55. #include "main.h"
  56. #include "static_threads.h"
  57. #include "signals.h"
  58. #include "commands.h"
  59. #include "analytics.h"
  60. // global netdata daemon variables
  61. extern char *netdata_configured_hostname;
  62. extern char *netdata_configured_user_config_dir;
  63. extern char *netdata_configured_stock_config_dir;
  64. extern char *netdata_configured_log_dir;
  65. extern char *netdata_configured_primary_plugins_dir;
  66. extern char *netdata_configured_web_dir;
  67. extern char *netdata_configured_cache_dir;
  68. extern char *netdata_configured_varlib_dir;
  69. extern char *netdata_configured_lock_dir;
  70. extern char *netdata_configured_home_dir;
  71. extern char *netdata_configured_host_prefix;
  72. extern char *netdata_configured_timezone;
  73. extern char *netdata_configured_abbrev_timezone;
  74. extern int32_t netdata_configured_utc_offset;
  75. extern int netdata_zero_metrics_enabled;
  76. extern int netdata_anonymous_statistics_enabled;
  77. extern int netdata_ready;
  78. extern int netdata_cloud_setting;
  79. #endif /* NETDATA_COMMON_H */