diff options
author | Pavlos Emm. Katsoulakis <paul@netdata.rocks> | 2019-06-28 08:27:57 +0200 |
---|---|---|
committer | Pavlos Emm. Katsoulakis <paul@netdata.rocks> | 2019-06-28 08:27:57 +0200 |
commit | 171d8f5d01f17dddbd531139b86e1a1c96f95b0d (patch) | |
tree | 7b2f049259656e4c14c3d7e23a639964ebb2e07b /health/health.h | |
parent | 5d5266dc1a863d877d91cab232b6369091a198ee (diff) |
Revert "Easily disable alarms, by persisting the silencers configuration (#6274)"
This reverts commit 60a73e90de2aa1c2eaae2ebbc45dd1fb96034df2.
Emergency rollback of potential culprit as per issue #6356
Will be re-merging the change after investigation
Diffstat (limited to 'health/health.h')
-rw-r--r-- | health/health.h | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/health/health.h b/health/health.h index acbcf827c2..1511f36486 100644 --- a/health/health.h +++ b/health/health.h @@ -35,9 +35,16 @@ extern unsigned int default_health_enabled; #define HEALTH_LISTEN_BACKLOG 4096 #endif - +#define HEALTH_ALARM_KEY "alarm" +#define HEALTH_TEMPLATE_KEY "template" #define HEALTH_ON_KEY "on" - +#define HEALTH_CONTEXT_KEY "context" +#define HEALTH_CHART_KEY "chart" +#define HEALTH_HOST_KEY "hosts" +#define HEALTH_OS_KEY "os" +#define HEALTH_FAMILIES_KEY "families" +#define HEALTH_LOOKUP_KEY "lookup" +#define HEALTH_CALC_KEY "calc" #define HEALTH_EVERY_KEY "every" #define HEALTH_GREEN_KEY "green" #define HEALTH_RED_KEY "red" @@ -50,9 +57,38 @@ extern unsigned int default_health_enabled; #define HEALTH_DELAY_KEY "delay" #define HEALTH_OPTIONS_KEY "options" -#define HEALTH_SILENCERS_MAX_FILE_LEN 10000 +typedef struct silencer { + char *alarms; + SIMPLE_PATTERN *alarms_pattern; + + char *hosts; + SIMPLE_PATTERN *hosts_pattern; + + char *contexts; + SIMPLE_PATTERN *contexts_pattern; + + char *charts; + SIMPLE_PATTERN *charts_pattern; + + char *families; + SIMPLE_PATTERN *families_pattern; + + struct silencer *next; +} SILENCER; + +typedef enum silence_type { + STYPE_NONE, + STYPE_DISABLE_ALARMS, + STYPE_SILENCE_NOTIFICATIONS +} SILENCE_TYPE; + +typedef struct silencers { + int all_alarms; + SILENCE_TYPE stype; + SILENCER *silencers; +} SILENCERS; -char *silencers_filename; +SILENCERS *silencers; extern void health_init(void); extern void *health_main(void *ptr); |