author | Florian Forster <octo@huhu.verplant.org> | |
Wed, 26 Mar 2008 08:48:27 +0000 (09:48 +0100) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Wed, 26 Mar 2008 08:48:27 +0000 (09:48 +0100) |
Conflicts:
src/unixsock.c
src/unixsock.c
diff --git a/build.sh b/build.sh
index 89d3a68e0e49d86a3f586cd7c995530c6e344ff7..3efb44f64047c5bdeedf6dc5d646230645a4afcd 100755 (executable)
--- a/build.sh
+++ b/build.sh
#! /bin/sh
+libtoolize=libtoolize
+
+if which glibtoolize > /dev/null 2>&1; then
+ libtoolize=glibtoolize
+fi
+
set -x
autoheader \
&& aclocal \
-&& libtoolize --ltdl --copy --force \
+&& $libtoolize --ltdl --copy --force \
&& automake --add-missing --copy \
&& autoconf
diff --git a/configure.in b/configure.in
index 460b9316d74cc518a9391dfd26e30e3ce181f17f..952f5c5d12bfd1966c7ce81e17fcd77a0125f63e 100644 (file)
--- a/configure.in
+++ b/configure.in
AC_DEFINE_UNQUOTED(COLLECT_LIBIOKIT, [$collect_libiokit], [Wether or not to use the IOKit library])
AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
-with_libstatgrab="yes"
-with_libdevstat="no"
AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
[
if test "x$withval" != "xno" -a "x$withval" != "xyes"
index d17852a79affe9d7f943c38069b2669fe1a39c50..3ef24386548abf19a4588d0d9710a7eb4b744f3c 100644 (file)
(i.E<nbsp>e. data-set) passed to collectd. A large list of predefined
data-sets is available in the B<types.db> file.
-The I<OptionList> is an optional list of I<Options>, where each option if a
+The I<OptionList> is an optional list of I<Options>, where each option is a
key-value-pair. A list of currently understood options can be found below, all
other options will be ignored.
I<Valuelist> is a colon-separated list of the time and the values, each either
-an integer if the data-source is a counter, of a double if the data-source if
+an integer if the data-source is a counter, or a double if the data-source is
of type "gauge". You can submit an undefined gauge-value by using B<U>. When
submitting B<U> to a counter the behavior is undefined. The time is given as
epoch (i.E<nbsp>e. standard UNIX time).
=head1 ABSTRACTION LAYER
-Shipped with the sourcecode comes the Perl-Module L<Collectd::Unixsock> which
+B<collectd> ships the Perl-Module L<Collectd::Unixsock> which
provides an abstraction layer over the actual socket connection. It can be
-found in the directory F<contrib/PerlLib>. If you want to use Perl to
-communicate with the daemon, you're encouraged to use and expand this module.
+found in the directory F<bindings/perl/> in the source distribution or
+(usually) somewhere near F</usr/share/perl5/> if you're using a package. If
+you want to use Perl to communicate with the daemon, you're encouraged to use
+and expand this module.
=head1 SEE ALSO
index db9285b3cf47052581405dcfce2d69170d0c587f..8cc3c8abc616b640e0d45a1eb672c60d2d47df1d 100644 (file)
--- a/src/liboconfig/oconfig.c
+++ b/src/liboconfig/oconfig.c
extern FILE *yyin;
oconfig_item_t *ci_root;
+char *c_file;
static void yyset_in (FILE *fd)
{
int status;
oconfig_item_t *ret;
+ char file[10];
+
yyset_in (fh);
+ if (NULL == c_file) {
+ int status;
+
+ status = snprintf (file, sizeof (file), "<fd#%d>", fileno (fh));
+
+ if ((status < 0) || (status >= sizeof (file))) {
+ c_file = "<unknown>";
+ }
+ else {
+ file[sizeof (file) - 1] = '\0';
+ c_file = file;
+ }
+ }
+
status = yyparse ();
if (status != 0)
{
return (NULL);
}
+ c_file = NULL;
+
ret = ci_root;
ci_root = NULL;
yyset_in ((FILE *) 0);
FILE *fh;
oconfig_item_t *ret;
+ c_file = file;
+
fh = fopen (file, "r");
if (fh == NULL)
{
ret = oconfig_parse_fh (fh);
fclose (fh);
+ c_file = NULL;
+
return (ret);
} /* oconfig_item_t *oconfig_parse_file */
index 8df2c6e5fb230eaed09db85d73e6ad8d5294a819..49cd139dbd76bd1e4505b3184194d6066a1be11b 100644 (file)
--- a/src/liboconfig/parser.y
+++ b/src/liboconfig/parser.y
extern char *yytext;
extern oconfig_item_t *ci_root;
+extern char *c_file;
%}
%start entire_file
%type <sl> statement_list
%type <ci> entire_file
+/* pass an verbose, specific error message to yyerror() */
+%error-verbose
+
%%
string:
QUOTED_STRING {$$ = unquote ($1);}
%%
static int yyerror (const char *s)
{
- fprintf (stderr, "Error in line %i near `%s': %s\n", yylineno, yytext, s);
+ char *text;
+
+ if (*yytext == '\n')
+ text = "<newline>";
+ else
+ text = yytext;
+
+ fprintf (stderr, "Parse error in file `%s', line %i near `%s': %s\n",
+ c_file, yylineno, text, s);
return (-1);
} /* int yyerror */
diff --git a/src/perl.c b/src/perl.c
index d17551ee663935b5af4c9e49f49a5c6b2a1e6647..96e85622445da09a7b9ad8deae514e215d279e6f 100644 (file)
--- a/src/perl.c
+++ b/src/perl.c
/**
* collectd - src/perl.c
- * Copyright (C) 2007 Sebastian Harl
+ * Copyright (C) 2007, 2008 Sebastian Harl
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
diff --git a/src/sensors.c b/src/sensors.c
index 1289d4b68177b1f75483712146591854168f92b0..a96e04ccf7f66ee2dbc4823a1a8a449db44d32d9 100644 (file)
--- a/src/sensors.c
+++ b/src/sensors.c
/* "master features" only */
if (feature->mapping != SENSORS_NO_MAPPING)
+ {
+ DEBUG ("sensors plugin: sensors_load_conf: "
+ "Ignoring subfeature `%s', "
+ "because (feature->mapping "
+ "!= SENSORS_NO_MAPPING).",
+ feature->name);
continue;
+ }
/* skip ignored in sensors.conf */
if (sensors_get_ignored (*chip, feature->number) == 0)
- break;
+ {
+ DEBUG ("sensors plugin: sensors_load_conf: "
+ "Ignoring subfeature `%s', "
+ "because "
+ "`sensors_get_ignored' told "
+ "me so.",
+ feature->name);
+ continue;
+ }
feature_type = sensors_feature_name_to_type (
feature->name);
if (feature_type == SENSOR_TYPE_UNKNOWN)
+ {
+ DEBUG ("sensors plugin: sensors_load_conf: "
+ "Ignoring subfeature `%s', "
+ "because its type is "
+ "unknown.",
+ feature->name);
continue;
+ }
fl = (featurelist_t *) malloc (sizeof (featurelist_t));
if (fl == NULL)
if ((feature->type != SENSORS_FEATURE_IN)
&& (feature->type != SENSORS_FEATURE_FAN)
&& (feature->type != SENSORS_FEATURE_TEMP))
+ {
+ DEBUG ("sensors plugin: sensors_load_conf: "
+ "Ignoring feature `%s', "
+ "because its type is not "
+ "supported.", feature->name);
continue;
+ }
while ((subfeature = sensors_get_all_subfeatures (chip,
feature, &subfeature_num)) != NULL)
diff --git a/src/wireless.c b/src/wireless.c
index 48705989773c4994e7c4960104693b306f069b0d..285fb744748c64714aa7eed8948e2f5b73df73c3 100644 (file)
--- a/src/wireless.c
+++ b/src/wireless.c
power = 1.0; /* invalid */
/* noise [dBm] < 0.0 */
- noise = strtod (fields[3], &endptr);
- if (fields[3] == endptr)
+ noise = strtod (fields[4], &endptr);
+ if (fields[4] == endptr)
noise = 1.0; /* invalid */
else if ((noise >= 0.0) && (noise <= 100.0))
noise = wireless_percent_to_power (noise);