Open lwhitworth opened 2 years ago
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.
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!