diff options
Diffstat (limited to '')
-rw-r--r-- | health/health.h | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/health/health.h b/health/health.h index c36aabac..543bc56a 100644 --- a/health/health.h +++ b/health/health.h @@ -7,18 +7,21 @@ extern unsigned int default_health_enabled; -#define HEALTH_ENTRY_FLAG_PROCESSED 0x00000001 -#define HEALTH_ENTRY_FLAG_UPDATED 0x00000002 -#define HEALTH_ENTRY_FLAG_EXEC_RUN 0x00000004 -#define HEALTH_ENTRY_FLAG_EXEC_FAILED 0x00000008 -#define HEALTH_ENTRY_FLAG_SILENCED 0x00000010 -#define HEALTH_ENTRY_RUN_ONCE 0x00000020 -#define HEALTH_ENTRY_FLAG_EXEC_IN_PROGRESS 0x00000040 -#define HEALTH_ENTRY_FLAG_IS_REPEATING 0x00000080 - -#define HEALTH_ENTRY_FLAG_SAVED 0x10000000 -#define HEALTH_ENTRY_FLAG_ACLK_QUEUED 0x20000000 -#define HEALTH_ENTRY_FLAG_NO_CLEAR_NOTIFICATION 0x80000000 +typedef enum __attribute__((packed)) { + HEALTH_ENTRY_FLAG_PROCESSED = 0x00000001, // notifications engine has processed this + HEALTH_ENTRY_FLAG_UPDATED = 0x00000002, // there is a more recent update about this transition + HEALTH_ENTRY_FLAG_EXEC_RUN = 0x00000004, // notification script has been run (this is the intent, not the result) + HEALTH_ENTRY_FLAG_EXEC_FAILED = 0x00000008, // notification script couldn't be run + HEALTH_ENTRY_FLAG_SILENCED = 0x00000010, + HEALTH_ENTRY_RUN_ONCE = 0x00000020, + HEALTH_ENTRY_FLAG_EXEC_IN_PROGRESS = 0x00000040, + HEALTH_ENTRY_FLAG_IS_REPEATING = 0x00000080, + HEALTH_ENTRY_FLAG_SAVED = 0x10000000, // Saved to SQL + HEALTH_ENTRY_FLAG_ACLK_QUEUED = 0x20000000, // Sent to Netdata Cloud + HEALTH_ENTRY_FLAG_NO_CLEAR_NOTIFICATION = 0x80000000, +} HEALTH_ENTRY_FLAGS; + +void health_entry_flags_to_json_array(BUFFER *wb, const char *key, HEALTH_ENTRY_FLAGS flags); #ifndef HEALTH_LISTEN_PORT #define HEALTH_LISTEN_PORT 19998 @@ -28,6 +31,14 @@ extern unsigned int default_health_enabled; #define HEALTH_LISTEN_BACKLOG 4096 #endif +#ifndef HEALTH_LOG_DEFAULT_HISTORY +#define HEALTH_LOG_DEFAULT_HISTORY 432000 +#endif + +#ifndef HEALTH_LOG_MINIMUM_HISTORY +#define HEALTH_LOG_MINIMUM_HISTORY 86400 +#endif + #define HEALTH_SILENCERS_MAX_FILE_LEN 10000 extern char *silencers_filename; @@ -40,6 +51,7 @@ void health_reload(void); void health_aggregate_alarms(RRDHOST *host, BUFFER *wb, BUFFER* context, RRDCALC_STATUS status); void health_alarms2json(RRDHOST *host, BUFFER *wb, int all); +void health_alert2json_conf(RRDHOST *host, BUFFER *wb, CONTEXTS_V2_OPTIONS all); void health_alarms_values2json(RRDHOST *host, BUFFER *wb, int all); void health_api_v1_chart_variables2json(RRDSET *st, BUFFER *buf); @@ -73,7 +85,7 @@ ALARM_ENTRY* health_create_alarm_entry( STRING *units, STRING *info, int delay, - uint32_t flags); + HEALTH_ENTRY_FLAGS flags); void health_alarm_log_add_entry(RRDHOST *host, ALARM_ENTRY *ae); |