Minor fix to rrdcached_dir handling #940

Merged
merged 1 commit into from May 8, 2015

Projects

None yet

3 participants

@f0o
Member
f0o commented May 8, 2015

Force relative rrd-paths by prefixing rrd_dir with './'
Allow empty string as rrdcached_dir values

Related: #939

@f0o f0o Force relative rrd-paths by prefixing rrd_dir with './'
Allow empty string as rrdcached_dir values
1ed51da
@mmarchand
Contributor

actually it does not seem to completely fix the issue (rrdcached does not complain, but graphs are not updated either)
I believe the path needs to be cleaned (maybe rrdcached does not handle "./" properly, if I force the syntax "directory/filename.rrd" in include/rrdool.inc.php it does the job
maybe the normalizePath() function in the comments of http://php.net/manual/fr/function.realpath.php is the way to go here or a if "rrdcached_dir" is empty or "." then remove all ./ alltogether

@f0o
Member
f0o commented May 8, 2015

running it on my install atm, give it 30mins to populate and I'll report back - when I initially tested it, it worked fine including graphing.

@laf
Member
laf commented May 8, 2015

Works for me:

OPTIONS="-l 0:42217 -w 900 -z 300 -f 3600 -t 4 -p /var/run/rrdcached/lnms.pid -b /var/log/librenms/rrd -B"

$config['rrdcached'] = "127.0.0.1:42217";
$config['rrd_dir'] = "/var/log/librenms/rrd";
$config['rrdcached_dir'] = "";

RRD[update .//localhost/poller-perf.rrd N:0.259 --daemon 127.0.0.1:42217] OK u:0.00 s:0.00 r:0.26

@f0o
Member
f0o commented May 8, 2015

@mmarchand can you provide us a bit more information on your config/setup so we can replicate your situation?

@mmarchand
Contributor

yes, I found the problem, I was not exactly using the same setup for the frontend and the second poller

first poller + frontend : rrdcached through unix socket , no rrdcached_dir setup (so "" I think)
second poller : rrdcached through TCP socket with rrdcached_dir="."
I guess the frontend used different indexes (missing "./" probably) to try to graph and so failed to found the datas,
I immediately got the datas back when setting up rrdcached through TCP + rrdcached_dir="." on the frontend

@f0o
Member
f0o commented May 8, 2015

When you're using the unix-socket, it's safest to set $config['rrdcached_dir'] to false.

This being sorted, the PR is good to go, right?

@mmarchand
Contributor

yes, good to go, thank you

@laf laf merged commit cc3a490 into librenms:master May 8, 2015

1 check passed

Scrutinizer No new issues
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment