From 2bc764ab39541a0e1f328d4f0edf509a4b1106e2 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Thu, 12 Jun 2008 15:27:10 +0200 Subject: [PATCH] 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. --- src/utils_threshold.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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 */ -- 2.30.2