librenms-plugins / Weathermap

MIT License
64 stars 52 forks source link

No input b/w for aggregate graph: first input line skipped erroneously #25

Open sthen opened 8 years ago

sthen commented 8 years ago

I'm trying to use this to give a "max traffic of last 24 hours" map:

SET rrd_start now-1day
SET rrd_period 86400
SET rrd_aggregate_function MAXIMUM

At least with rrdtool 1.5.5 this is only showing traffic in one direction, the other is 0. This is because WeatherMapDataSource_rrd.php is skipping the first (supposedly blank) line. Removing the skip fixes it for me and doesn't seem to cause additional problems (it's checking for IN/OUT strings anyway and skipping other lines).

--- lib/datasources/WeatherMapDataSource_rrd.php.orig   Wed Mar 30 11:26:34 2016
+++ lib/datasources/WeatherMapDataSource_rrd.php    Wed Mar 30 11:26:42 2016
@@ -281,7 +281,6 @@ class WeatherMapDataSource_rrd extends WeatherMapDataS

        if (isset($pipe))
        {
-           fgets($pipe, 4096); // skip the blank line
            $buffer='';
            $data_ok = FALSE;