New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fix to rrdcached_dir handling #940

Merged
merged 1 commit into from May 8, 2015

Conversation

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

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

This comment has been minimized.

Show comment
Hide comment
@mmarchand

mmarchand May 8, 2015

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

Contributor

mmarchand commented May 8, 2015

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

This comment has been minimized.

Show comment
Hide comment
@f0o

f0o May 8, 2015

Member

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.

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.

@f0o

This comment has been minimized.

Show comment
Hide comment
@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf May 8, 2015

Member

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

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

This comment has been minimized.

Show comment
Hide comment
@f0o

f0o May 8, 2015

Member

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

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

This comment has been minimized.

Show comment
Hide comment
@mmarchand

mmarchand May 8, 2015

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

Contributor

mmarchand commented May 8, 2015

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

This comment has been minimized.

Show comment
Hide comment
@f0o

f0o May 8, 2015

Member

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?

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

This comment has been minimized.

Show comment
Hide comment
@mmarchand

mmarchand May 8, 2015

Contributor

yes, good to go, thank you

Contributor

mmarchand commented May 8, 2015

yes, good to go, thank you

laf added a commit that referenced this pull request May 8, 2015

Merge pull request #940 from f0o/issue-939
Minor fix to rrdcached_dir handling

@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