From f28e85ce5eda0261b6b2ee2f81709892361a99f4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Manuel=20Luis=20Sanmart=C3=ADn=20Rozada?= Date: Thu, 19 Jun 2014 16:50:48 +0200 Subject: [PATCH] Plugin threshold: time is not set in missing notifications. --- src/threshold.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/threshold.c b/src/threshold.c index 7df4d616..887dbca3 100644 --- a/src/threshold.c +++ b/src/threshold.c @@ -942,6 +942,7 @@ static int ut_missing (const value_list_t *vl, cdtime_t missing_time; char identifier[6 * DATA_MAX_NAME_LEN]; notification_t n; + cdtime_t now; if (threshold_tree == NULL) return (0); @@ -951,13 +952,15 @@ static int ut_missing (const value_list_t *vl, if ((th == NULL) || ((th->flags & UT_FLAG_INTERESTING) == 0)) return (0); - missing_time = cdtime () - vl->time; + now = cdtime (); + missing_time = now - vl->time; FORMAT_VL (identifier, sizeof (identifier), vl); NOTIFICATION_INIT_VL (&n, vl); ssnprintf (n.message, sizeof (n.message), "%s has not been updated for %.3f seconds.", identifier, CDTIME_T_TO_DOUBLE (missing_time)); + n.time = now; plugin_dispatch_notification (&n); -- 2.11.0