From: Florian Forster Date: Wed, 24 Mar 2010 14:43:42 +0000 (+0100) Subject: modbus plugin: Set the interval when dispatching values. X-Git-Tag: collectd-4.10.0~28^2~2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2413e5f1faeee70920593a3a07f6b7ef997a5e65;p=collectd.git modbus plugin: Set the interval when dispatching values. --- diff --git a/src/modbus.c b/src/modbus.c index 656d9c83..78c43350 100644 --- a/src/modbus.c +++ b/src/modbus.c @@ -212,12 +212,16 @@ static int mb_submit (mb_host_t *host, mb_slave_t *slave, /* {{{ */ if ((host == NULL) || (slave == NULL) || (data == NULL)) return (EINVAL); + if (host->interval <= 0) + host->interval = interval_g; + if (slave->instance[0] == 0) ssnprintf (slave->instance, sizeof (slave->instance), "slave_%i", slave->id); vl.values = &value; vl.values_len = 1; + vl.interval = host->interval; sstrncpy (vl.host, host->host, sizeof (vl.host)); sstrncpy (vl.plugin, "modbus", sizeof (vl.plugin)); sstrncpy (vl.plugin_instance, slave->instance, sizeof (vl.plugin_instance));