the files. The tradeoff is that the graphs kind of "drag behind" and that more
memory is used.
+=item B<DataDir> I<Directory>
+
+Set the directory to store RRD-files under. Per default RRD-files are generated
+beneath the daemons working directory, i.E<nbsp>e. the B<BaseDir>.
+
=back
=head2 Plugin C<sensors>
static const char *config_keys[] =
{
"CacheTimeout",
+ "DataDir",
NULL
};
-static int config_keys_num = 1;
+static int config_keys_num = 2;
+
+static char *datadir = NULL;
static int cache_timeout = 0;
static time_t cache_flush;
int offset = 0;
int status;
+ if (datadir != NULL)
+ {
+ status = snprintf (buffer + offset, buffer_len - offset,
+ "%s/", datadir);
+ if ((status < 1) || (status >= buffer_len - offset))
+ return (-1);
+ offset += status;
+ }
+
status = snprintf (buffer + offset, buffer_len - offset,
"%s/", vl->host);
if ((status < 1) || (status >= buffer_len - offset))
}
cache_timeout = tmp;
}
+ else if (strcasecmp ("DataDir", key) == 0)
+ {
+ if (datadir != NULL)
+ free (datadir);
+ datadir = strdup (val);
+ if (datadir != NULL)
+ {
+ int len = strlen (datadir);
+ while ((len > 0) && (datadir[len - 1] == '/'))
+ {
+ len--;
+ datadir[len] = '\0';
+ }
+ if (len <= 0)
+ {
+ free (datadir);
+ datadir = NULL;
+ }
+ }
+ }
else
{
return (-1);