health.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef NETDATA_HEALTH_LIB
  2. # define NETDATA_HEALTH_LIB 1
  3. # include "../libnetdata.h"
  4. #define HEALTH_ALARM_KEY "alarm"
  5. #define HEALTH_TEMPLATE_KEY "template"
  6. #define HEALTH_CONTEXT_KEY "context"
  7. #define HEALTH_CHART_KEY "chart"
  8. #define HEALTH_HOST_KEY "hosts"
  9. #define HEALTH_OS_KEY "os"
  10. #define HEALTH_FAMILIES_KEY "families"
  11. #define HEALTH_LOOKUP_KEY "lookup"
  12. #define HEALTH_CALC_KEY "calc"
  13. typedef struct silencer {
  14. char *alarms;
  15. SIMPLE_PATTERN *alarms_pattern;
  16. char *hosts;
  17. SIMPLE_PATTERN *hosts_pattern;
  18. char *contexts;
  19. SIMPLE_PATTERN *contexts_pattern;
  20. char *charts;
  21. SIMPLE_PATTERN *charts_pattern;
  22. char *families;
  23. SIMPLE_PATTERN *families_pattern;
  24. struct silencer *next;
  25. } SILENCER;
  26. typedef enum silence_type {
  27. STYPE_NONE,
  28. STYPE_DISABLE_ALARMS,
  29. STYPE_SILENCE_NOTIFICATIONS
  30. } SILENCE_TYPE;
  31. typedef struct silencers {
  32. int all_alarms;
  33. SILENCE_TYPE stype;
  34. SILENCER *silencers;
  35. } SILENCERS;
  36. extern SILENCERS *silencers;
  37. extern SILENCER *create_silencer(void);
  38. extern int health_silencers_json_read_callback(JSON_ENTRY *e);
  39. extern void health_silencers_add(SILENCER *silencer);
  40. extern SILENCER * health_silencers_addparam(SILENCER *silencer, char *key, char *value);
  41. extern int health_initialize_global_silencers();
  42. #endif