summaryrefslogtreecommitdiffstats
path: root/database/rrdcalc.h
diff options
context:
space:
mode:
Diffstat (limited to 'database/rrdcalc.h')
-rw-r--r--database/rrdcalc.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/database/rrdcalc.h b/database/rrdcalc.h
index 3b48d74e..2081452c 100644
--- a/database/rrdcalc.h
+++ b/database/rrdcalc.h
@@ -28,6 +28,8 @@ typedef enum {
RRDCALC_FLAG_FROM_TEMPLATE = (1 << 10), // the rrdcalc has been created from a template
} RRDCALC_FLAGS;
+void rrdcalc_flags_to_json_array(BUFFER *wb, const char *key, RRDCALC_FLAGS flags);
+
typedef enum {
// This list uses several other options from RRDR_OPTIONS for db lookups.
// To add an item here, you need to reserve a bit in RRDR_OPTIONS.
@@ -120,6 +122,7 @@ struct rrdcalc {
NETDATA_DOUBLE value; // the current value of the alarm
NETDATA_DOUBLE old_value; // the previous value of the alarm
+ NETDATA_DOUBLE last_status_change_value; // the value at the last status change
RRDCALC_FLAGS run_flags; // check RRDCALC_FLAG_*
@@ -136,6 +139,7 @@ struct rrdcalc {
int delay_up_current; // the current up notification delay duration
int delay_down_current; // the current down notification delay duration
int delay_last; // the last delay we used
+ ALARM_ENTRY *ae; // last alarm entry
// ------------------------------------------------------------------------
// variables this alarm exposes to the rest of the alarms
@@ -211,6 +215,7 @@ struct alert_config {
STRING *repeat;
STRING *host_labels;
STRING *chart_labels;
+ STRING *source;
STRING *p_db_lookup_dimensions;
STRING *p_db_lookup_method;
@@ -235,7 +240,7 @@ const char *rrdcalc_status2string(RRDCALC_STATUS status);
void rrdcalc_free_unused_rrdcalc_loaded_from_config(RRDCALC *rc);
-uint32_t rrdcalc_get_unique_id(RRDHOST *host, STRING *chart, STRING *name, uint32_t *next_event_id);
+uint32_t rrdcalc_get_unique_id(RRDHOST *host, STRING *chart, STRING *name, uint32_t *next_event_id, uuid_t *config_hash_id);
void rrdcalc_add_from_rrdcalctemplate(RRDHOST *host, RRDCALCTEMPLATE *rt, RRDSET *st, const char *overwrite_alert_name, const char *overwrite_dimensions);
int rrdcalc_add_from_config(RRDHOST *host, RRDCALC *rc);