Add custom message for threshold and missings.
[collectd.git] / src / utils_threshold.h
index 8aaf34c..66364c4 100644 (file)
@@ -39,8 +39,10 @@ typedef struct threshold_s
   gauge_t failure_min;
   gauge_t failure_max;
   gauge_t hysteresis;
-  int flags;
+  unsigned int flags;
   int hits;
+  char *message;
+  char *missing_message;
   struct threshold_s *next;
 } threshold_t;
 
@@ -84,4 +86,15 @@ int ut_check_interesting (const char *name);
  */
 int ut_search_threshold (const value_list_t *vl, threshold_t *ret_threshold);
 
+
+/*
+ * Formats a notification message using specified patterns according to data
+ * passed as argument.
+ *
+ * Returns: the number of bytes in the output string.
+ */
+int ut_build_message(char *out, size_t bufsize, const char *fmt,
+    const data_set_t *ds, int ds_index, const value_list_t *vl, const gauge_t *values,
+    const notification_t *n, const threshold_t *th);
+
 #endif /* UTILS_THRESHOLD_H */