projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
71e39e8
)
Plugin threshold: time is not set in missing notifications.
author
Manuel Luis SanmartĂn Rozada
<manuel.luis@gmail.com>
Thu, 19 Jun 2014 14:50:48 +0000
(16:50 +0200)
committer
Marc Fournier
<marc.fournier@camptocamp.com>
Sat, 26 Jul 2014 08:47:02 +0000
(10:47 +0200)
src/threshold.c
patch
|
blob
|
history
diff --git
a/src/threshold.c
b/src/threshold.c
index
7df4d61
..
887dbca
100644
(file)
--- 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 missing_time;
char identifier[6 * DATA_MAX_NAME_LEN];
notification_t n;
+ cdtime_t now;
if (threshold_tree == NULL)
return (0);
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);
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));
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);
plugin_dispatch_notification (&n);