Set the directory to store CSV-files under. Per default CSV-files are generated
beneath the daemon's working directory, i.E<nbsp>e. the B<BaseDir>.
+The special strings B<stdout> and B<stderr> can be used to write to the standard
+output and standard error channels, respectively. This, of course, only makes
+much sense when collectd is running in foreground- or non-daemon-mode.
=item B<StoreRates> B<true|false>
static char *datadir = NULL;
static int store_rates = 0;
+static int use_stdio = 0;
static int value_list_to_string (char *buffer, int buffer_len,
const data_set_t *ds, const value_list_t *vl)
return (-1);
offset += status;
+ if (!use_stdio)
{
time_t now;
struct tm stm;
{
if (datadir != NULL)
free (datadir);
+ if (strcasecmp ("stdout", value) == 0)
+ {
+ use_stdio = 1;
+ return (0);
+ }
+ else if (strcasecmp ("stderr", value) == 0)
+ {
+ use_stdio = 2;
+ return (0);
+ }
datadir = strdup (value);
if (datadir != NULL)
{
if (value_list_to_string (values, sizeof (values), ds, vl) != 0)
return (-1);
+ if (use_stdio)
+ {
+ fprintf (use_stdio == 1 ? stdout : stderr,
+ "%s=%s\n", filename, values);
+ return (0);
+ }
+
if (stat (filename, &statbuf) == -1)
{
if (errno == ENOENT)