summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2139f51)
raw | patch | inline | side by side (parent: 2139f51)
author | Sebastian Harl <sh@tokkee.org> | |
Fri, 17 Jun 2011 11:57:50 +0000 (13:57 +0200) | ||
committer | Sebastian Harl <sh@teamix.net> | |
Mon, 19 Sep 2011 07:47:12 +0000 (09:47 +0200) |
src/cpu.c | patch | blob | history | |
src/dns.c | patch | blob | history | |
src/exec.c | patch | blob | history | |
src/ipmi.c | patch | blob | history | |
src/libvirt.c | patch | blob | history | |
src/memcached.c | patch | blob | history | |
src/modbus.c | patch | blob | history | |
src/network.c | patch | blob | history | |
src/powerdns.c | patch | blob | history | |
src/snmp.c | patch | blob | history |
diff --git a/src/cpu.c b/src/cpu.c
index 666fbad5546ea3f4edc2f571d0440015a4834868..66c093cc3813e8561814da30b13c5be226b28044 100644 (file)
--- a/src/cpu.c
+++ b/src/cpu.c
DEBUG ("host_processors returned %i %s", (int) cpu_list_len, cpu_list_len == 1 ? "processor" : "processors");
INFO ("cpu plugin: Found %i processor%s.", (int) cpu_list_len, cpu_list_len == 1 ? "" : "s");
- cpu_temp_retry_max = 86400 / CDTIME_T_TO_TIME_T (interval_g);
+ cpu_temp_retry_max = 86400 / CDTIME_T_TO_TIME_T ((plugin_interval > 0) ? plugin_interval : interval_g);
/* #endif PROCESSOR_CPU_LOAD_INFO */
#elif defined(HAVE_LIBKSTAT)
diff --git a/src/dns.c b/src/dns.c
index 9e868911bb7b03b6f55f46d0f89b3151ef933f5f..7974ed057af6a8dc4ec0ddbfa4f019eba6d64ef1 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
pcap_obj = pcap_open_live ((pcap_device != NULL) ? pcap_device : "any",
PCAP_SNAPLEN,
0 /* Not promiscuous */,
- (int) CDTIME_T_TO_MS (interval_g / 2),
+ (int) CDTIME_T_TO_MS (((plugin_interval > 0) ? plugin_interval : interval_g) / 2),
pcap_error);
if (pcap_obj == NULL)
{
diff --git a/src/exec.c b/src/exec.c
index 1da2bdd0224ca4fa30d2394f573d0fd5f23f71fd..0229b12bfa7954f8cb6eeea7a00d3e448d134aef 100644 (file)
--- a/src/exec.c
+++ b/src/exec.c
char buffer[1024];
#ifdef HAVE_SETENV
- ssnprintf (buffer, sizeof (buffer), "%.3f", CDTIME_T_TO_DOUBLE (interval_g));
+ ssnprintf (buffer, sizeof (buffer), "%.3f",
+ CDTIME_T_TO_DOUBLE ((plugin_interval > 0) ? plugin_interval : interval_g));
setenv ("COLLECTD_INTERVAL", buffer, /* overwrite = */ 1);
ssnprintf (buffer, sizeof (buffer), "%s", hostname_g);
setenv ("COLLECTD_HOSTNAME", buffer, /* overwrite = */ 1);
#else
ssnprintf (buffer, sizeof (buffer), "COLLECTD_INTERVAL=%.3f",
- CDTIME_T_TO_DOUBLE (interval_g));
+ CDTIME_T_TO_DOUBLE ((plugin_interval > 0) ? plugin_interval : interval_g));
putenv (buffer);
ssnprintf (buffer, sizeof (buffer), "COLLECTD_HOSTNAME=%s", hostname_g);
diff --git a/src/ipmi.c b/src/ipmi.c
index 3ec25ea674fa77829d2b88f68773f3b48de58b06..3297729a5a1fe3dceed22168ab5925b44e1fe848 100644 (file)
--- a/src/ipmi.c
+++ b/src/ipmi.c
int status;
/* Don't send `ADD' notifications during startup (~ 1 minute) */
- time_t iv = CDTIME_T_TO_TIME_T (interval_g);
+ time_t iv = CDTIME_T_TO_TIME_T ((plugin_interval > 0) ? plugin_interval : interval_g);
c_ipmi_init_in_progress = 1 + (60 / iv);
c_ipmi_active = 1;
diff --git a/src/libvirt.c b/src/libvirt.c
index 95b46143f1fe61db4c287a6b308af53f2e90bec0..bd7ff1dccc3b9f443fd1adb4beb365b317a4ecb6 100644 (file)
--- a/src/libvirt.c
+++ b/src/libvirt.c
const char *name;
char uuid[VIR_UUID_STRING_BUFLEN];
- vl->interval = interval_g;
+ vl->interval = plugin_interval;
sstrncpy (vl->plugin, "libvirt", sizeof (vl->plugin));
diff --git a/src/memcached.c b/src/memcached.c
index 6ae4843cf7c6d4c41dca58a2d3d4e2450520a560..228beada48491632e474ef87fe9ee058ed0b197f 100644 (file)
--- a/src/memcached.c
+++ b/src/memcached.c
p.revents = 0;
status = poll (&p, /* nfds = */ 1,
- /* timeout = */ CDTIME_T_TO_MS (interval_g));
+ /* timeout = */ CDTIME_T_TO_MS ((plugin_interval > 0)
+ ? plugin_interval : interval_g));
if (status <= 0)
{
if (status == 0)
{
ERROR ("memcached: poll(2) timed out after %.3f seconds.",
- CDTIME_T_TO_DOUBLE (interval_g));
+ CDTIME_T_TO_DOUBLE ((plugin_interval > 0)
+ ? plugin_interval : interval_g));
}
else
{
diff --git a/src/modbus.c b/src/modbus.c
index 5b3bc1cb199fa33baa87513a5322055dbaf1d10c..13ed755b59cd36066c4d298af5be9f3e32ff0e18 100644 (file)
--- a/src/modbus.c
+++ b/src/modbus.c
return (EINVAL);
if (host->interval <= 0)
- host->interval = interval_g;
+ host->interval = (plugin_interval > 0) ? plugin_interval : interval_g;
if (slave->instance[0] == 0)
ssnprintf (slave->instance, sizeof (slave->instance), "slave_%i",
diff --git a/src/network.c b/src/network.c
index 1d6708d5f54d65ca583a4181ed3bc74c8dfb60b9..d1d973fdd5c7b44d324243bd8d272fdbe0c3dbc6 100644 (file)
--- a/src/network.c
+++ b/src/network.c
vl.values = values;
vl.values_len = 2;
vl.time = 0;
- vl.interval = interval_g;
+ vl.interval = plugin_interval;
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "network", sizeof (vl.plugin));
diff --git a/src/powerdns.c b/src/powerdns.c
index ae74b437f3cda36c47e5b991c923c392d45db788..53d7b84b6a81f99b65fe9b2a391d5c3c1a30d3ec 100644 (file)
--- a/src/powerdns.c
+++ b/src/powerdns.c
break;
}
- cdt_timeout = interval_g * 3 / 4;
+ cdt_timeout = ((plugin_interval > 0) ? plugin_interval : interval_g) * 3 / 4;
if (cdt_timeout < TIME_T_TO_CDTIME_T (2))
cdt_timeout = TIME_T_TO_CDTIME_T (2);
diff --git a/src/snmp.c b/src/snmp.c
index 9e3143b735fcdb8e7ed68d43e092bbd33b48398c..667238ab039b0c067a658492c7b26ba8391ed98d 100644 (file)
--- a/src/snmp.c
+++ b/src/snmp.c
host = ud->data;
if (host->interval == 0)
- host->interval = interval_g;
+ host->interval = (plugin_interval > 0) ? plugin_interval : interval_g;
time_start = cdtime ();