the C<--daemon> option on the command line. If both are present, the command
line argument takes precedence.
+=item B<RRDCACHED_STRIPPATH>
+
+If this environment variable is set it will strip the leading string from the
+filename prior to sending the filename to rrdcached.
+This is mostly intended to allow rrdcached to work with xymon and cacti tools
+without having to modify those tools.
+
=back
=head1 EXAMPLES
static const char *get_path (const char *path, char *resolved_path) /* {{{ */
{
const char *ret = path;
+ const char *strip = getenv(ENV_RRDCACHED_STRIPPATH);
+ size_t len;
int is_unix = 0;
if ((path == NULL) || (resolved_path == NULL) || (sd_path == NULL))
{
if (*path == '/') /* not absolute path */
{
- rrd_set_error ("absolute path names not allowed when talking "
+ /* if we are stripping, then check and remove the head */
+ if (strip) {
+ len = strlen(strip);
+ if (strncmp(path,strip,len)==0) {
+ path += len;
+ while (*path == '/')
+ path++;
+ return path;
+ }
+ } else
+ rrd_set_error ("absolute path names not allowed when talking "
"to a remote daemon");
return NULL;
}
#define RRDCACHED_DEFAULT_PORT "42217"
#define ENV_RRDCACHED_ADDRESS "RRDCACHED_ADDRESS"
-
+#define ENV_RRDCACHED_STRIPPATH "RRDCACHED_STRIPPATH"
int rrdc_connect (const char *addr);
int rrdc_is_connected(const char *daemon_addr);