summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3390e46)
raw | patch | inline | side by side (parent: 3390e46)
author | Sebastian Harl <sh@tokkee.org> | |
Wed, 23 May 2007 12:21:19 +0000 (14:21 +0200) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Wed, 23 May 2007 16:03:19 +0000 (18:03 +0200) |
This option allows to test the configuration only. The program immediately
exits after parsing the config file. A return code not equal to zero indicates
an error.
Some typos have been fixed as well.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
exits after parsing the config file. A return code not equal to zero indicates
an error.
Some typos have been fixed as well.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
ChangeLog | patch | blob | history | |
src/collectd.c | patch | blob | history | |
src/collectd.pod | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index 25c75bfd227cd783dd45bbd467ba42eb5598c9f6..05772cf659f5858cf9e670b574410788a945b920 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
* collectd: The read-function has been changed to read many plugins in
parallel, using threads. Thus, plugins generally need to use
thread-safe functions from now on.
- * csv plugin: The new `csv' plugin handles output to `comma seperated
+ * collectd: The '-t' command line options allows to perform syntax tests
+ of the configuration file and exit immediately.
+ * csv plugin: The new `csv' plugin handles output to `comma separated
values'-files.
* rrdtool plugin: The new `rrdtool' plugin handles output to
RRD-files. Data can be cached to combine multiple updates into one
plugin.
* irq plugin: The new `irq' plugin collects the IRQ-counters. Thanks
to Peter Holik for contributing this plugin.
- * nut plugin: The new `nut' plugin connects the the upsd of the
- `network ups tools' and reads information about the connected UPS.
+ * nut plugin: The new `nut' plugin connects the upsd of the `network
+ ups tools' and reads information about the connected UPS.
* apache plugin: Support for lighttpd's `BusyServers' (aka.
connections) field was added by Florent Monbillard.
* collectd-nagios: The new `collectd-nagios' binary queries values
diff --git a/src/collectd.c b/src/collectd.c
index 49998f96101b9c7d94e48d76aa92c63c7b80eff9..4fbd5c0923193bdd95832278a84f467941bca77b 100644 (file)
--- a/src/collectd.c
+++ b/src/collectd.c
struct sigaction sigIntAction;
struct sigaction sigTermAction;
char *configfile = CONFIGFILE;
+ int test_config = 0;
const char *basedir;
#if COLLECT_DAEMON
struct sigaction sigChldAction;
{
int c;
- c = getopt (argc, argv, "hC:"
+ c = getopt (argc, argv, "htC:"
#if COLLECT_DAEMON
"fP:"
#endif
case 'C':
configfile = optarg;
break;
+ case 't':
+ test_config = 1;
+ break;
#if COLLECT_DAEMON
case 'P':
global_option_set ("PIDFile", optarg);
if (init_global_variables () != 0)
return (1);
+ if (test_config)
+ return (0);
+
#if COLLECT_DAEMON
/*
* fork off child
diff --git a/src/collectd.pod b/src/collectd.pod
index d7c854e1087dfce44d8ccc8843b43e7ccc958b1b..aae4315416c49f07e37f3dadca5cb421ff63e38a 100644 (file)
--- a/src/collectd.pod
+++ b/src/collectd.pod
collectd is a daemon that receives system statistics and makes them available
in a number of ways. The main daemon itself doesn't have any real functionality
-appart from loading, querying and submitting to plugins. For a description of
+apart from loading, querying and submitting to plugins. For a description of
available plugins please see L</PLUGINS> below.
=head1 OPTIONS
change B<collectd>'s behavior. The path may be relative to the current working
directory.
+=item B<-t>
+
+Test the configuration only. The program immediately exits after parsing the
+config file. A return code not equal to zero indicates an error.
+
=item B<-P> I<E<lt>pid-fileE<gt>>
Specify an alternative pid file. This overwrites any settings in the config