-
Notifications
You must be signed in to change notification settings - Fork 51
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
rrdcached local socket issue #88
Comments
I ran into the same. Changed these: diff --git a/lib/datasources/WeatherMapDataSource_rrd.php b/lib/datasources/WeatherMapDataSource_rrd.php
index 40128fc..5da1d0b 100644
--- a/lib/datasources/WeatherMapDataSource_rrd.php
+++ b/lib/datasources/WeatherMapDataSource_rrd.php
@@ -209,7 +209,7 @@ class WeatherMapDataSource_rrd extends WeatherMapDataSource
// rrdcached Support: strip "./" from Data Source
if ($map->daemon)
{
- $rrdfile = trim($rrdfile,"^./");
+ $rrdfile = preg_replace('/^\.\//', '', $rrdfile);
}
$args[] = "fetch";
diff --git a/map-poller.php b/map-poller.php
index 1544be6..de733fc 100755
--- a/map-poller.php
+++ b/map-poller.php
@@ -66,7 +66,7 @@ if (is_dir($conf_dir))
if (!empty($config['rrdcached']))
{
- $cmd = $cmd." --daemon ".$config['rrdcached']." --chdir ''";
+ $cmd = $cmd." --daemon ".$config['rrdcached']." --chdir ".$config['rrd_dir'];
}
else
{
diff --git a/weathermap.php b/weathermap.php
index 489011d..832f0f8 100755
--- a/weathermap.php
+++ b/weathermap.php
@@ -280,6 +280,8 @@ if ($map->ReadConfig($configfile))
if($rrdbase == '') {
$rrdbase = isset($chdir) != '' ? $chdir : $rrd_default_path1;
$map->add_hint('rrd_default_path', $rrdbase);
+ // ^- beware, this does not appear to work sufficiently, we also needed chdir
+ // "SET rrd_default_path /srv/librenms/rrd"
}
Note that the original use of trim() is totally wrong. |
This was referenced Nov 3, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Weathermap seemed to not be reading RRDs properly when using rrdached on a socket such as
unix:/run/rrdcached.sock
Stepping through the cmd as built in map-poller.php got me:
This threw:
So it's looking for the rrd file on an incomplete path. Running:
Confirmed it worked, so for my issue to be fixed I had to modify
map-poller.php
line 71 to read:I then had to comment out two instances of the following in
lib/datasources/WeatherMapDataSource_rrd.php
:Reading through previous pulls / commits I see that plenty of logic has been added recently by @LoveSkylark for their use case which I think uses rrdcached exposed via an ip:port as oppsed to a socket, so I would imagine some extra logic needs to be written around to account for when rrdcached references a socket......unless someone wnats to tell me I'm way off the mark!
The text was updated successfully, but these errors were encountered: