summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a28ebbb)
raw | patch | inline | side by side (parent: a28ebbb)
author | Sebastian Harl <sh@tokkee.org> | |
Tue, 3 Feb 2009 13:08:32 +0000 (14:08 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Thu, 5 Feb 2009 20:10:26 +0000 (21:10 +0100) |
Basically any (read) plugin was calling time(NULL) to set the time of a values
list. This is now done by plugin_dispatch_values() in case the time is zero
(which is the case when using VALUE_LIST_INIT or VALUE_LIST_STATIC).
This change slightly simplifies the code and makes future changes to the time
management (like the possibly upcoming subsecond resolution support) less
intrusive in respect to the amount of required code changes.
list. This is now done by plugin_dispatch_values() in case the time is zero
(which is the case when using VALUE_LIST_INIT or VALUE_LIST_STATIC).
This change slightly simplifies the code and makes future changes to the time
management (like the possibly upcoming subsecond resolution support) less
intrusive in respect to the amount of required code changes.
56 files changed:
diff --git a/src/apache.c b/src/apache.c
index c6bf8addfed4d6918c7345e5839b3a92105a4c3f..7dc34f5bf6a2b450c1a6542ba75108b7eed575f8 100644 (file)
--- a/src/apache.c
+++ b/src/apache.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "apache", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "apache", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
diff --git a/src/apcups.c b/src/apcups.c
index ca026b9689907f49f7227c3ae612b54e4ff4cfef..456491758122a6ece7365a7eafc1b176cf127367 100644 (file)
--- a/src/apcups.c
+++ b/src/apcups.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "apcups", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
diff --git a/src/apple_sensors.c b/src/apple_sensors.c
index d312027670a2b34c68bd2974d90095a93201b168..bdba0ff85287745c960c1e5399d813aad2c116e2 100644 (file)
--- a/src/apple_sensors.c
+++ b/src/apple_sensors.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "apple_sensors", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
diff --git a/src/ascent.c b/src/ascent.c
index 6285176a9a6b9e7406d1bc5b47fdfd4a9e2e8770..bf1e9f4a8ab078dd01091e05078abe475725a029 100644 (file)
--- a/src/ascent.c
+++ b/src/ascent.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "ascent", sizeof (vl.plugin));
diff --git a/src/battery.c b/src/battery.c
index 416f3397d0e6c01da373ca17dfc8d48fac8ab03a..d142982df4c7926a08bee11bf778a405d8253c19 100644 (file)
--- a/src/battery.c
+++ b/src/battery.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "battery", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
diff --git a/src/bind.c b/src/bind.c
index e09da1927e71018438405176ca71f806ea33b023..f9de8e6a87c2029c1dbc7bdf9add36338e331532 100644 (file)
--- a/src/bind.c
+++ b/src/bind.c
@@ -263,7 +263,7 @@ static void submit_counter(time_t ts, const char *plugin_instance, const char *t
vl.values = values;
vl.values_len = 1;
- vl.time = (ts == 0) ? time (NULL) : ts;
+ vl.time = ts;
sstrncpy(vl.host, hostname_g, sizeof(vl.host));
sstrncpy(vl.plugin, "bind", sizeof(vl.plugin));
if (plugin_instance) {
diff --git a/src/cpu.c b/src/cpu.c
index e9ab78320d4523848274f726eb42e2bb87eb030f..9a565c57aad6e890421ea2860fabc1ec6d6a6549 100644 (file)
--- a/src/cpu.c
+++ b/src/cpu.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "cpu", sizeof (vl.plugin));
ssnprintf (vl.plugin_instance, sizeof (vl.type_instance),
diff --git a/src/cpufreq.c b/src/cpufreq.c
index 3738b54c2f450eb8f3f4e52994f9180b369d3850..b92b1d095226c6a9deea13fa6731d5a68b213478 100644 (file)
--- a/src/cpufreq.c
+++ b/src/cpufreq.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "cpufreq", sizeof (vl.plugin));
sstrncpy (vl.type, "cpufreq", sizeof (vl.type));
diff --git a/src/df.c b/src/df.c
index 26d23826fccf32c81420f417192956737f64bdc8..38079d8772e232f44ac690cc636222a67e45195e 100644 (file)
--- a/src/df.c
+++ b/src/df.c
vl.values = values;
vl.values_len = 2;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "df", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
diff --git a/src/disk.c b/src/disk.c
index 29aa979018b42bc9621d5b011a73daf0ae12722c..489770c7f9da86b9f8c0cb50d918871933c05603 100644 (file)
--- a/src/disk.c
+++ b/src/disk.c
vl.values = values;
vl.values_len = 2;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "disk", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance,
diff --git a/src/dns.c b/src/dns.c
index c04169fec8a4809cb9e7b5516b5011e8d49a6e3a..d82cbd86cc19809f7ff4180868534911a9049dc7 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "dns", sizeof (vl.plugin));
sstrncpy (vl.type, type, sizeof (vl.type));
vl.values = values;
vl.values_len = 2;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "dns", sizeof (vl.plugin));
sstrncpy (vl.type, "dns_octets", sizeof (vl.type));
diff --git a/src/email.c b/src/email.c
index 5e103ed7a82b4330a719230b31620d1df52bc903..ff9d439423124f9f4cba93e6d0cb606c551bd879 100644 (file)
--- a/src/email.c
+++ b/src/email.c
@@ -656,7 +656,6 @@ static void email_submit (const char *type, const char *type_instance, gauge_t v
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "email", sizeof (vl.plugin));
sstrncpy (vl.type, type, sizeof (vl.type));
diff --git a/src/entropy.c b/src/entropy.c
index 2e20a67c08661dbdebd4e66e276184e17d97983b..d56be6dc1df8f4645eb7c4f04a820ee978d87a8b 100644 (file)
--- a/src/entropy.c
+++ b/src/entropy.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "entropy", sizeof (vl.plugin));
sstrncpy (vl.type, "entropy", sizeof (vl.type));
diff --git a/src/filecount.c b/src/filecount.c
index e2b002074fd9462fc0bc047e1bdc3b11b2428a1d..05bb4b3792e16b72d83cb8cf00827cf58443c7f7 100644 (file)
--- a/src/filecount.c
+++ b/src/filecount.c
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "filecount", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, dir->instance, sizeof (vl.plugin_instance));
diff --git a/src/hddtemp.c b/src/hddtemp.c
index 9f4a7254feede2d27d057bdf5750bb1ee3f73ba2..cc67c63989d7593956f40141d848ceaa3da74c3c 100644 (file)
--- a/src/hddtemp.c
+++ b/src/hddtemp.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "hddtemp", sizeof (vl.plugin));
sstrncpy (vl.type, "temperature", sizeof (vl.type));
diff --git a/src/interface.c b/src/interface.c
index 7512c4ee3c21c7e07fc591f3c4bdf19f057746ac..520f4c8d81db6470c7b19f74502e87d551d6b145 100644 (file)
--- a/src/interface.c
+++ b/src/interface.c
vl.values = values;
vl.values_len = 2;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "interface", sizeof (vl.plugin));
sstrncpy (vl.type, type, sizeof (vl.type));
diff --git a/src/ipmi.c b/src/ipmi.c
index b5e274480eda113f779f2bb0c0bbc38858e592bc..105907055824c883dc1b473674cb179cdc3e9f18 100644 (file)
--- a/src/ipmi.c
+++ b/src/ipmi.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "ipmi", sizeof (vl.plugin));
diff --git a/src/iptables.c b/src/iptables.c
index e1694af3475407ae75ba98de73e8b48598e63a56..9abee364b1fc36b0e3906927d647ac8165cd738d 100644 (file)
--- a/src/iptables.c
+++ b/src/iptables.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "iptables", sizeof (vl.plugin));
diff --git a/src/ipvs.c b/src/ipvs.c
index 85e65d27e57823f2fa3776237d125cf5db82e4d3..87eee108a79410853b6f02e107697b7a358f465a 100644 (file)
--- a/src/ipvs.c
+++ b/src/ipvs.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
vl.interval = interval_g;
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
vl.values = values;
vl.values_len = 2;
- vl.time = time (NULL);
vl.interval = interval_g;
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
diff --git a/src/irq.c b/src/irq.c
index 9b7e61877d8c62bafc009e91e1f792c43024e63e..986efafbb8e77a5d19debbfa0b634cbec230ffdc 100644 (file)
--- a/src/irq.c
+++ b/src/irq.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "irq", sizeof (vl.plugin));
sstrncpy (vl.type, "irq", sizeof (vl.type));
diff --git a/src/load.c b/src/load.c
index 72c7756a34b27d325b82fcc084e3afdb77f02dc8..9c75ae1169b0ebdc6f029a5b827c252bb105cf26 100644 (file)
--- a/src/load.c
+++ b/src/load.c
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "load", sizeof (vl.plugin));
sstrncpy (vl.type, "load", sizeof (vl.type));
diff --git a/src/mbmon.c b/src/mbmon.c
index 344caddffd91f286b94b96721d065b4c2751f652..859714c2782f28d42d42cd401fea017259187ea8 100644 (file)
--- a/src/mbmon.c
+++ b/src/mbmon.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "mbmon", sizeof (vl.plugin));
sstrncpy (vl.type, type, sizeof (vl.type));
diff --git a/src/memcached.c b/src/memcached.c
index f139b7195591f637a51998b5fe132192414dabfa..b5a4b208365b8fba6d99453387f8c10d492ae916 100644 (file)
--- a/src/memcached.c
+++ b/src/memcached.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "memcached", sizeof (vl.plugin));
sstrncpy (vl.type, type, sizeof (vl.type));
diff --git a/src/memory.c b/src/memory.c
index c31b30efe29b109cf3ae7c73055a48502c5b21fb..ebaa8f29ce76f9e2bc9681c0a6a9d17376f5e9bb 100644 (file)
--- a/src/memory.c
+++ b/src/memory.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "memory", sizeof (vl.plugin));
sstrncpy (vl.type, "memory", sizeof (vl.type));
diff --git a/src/multimeter.c b/src/multimeter.c
index e3da00a1520a98109d210b4217f84375cce2e25e..775eb57e27bff64201f81e83cf6528c36fa0608e 100644 (file)
--- a/src/multimeter.c
+++ b/src/multimeter.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "multimeter", sizeof (vl.plugin));
sstrncpy (vl.type, "multimeter", sizeof (vl.type));
diff --git a/src/mysql.c b/src/mysql.c
index 57ad23978de761297e235d3d87c28824a16b5b13..1c009a07e56c3631446ff5fe2fa9f3b8d60743f7 100644 (file)
--- a/src/mysql.c
+++ b/src/mysql.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "mysql", sizeof (vl.plugin));
sstrncpy (vl.type, type, sizeof (vl.type));
vl.values = values;
vl.values_len = 5;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "mysql", sizeof (vl.plugin));
sstrncpy (vl.type, "mysql_qcache", sizeof (vl.type));
vl.values = values;
vl.values_len = 4;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "mysql", sizeof (vl.plugin));
sstrncpy (vl.type, "mysql_threads", sizeof (vl.type));
vl.values = values;
vl.values_len = 2;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "mysql", sizeof (vl.plugin));
sstrncpy (vl.type, "mysql_octets", sizeof (vl.type));
diff --git a/src/netlink.c b/src/netlink.c
index d14e5101dd885824b904b754845aa039dca05630..d7d1a269f1de93c725b2cc0112bafe5962e103b7 100644 (file)
--- a/src/netlink.c
+++ b/src/netlink.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "netlink", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, dev, sizeof (vl.plugin_instance));
vl.values = values;
vl.values_len = 2;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "netlink", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, dev, sizeof (vl.plugin_instance));
diff --git a/src/nfs.c b/src/nfs.c
index f2db895a00d484bf647e1c2a9a7688dd106ca31e..e4d12e342a6e6b275b38b956c84ea93acceef465 100644 (file)
--- a/src/nfs.c
+++ b/src/nfs.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "nfs", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance,
diff --git a/src/nginx.c b/src/nginx.c
index 91bcf75404927bfcd708e16faf71b5b7606fe304..8cb762859b9a1f2bdafb521250c1d0b3fff0c664 100644 (file)
--- a/src/nginx.c
+++ b/src/nginx.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "nginx", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
diff --git a/src/ntpd.c b/src/ntpd.c
index 14f06ebcd887b1c37d9f67a847ce478a4cf1f89f..64e1bce5e03db170accdf18f1a004f94c16652d4 100644 (file)
--- a/src/ntpd.c
+++ b/src/ntpd.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "ntpd", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
diff --git a/src/nut.c b/src/nut.c
index 8796d5873377cb6fbb61c51a65f011616f235c76..edc48c61510ab6e716abe17b52d222136ee7ceba 100644 (file)
--- a/src/nut.c
+++ b/src/nut.c
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- vl.time = time (NULL);
sstrncpy (vl.host,
(strcasecmp (ups->hostname, "localhost") == 0)
? hostname_g
diff --git a/src/onewire.c b/src/onewire.c
index dd7f527ddc99f7f0ed62621649d59b9b7f294680..c40d5ad73077c4243074d4ae27ff3424d76b4204 100644 (file)
--- a/src/onewire.c
+++ b/src/onewire.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "onewire", sizeof (vl.plugin));
diff --git a/src/openvpn.c b/src/openvpn.c
index a2f48236bbca9cf1c11b72276cc2558e1fe897d0..083e2e31293b7ac31bbbf596c895d9fea8e05fea 100644 (file)
--- a/src/openvpn.c
+++ b/src/openvpn.c
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "openvpn", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, name, sizeof (vl.plugin_instance));
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "openvpn", sizeof (vl.plugin));
sstrncpy (vl.type, "compression_ratio", sizeof (vl.type));
diff --git a/src/perl.c b/src/perl.c
index 4a76c0aa6f636d9075057c83e39b8d6b6b5c060d..b5965d67c2386cc826502591cb202fe8e44ddd5b 100644 (file)
--- a/src/perl.c
+++ b/src/perl.c
if (NULL != (tmp = hv_fetch (values, "time", 4, 0))) {
list.time = (time_t)SvIV (*tmp);
}
- else {
- list.time = time (NULL);
- }
if (NULL != (tmp = hv_fetch (values, "host", 4, 0))) {
sstrncpy (list.host, SvPV_nolen (*tmp), sizeof (list.host));
diff --git a/src/ping.c b/src/ping.c
index ac5b0f85907040ab0b7fbc242f6dad85d81ce79c..7ffbfaff037a8d2001de9675547afe7b007d0f79 100644 (file)
--- a/src/ping.c
+++ b/src/ping.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "ping", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
diff --git a/src/plugin.c b/src/plugin.c
index 95b9fa37948dde97d65bbb06e5a05b8cd63162c8..cd7b10834c4559f8e456ef8e6efe20bdf51f4271 100644 (file)
--- a/src/plugin.c
+++ b/src/plugin.c
return (-1);
}
+ if (vl->time == 0)
+ vl->time = time (NULL);
+
DEBUG ("plugin_dispatch_values: time = %u; interval = %i; "
"host = %s; "
"plugin = %s; plugin_instance = %s; "
diff --git a/src/postgresql.c b/src/postgresql.c
index 2814cc4ad6f3263ff7b10ca239662514b65d2d94..c5b52d0beba3cd0adabafa5716f1046b8844ef9c 100644 (file)
--- a/src/postgresql.c
+++ b/src/postgresql.c
vl.values = values;
vl.values_len = res->values_num;
- vl.time = time (NULL);
if (C_PSQL_IS_UNIX_DOMAIN_SOCKET (db->host)
|| (0 == strcmp (db->host, "localhost")))
diff --git a/src/powerdns.c b/src/powerdns.c
index 189c46fec1bbf2cb7383096418da4b5649f94d97..164137ba39da5f9019bf037faff07efbafea1c26 100644 (file)
--- a/src/powerdns.c
+++ b/src/powerdns.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "powerdns", sizeof (vl.plugin));
sstrncpy (vl.type, type, sizeof (vl.type));
diff --git a/src/processes.c b/src/processes.c
index 0b824821335c8fa72f2f4dfd5e8cda3722e44c26..553b1955c2f868904f728f315203bdbb848327c4 100644 (file)
--- a/src/processes.c
+++ b/src/processes.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "processes", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
vl.values = values;
vl.values_len = 2;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "processes", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, ps->name, sizeof (vl.plugin_instance));
diff --git a/src/rrdcached.c b/src/rrdcached.c
index f9d65ca55c45cf3f06ed44fb295f438afba9b5bc..31c6352411fc4481deb584f37e9f07c59bf321e2 100644 (file)
--- a/src/rrdcached.c
+++ b/src/rrdcached.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
if ((strncmp ("unix:", daemon_address, strlen ("unix:")) == 0)
|| (daemon_address[0] == '/'))
diff --git a/src/sensors.c b/src/sensors.c
index 5ed82a8c64836cf08e881743343877f04391d575..b600d4cf1fca0c52a6c24ed075e6fc3e9a0e45f6 100644 (file)
--- a/src/sensors.c
+++ b/src/sensors.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "sensors", sizeof (vl.plugin));
diff --git a/src/serial.c b/src/serial.c
index 1c874e52177e919d59056126015da12edf760109..cfa26bbd120b268cefea5d90669bd58917d3bb82 100644 (file)
--- a/src/serial.c
+++ b/src/serial.c
vl.values = values;
vl.values_len = 2;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "serial", sizeof (vl.plugin));
sstrncpy (vl.type, "serial_octets", sizeof (vl.type));
diff --git a/src/snmp.c b/src/snmp.c
index 3ba93fe8438078c92bf3481401dfd11a8441f103..44fce620e4f1d3ddca663237373802567b63fd08 100644 (file)
--- a/src/snmp.c
+++ b/src/snmp.c
@@ -963,7 +963,6 @@ static int csnmp_dispatch_table (host_definition_t *host, data_definition_t *dat
sstrncpy (vl.plugin, "snmp", sizeof (vl.plugin));
vl.interval = host->interval;
- vl.time = time (NULL);
subid = 0;
have_more = 1;
@@ -1385,7 +1384,6 @@ static int csnmp_read_value (host_definition_t *host, data_definition_t *data)
return (-1);
}
- vl.time = time (NULL);
for (vb = res->variables; vb != NULL; vb = vb->next_variable)
{
diff --git a/src/swap.c b/src/swap.c
index 8c09e35f2f0246b43877b5fefd3d3062e6cd512f..b8b5f09830629e57dd34c80b739a38e0e7e6cee3 100644 (file)
--- a/src/swap.c
+++ b/src/swap.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "swap", sizeof (vl.plugin));
sstrncpy (vl.type, "swap", sizeof (vl.type));
diff --git a/src/tape.c b/src/tape.c
index caca537b0038be024f2771d979f3eeeb289ce53d..32b42965c55d5e31ca6a5e53f54554cd0842aa54 100644 (file)
--- a/src/tape.c
+++ b/src/tape.c
vl.values = values;
vl.values_len = 2;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "tape", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance,
diff --git a/src/tcpconns.c b/src/tcpconns.c
index aa1fa38b037b08977efac02443f85cfb95cd9f49..f576b68f31e00ae120f923ce4ba1d808528022ae 100644 (file)
--- a/src/tcpconns.c
+++ b/src/tcpconns.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "tcpconns", sizeof (vl.plugin));
sstrncpy (vl.type, "tcp_connections", sizeof (vl.type));
diff --git a/src/teamspeak2.c b/src/teamspeak2.c
index 5cd427afc2bb5ccb0c173d8791401e51fe682707..e81dbe302bf40fa71b4c8880aa9caab8cf95ab8d 100644 (file)
--- a/src/teamspeak2.c
+++ b/src/teamspeak2.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "teamspeak2", sizeof (vl.plugin));
vl.values = values;
vl.values_len = 2;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "teamspeak2", sizeof (vl.plugin));
diff --git a/src/thermal.c b/src/thermal.c
index b6136480c1e5036606f2e9730538e8c068d69e83..79033b171bd393a4f456c4459533887372b69bf3 100644 (file)
--- a/src/thermal.c
+++ b/src/thermal.c
vt.gauge = value;
vl.values = &vt;
- vl.time = time (NULL);
sstrncpy (vl.plugin, "thermal", sizeof(vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance,
sizeof(vl.plugin_instance));
diff --git a/src/users.c b/src/users.c
index 1231075a324803bd3fa866396c62563763496e67..b605ff84c9d7ab98cfb8abbd762b8d30207882fe 100644 (file)
--- a/src/users.c
+++ b/src/users.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "users", sizeof (vl.plugin));
sstrncpy (vl.type, "users", sizeof (vl.plugin));
diff --git a/src/utils_cmd_putval.c b/src/utils_cmd_putval.c
index 91b70160f063590e477cd415253e38d1099abc1b..5bd6ec738fd2e188b4b253e3e7ce51937383690a 100644 (file)
--- a/src/utils_cmd_putval.c
+++ b/src/utils_cmd_putval.c
*value_str = '\0'; value_str++;
vl->time = (time_t) atoi (time_str);
- if (vl->time == 0)
- vl->time = time (NULL);
i = 0;
dummy = value_str;
diff --git a/src/utils_db_query.c b/src/utils_db_query.c
index 868b53bf5c92e68fb24c0aaf7ae42612dd22c645..b4ce09abfb3b96c1edf20fc572c9e0fcab0066a9 100644 (file)
--- a/src/utils_db_query.c
+++ b/src/utils_db_query.c
}
}
- vl.time = time (NULL);
sstrncpy (vl.host, q->host, sizeof (vl.host));
sstrncpy (vl.plugin, q->plugin, sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, q->db_name, sizeof (vl.type_instance));
diff --git a/src/utils_tail_match.c b/src/utils_tail_match.c
index f518b1cd9172304d0319851b78c862c48a6a2388..26e9531119e5f0717ecb022ef90e1346bebf5e3b 100644 (file)
--- a/src/utils_tail_match.c
+++ b/src/utils_tail_match.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, data->plugin, sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, data->plugin_instance,
diff --git a/src/vmem.c b/src/vmem.c
index 25f7c70cd3c15b581f0f22f3252e921c82373c33..6775d20ddf0b3b4788fb4132d8359334af1d045b 100644 (file)
--- a/src/vmem.c
+++ b/src/vmem.c
vl.values = values;
vl.values_len = values_len;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "vmem", sizeof (vl.plugin));
if (plugin_instance != NULL)
diff --git a/src/vserver.c b/src/vserver.c
index dac4392693159ad63dc1a095536b5a4cbefe9d09..8747d9ba90b01cf26b4cf07cf9b97e5f4827e922 100644 (file)
--- a/src/vserver.c
+++ b/src/vserver.c
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "vserver", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "vserver", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "vserver", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
diff --git a/src/wireless.c b/src/wireless.c
index 21bbcb401b141e0c09bb7f2a1cb8ce1db5f881b6..f7ba735d37687356d16d3d7bd5b3ff230736563d 100644 (file)
--- a/src/wireless.c
+++ b/src/wireless.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "wireless", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance,
diff --git a/src/xmms.c b/src/xmms.c
index 09786fc9282b6f01bd8568750b771e4f8df039ea..52beb65f8a5d21d32880f81a58be887363390873 100644 (file)
--- a/src/xmms.c
+++ b/src/xmms.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "xmms", sizeof (vl.plugin));
sstrncpy (vl.type, type, sizeof (vl.type));