librenms-plugins / Weathermap

MIT License
64 stars 52 forks source link

"SET rrd_cf" is ignored #28

Closed deepseth closed 6 years ago

deepseth commented 8 years ago

When adding option "SET rrd_cf MAX" (or any other rrdtool CF), it is disregarded.

./lib/datasources/WeatherMapDataSource_rrd.php:

545                 $cfname = intval($map->get_hint('rrd_cf'));
546                 if($cfname=='') $cfname='AVERAGE';

Given that the value of rrd_cf will be a text string and not an integer, this check on line 545 is problematic.

Simply changing it to: $cfname = $map->get_hint('rrd_cf'); resolves the problems.

Sorry, I can't fork / clone / edit / commit / push and submit a PR from here, but thought I should report this anyway given the simple nature of the fix.