summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6f2fea7)
raw | patch | inline | side by side (parent: 6f2fea7)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 26 Mar 2007 16:44:27 +0000 (18:44 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 26 Mar 2007 16:44:27 +0000 (18:44 +0200) |
13 files changed:
configure.in | patch | blob | history | |
src/Makefile.am | patch | blob | history | |
src/collectd.c | patch | blob | history | |
src/collectd.conf.in | patch | blob | history | |
src/collectd.conf.pod | patch | blob | history | |
src/collectd.h | patch | blob | history | |
src/configfile.c | patch | blob | history | |
src/disk.c | patch | blob | history | |
src/dns.c | patch | blob | history | |
src/mysql.c | patch | blob | history | |
src/ping.c | patch | blob | history | |
src/plugin.c | patch | blob | history | |
src/unixsock.c | patch | blob | history |
diff --git a/configure.in b/configure.in
index 27a6ec482bf1bc131b1d6500bf6e4ca36da24294..f380ca2bec989fe55cbebdeb66e2bc549934f9ad 100644 (file)
--- a/configure.in
+++ b/configure.in
fi
AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
-# Define `step' and `hearbeat' values..
-declare -i collectd_step=10
-declare -i collectd_heartbeat=25
-AC_ARG_WITH(step, [AS_HELP_STRING([--with-step=SECONDS], [Interval in which plugins are queried.])],
-[
- if test "x$withval" != "xno" -a "x$withval" != "xyes"
- then
- declare -i tmp_collectd_step="$withval"
- if test $tmp_collectd_step -gt 0
- then
- collectd_step=$tmp_collectd_step
- let "collectd_heartbeat=$collectd_step*2"
- fi
- fi
-], [])
-AC_ARG_WITH(heartbeat, [AS_HELP_STRING([--with-heartbeat=SECONDS], [Heartbeat of the DS in generated RRD files.])],
-[
- if test "x$withval" != "xno" -a "x$withval" != "xyes"
- then
- declare -i tmp_collectd_heartbeat="$withval"
- if test $tmp_collectd_heartbeat -gt 0
- then
- collectd_heartbeat=$tmp_collectd_heartbeat
- fi
- fi
-], [])
-
-if test $collectd_step -ne 10
-then
- AC_DEFINE_UNQUOTED(COLLECTD_STEP, "$collectd_step", [Interval in which plugins are queried.])
-fi
-if test $collectd_heartbeat -ne 25
-then
- AC_DEFINE_UNQUOTED(COLLECTD_HEARTBEAT, "$collectd_heartbeat", [Interval in which plugins are queried.])
-fi
-
# Check for enabled/disabled features
#
Features:
debug . . . . . . . $enable_debug
daemon mode . . . . $enable_daemon
- step . . . . . . . $collectd_step seconds
- heartbeat . . . . . $collectd_heartbeat seconds
Modules:
apache . . . . . . $enable_apache
iptables . . . . . $enable_iptables
irq . . . . . . . . $enable_irq
load . . . . . . . $enable_load
+ logfile . . . . . . $enable_logfile
mbmon . . . . . . . $enable_mbmon
memory . . . . . . $enable_memory
multimeter . . . . $enable_multimeter
processes . . . . . $enable_processes
sensors . . . . . . $enable_sensors
serial . . . . . . $enable_serial
- logfile . . . . . . $enable_logfile
swap . . . . . . . $enable_swap
syslog . . . . . . $enable_syslog
tape . . . . . . . $enable_tape
diff --git a/src/Makefile.am b/src/Makefile.am
index bcbeedf13cfd4ea3b0942215e675c53b20daf621..44445fb829a01c6b3ce6c134958e05f0f7d9e7f0 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
collectd_CPPFLAGS += -DPIDFILE='"${localstatedir}/run/${PACKAGE_NAME}.pid"'
endif
collectd_CPPFLAGS += -DPLUGINDIR='"${pkglibdir}"'
-if BUILD_FEATURE_DEBUG
-collectd_CPPFLAGS += -DLOGFILE='"${localstatedir}/log/${PACKAGE_NAME}/collectd.log"'
-endif
# Link to these libraries..
collectd_LDFLAGS = -export-dynamic
collectd_DEPENDENCIES += exec.la
endif
-#if BUILD_MODULE_QUOTA
-#pkglib_LTLIBRARIES += quota.la
-#quota_la_SOURCES = quota_plugin.c quota_plugin.h
-#quota_la_SOURCES += quota_fs.c quota_fs.h
-#quota_la_SOURCES += quota_mnt.c quota_mnt.h
-#quota_la_LDFLAGS = -module -avoid-version
-#quota_la_CFLAGS = -Werror
-#collectd_LDADD += "-dlopen" quota.la
-#collectd_DEPENDENCIES += quota.la
-#endif
-
if BUILD_MODULE_HDDTEMP
pkglib_LTLIBRARIES += hddtemp.la
hddtemp_la_SOURCES = hddtemp.c
diff --git a/src/collectd.c b/src/collectd.c
index 9f3c62b7e17cec657a94df111544892c137d39c3..f8f2fcc5b1b05c4032c0f6866436f98a4931716a 100644 (file)
--- a/src/collectd.c
+++ b/src/collectd.c
str = global_option_get ("Interval");
if (str == NULL)
- str = COLLECTD_STEP;
+ str = "10";
interval_g = atoi (str);
if (interval_g <= 0)
{
" Config-File "CONFIGFILE"\n"
" PID-File "PIDFILE"\n"
" Data-Directory "PKGLOCALSTATEDIR"\n"
-#if COLLECT_DEBUG
- " Log-File "LOGFILE"\n"
-#endif
- " Step "COLLECTD_STEP" seconds\n"
- " Heartbeat "COLLECTD_HEARTBEAT" seconds\n"
"\n"PACKAGE" "VERSION", http://collectd.org/\n"
"by Florian octo Forster <octo@verplant.org>\n"
"for contributions see `AUTHORS'\n");
diff --git a/src/collectd.conf.in b/src/collectd.conf.in
index 7ea2a1a72f2b4cff358e6d084b87a0838a5d3c47..dcd87eead3574697086256d9ae69be77ee0b593c 100644 (file)
--- a/src/collectd.conf.in
+++ b/src/collectd.conf.in
# http://collectd.org/
#
-# Set the IP-address(es) and UDP-port(s) to send packets to. `Listen' can be
-# used as a synonym for `Server' to make the config file more readable when in
-# server mode. The port option is optional.
-#Server ff18::efc0:4a42 25826
-#Server 239.192.74.66 25826
-
#BaseDir "/opt/collectd/var/lib/collectd"
#PIDFile "/opt/collectd/var/run/collectd.pid"
#PluginDir "/opt/collectd/lib/collectd"
diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod
index b47fdc1d2b6d97f00a8831b045f18040c47ad9a3..3aaf03eb8acc1e8280d2955229edc0bdba524175 100644 (file)
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
and deleted when the program ist stopped. Some init-scripts might override this
setting using the B<-P> commandline option.
-=item B<LogFile> I<File>
-
-Sets the file to write debugging output to. This is only used if compiled with
-debugging enabled. It's ignored otherwise.
-
=item B<Interval> I<Seconds>
Configures the interval in which to query the read plugins. Obviously smaller
values lead to a higher system load produces by collectd, while higher values
-lead to more coarse statistics. Please note that changing this value may render
-your RRD-files unuseable, if you use the C<rrdtool plugin>. You have been
-warned.
+lead to more coarse statistics.
=back
=item B<HeartBeat> I<Seconds>
-Sets the heartbeat of newly created RRD-files. Ideally (and per default) this
-setting is bigger than the B<Interval>-setting. If unsure, don't set this
-option.
+Sets the heartbeat of newly created RRD-files. Ideally this setting is bigger
+than the B<Interval>-setting, by default it's twice the B<Interval>-setting. If
+unsure, don't set this option.
=item B<RRARows> I<NumRows>
@@ -388,12 +381,12 @@ So for each timespan, it calculates how many PDPs need to be consolidated into
one CDP by calculating:
number of PDPs = timespan / (stepsize * rrarows)
-Bottom line is, set this no smaller than the width of you graphs in pixels.
+Bottom line is, set this no smaller than the width of you graphs in pixels. The
+default is 1200.
=item B<XFF> I<Factor>
-Set the "XFiles Factor". This is mostly interesting if you set B<StepSize>
-bigger than B<Interval>. If unsure, don't set this option.
+Set the "XFiles Factor". The default is 0.1. If unsure, don't set this option.
=item B<CacheFlush> I<Seconds>
diff --git a/src/collectd.h b/src/collectd.h
index 0e8f6f7cdbfce96cb0cb02ef462413229517fdeb..e1ce97c1bf17cf13f2272dd56c45b306bd93d545 100644 (file)
--- a/src/collectd.h
+++ b/src/collectd.h
#define PIDFILE PREFIX "/var/run/" PACKAGE_NAME ".pid"
#endif
-#ifndef LOGFILE
-#define LOGFILE PREFIX"/var/log/"PACKAGE_NAME"/"PACKAGE_NAME".log"
-#endif
-
#ifndef PLUGINDIR
#define PLUGINDIR PREFIX "/lib/" PACKAGE_NAME
#endif
# define COLLECTD_GRP_NAME "collectd"
#endif
-#ifndef COLLECTD_STEP
-# define COLLECTD_STEP "10"
-#endif
-
-#ifndef COLLECTD_HEARTBEAT
-# define COLLECTD_HEARTBEAT "25"
-#endif
-
-#ifndef COLLECTD_ROWS
-# define COLLECTD_ROWS "1200"
-#endif
-
-#ifndef COLLECTD_XFF
-# define COLLECTD_XFF 0.1
-#endif
-
#define STATIC_ARRAY_LEN(array) (sizeof (array) / sizeof ((array)[0]))
extern char hostname_g[];
diff --git a/src/configfile.c b/src/configfile.c
index 3cc0379ba7aa82e420d2b350647277576a250eba..d636c8c70f55249f9d3e6f8b7217c3a7ab3bcbbf 100644 (file)
--- a/src/configfile.c
+++ b/src/configfile.c
static cf_global_option_t cf_global_options[] =
{
{"BaseDir", NULL, PKGLOCALSTATEDIR},
- {"LogFile", NULL, LOGFILE},
{"PIDFile", NULL, PIDFILE},
{"Hostname", NULL, NULL},
{"Interval", NULL, "10"}
diff --git a/src/disk.c b/src/disk.c
index 36d7b4fab0b5317d50c92f535ed78fe4bd5c5ead..2a5b713beeff3dc84ab25f7a2c91e8f85c6acf34 100644 (file)
--- a/src/disk.c
+++ b/src/disk.c
} diskstats_t;
static diskstats_t *disklist;
-static int min_poll_count;
/* #endif KERNEL_LINUX */
#elif HAVE_LIBKSTAT
/* #endif HAVE_IOKIT_IOKITLIB_H */
#elif KERNEL_LINUX
- int step;
- int heartbeat;
-
- step = atoi (COLLECTD_STEP);
- heartbeat = atoi (COLLECTD_HEARTBEAT);
-
- assert (step > 0);
- assert (heartbeat >= step);
-
- min_poll_count = 1 + (heartbeat / step);
- DEBUG ("min_poll_count = %i;", min_poll_count);
+ /* do nothing */
/* #endif KERNEL_LINUX */
#elif HAVE_LIBKSTAT
/* Don't write to the RRDs if we've just started.. */
ds->poll_count++;
- if (ds->poll_count <= min_poll_count)
+ if (ds->poll_count <= 2)
{
- DEBUG ("(ds->poll_count = %i) <= (min_poll_count = %i); => Not writing.",
- ds->poll_count, min_poll_count);
+ DEBUG ("(ds->poll_count = %i) <= (min_poll_count = 2); => Not writing.",
+ ds->poll_count);
continue;
}
diff --git a/src/dns.c b/src/dns.c
index 255d1760394bdc4f04832fa119b2192d9b621f0a..473003a74af301355c9947353344a59c564c6042 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
pcap_obj = pcap_open_live (pcap_device,
PCAP_SNAPLEN,
0 /* Not promiscuous */,
- atoi (COLLECTD_STEP),
+ interval_g,
pcap_error);
if (pcap_obj == NULL)
{
diff --git a/src/mysql.c b/src/mysql.c
index f622d3d653c440244719ba546b7512da5d641049..92b49bff960e930f7abe0aed0ac0741028335280 100644 (file)
--- a/src/mysql.c
+++ b/src/mysql.c
static int wait_for = 0;
static int wait_increase = 60;
- int step;
-
if (state != 0)
{
int err;
}
}
- step = atoi (COLLECTD_STEP);
-
if (wait_for > 0)
{
- wait_for -= step;
+ wait_for -= interval_g;
return (NULL);
}
diff --git a/src/ping.c b/src/ping.c
index 3ac7aaba0b5715e220bea8241e50e5e56d119f7a..7c30a25e51b5e7e0d554f77d2b6cf3542fc81d6d 100644 (file)
--- a/src/ping.c
+++ b/src/ping.c
hostlist_t *hl_this;
hostlist_t *hl_prev;
- int step = atoi (COLLECTD_STEP);
-
hl_this = hosts;
hl_prev = NULL;
while (hl_this != NULL)
}
else
{
- hl_this->wait_left -= step;
+ hl_this->wait_left -= interval_g;
}
if (hl_this != NULL)
{
hostlist_t *hl;
char *host;
- int step = atoi (COLLECTD_STEP);
if ((hl = (hostlist_t *) malloc (sizeof (hostlist_t))) == NULL)
{
}
hl->host = host;
- hl->wait_time = 2 * step;
+ hl->wait_time = 2 * interval_g;
hl->wait_left = 0;
hl->next = hosts;
hosts = hl;
diff --git a/src/plugin.c b/src/plugin.c
index 74a6e5ebb44f3571dde6a92f8661c8d565e5d8b7..85a54edf2cefb3eb1fa1a7e80584cc2d889eba70 100644 (file)
--- a/src/plugin.c
+++ b/src/plugin.c
}
memset (rf, '\0', sizeof (read_func_t));
- rf->wait_time = atoi (COLLECTD_STEP);
+ rf->wait_time = interval_g;
rf->wait_left = 0;
rf->callback = callback;
llentry_t *le;
read_func_t *rf;
int status;
- int step;
if (list_read == NULL)
return;
- step = atoi (COLLECTD_STEP);
-
le = llist_head (list_read);
while ((*loop == 0) && (le != NULL))
{
rf = (read_func_t *) le->value;
if (rf->wait_left > 0)
- rf->wait_left -= step;
+ rf->wait_left -= interval_g;
if (rf->wait_left > 0)
{
le = le->next;
else
{
rf->wait_left = 0;
- rf->wait_time = step;
+ rf->wait_time = interval_g;
}
le = le->next;
{
char message[512];
va_list ap;
- int step;
if (c->delay > 0)
{
return;
}
- step = atoi (COLLECTD_STEP);
- assert (step > 0);
-
- if (c->interval < step)
- c->interval = step;
+ if (c->interval < interval_g)
+ c->interval = interval_g;
else
c->interval *= 2;
if (c->interval > 86400)
c->interval = 86400;
- c->delay = c->interval / step;
+ c->delay = c->interval / interval_g;
va_start (ap, format);
vsnprintf (message, 512, format, ap);
diff --git a/src/unixsock.c b/src/unixsock.c
index bea8a4ff9474186ff70a410a35759c41cda7d17a..4cf3c13465d33d7977700888fd542463e786c0f6 100644 (file)
--- a/src/unixsock.c
+++ b/src/unixsock.c
static int us_write (const data_set_t *ds, const value_list_t *vl)
{
cache_update (ds, vl);
- cache_flush (2 * atoi (COLLECTD_STEP));
+ cache_flush (2 * interval_g);
return (0);
}