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
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
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");
# 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"
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>
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>
#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[];
static cf_global_option_t cf_global_options[] =
{
{"BaseDir", NULL, PKGLOCALSTATEDIR},
- {"LogFile", NULL, LOGFILE},
{"PIDFile", NULL, PIDFILE},
{"Hostname", NULL, NULL},
{"Interval", NULL, "10"}
} 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;
}
pcap_obj = pcap_open_live (pcap_device,
PCAP_SNAPLEN,
0 /* Not promiscuous */,
- atoi (COLLECTD_STEP),
+ interval_g,
pcap_error);
if (pcap_obj == NULL)
{
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);
}
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;
}
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);
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);
}