From cd35a6a4528cf78383266fbae770b9c7161fda25 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 14 Nov 2012 13:07:47 +0100 Subject: [PATCH] src/plugin.c: Report an error if ctx.interval is not set. --- src/plugin.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/plugin.c b/src/plugin.c index 9d10631d..22f89696 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -1544,13 +1544,25 @@ int plugin_dispatch_values (value_list_t *vl) if (vl->time == 0) vl->time = cdtime (); - if (vl->interval <= 0) { + if (vl->interval <= 0) + { plugin_ctx_t ctx = plugin_get_ctx (); if (ctx.interval != 0) vl->interval = ctx.interval; else + { + char name[6 * DATA_MAX_NAME_LEN]; + FORMAT_VL (name, sizeof (name), vl); + ERROR ("plugin_dispatch_values: Unable to determine " + "interval from context for " + "value list \"%s\". " + "This indicates a broken plugin. " + "Please report this problem to the " + "collectd mailing list or at " + ".", name); vl->interval = interval_g; + } } DEBUG ("plugin_dispatch_values: time = %.3f; interval = %.3f; " -- 2.30.2