From: Florian Forster Date: Thu, 12 Jun 2008 13:27:10 +0000 (+0200) Subject: src/utils_threashold.c: Add meta data to the notifications. X-Git-Tag: collectd-4.5.0~115^2~4 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2bc764ab39541a0e1f328d4f0edf509a4b1106e2;p=collectd.git src/utils_threashold.c: Add meta data to the notifications. The min/max warning/failure values, the current value and name of the data source are now included in the meta data part of the notification. --- diff --git a/src/utils_threshold.c b/src/utils_threshold.c index bf04c633..bea5bfb5 100644 --- a/src/utils_threshold.c +++ b/src/utils_threshold.c @@ -616,6 +616,14 @@ static int ut_report_state (const data_set_t *ds, bufsize -= status; } + plugin_notification_meta_add_string (&n, "DataSource", + ds->ds[ds_index].name); + plugin_notification_meta_add_double (&n, "CurrentValue", values[ds_index]); + plugin_notification_meta_add_double (&n, "WarningMin", th->warning_min); + plugin_notification_meta_add_double (&n, "WarningMax", th->warning_max); + plugin_notification_meta_add_double (&n, "FailureMin", th->failure_min); + plugin_notification_meta_add_double (&n, "FailureMax", th->failure_max); + /* Send an okay notification */ if (state == STATE_OKAY) { @@ -666,6 +674,7 @@ static int ut_report_state (const data_set_t *ds, plugin_dispatch_notification (&n); + plugin_notification_meta_free (&n); return (0); } /* }}} int ut_report_state */