Function name conflict rrd_info() #5478

Closed
julienmorot opened this Issue Jan 16, 2017 · 8 comments

Projects

None yet

3 participants

@julienmorot

Hello team,

Collectd plugin is not working with master, access to collectd tabs gives an apache error 500 in access log file :
"GET /device/device=30/tab=collectd/ HTTP/1.1" 500 5951

With PHP debug enabled, I can see the following error :
PHP Fatal error: Cannot redeclare rrd_info() in /opt/librenms/html/includes/collectd/functions.php on line 448

sed -i 's/rrd_info/myrrd_info' /opt/librenms/html/includes/collectd/functions.php solved the problem because rrd_info is already part of php-rrd package :
http://php.net/rrd_info

Thanks,

Julien Morot

@laf
Member
laf commented Jan 16, 2017

I'd suggest you remove the php-rrd package, we don't use it or rely on it in anyway.

@julienmorot

I can't and probably others users won't be able too.
We rely on php-gd for cacti and probably other users are using different application on the same system (pnp4nagios, etc...) and can't remove php-gd.

@laf
Member
laf commented Jan 17, 2017

php-gd, you said php-rrd earlier?

@julienmorot

Your're right, I didn't took my coffee! It's php-rrd of course ;)

@laf
Member
laf commented Jan 17, 2017

So this can be closed?

@julienmorot
julienmorot commented Jan 17, 2017 edited

It can't be closed. Librenms collectd feature should work as if php-rrd is installed on the system.
The fix is easy, just one function rename and one function call to adapt, nothing that could lead to a regression. Please consider fixing it.

@sorano
Contributor
sorano commented Jan 18, 2017

Then why not submit the fix yourself if it's that easy?

@laf laf added a commit to laf/librenms that referenced this issue Jan 28, 2017
@laf laf refactor: Update collectd functions.php to use non-conflict rrd_info …
…function #5478
10ab45b
@laf
Member
laf commented Jan 28, 2017

I've submitted a fix for this. This is an upstream issue and we can't offer any guarantees that the file won't be updated in the future and break again.

@laf laf closed this in #5642 Jan 28, 2017
@aldemira aldemira added a commit to aldemira/librenms that referenced this issue Feb 9, 2017
@laf @aldemira laf + aldemira refactor: Update collectd functions.php to use non-conflict rrd_info …
…function #5478 (#5642)
631f147
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment