librenms-plugins / Weathermap

MIT License
64 stars 51 forks source link

Minimal set of patches to get Weathermap to work with php 8.0 #79

Closed rvstaveren closed 1 year ago

rvstaveren commented 2 years ago

When trying to use the Weathermap plugin with a LibreNMS (FreeBSD package librenms-22.2.1,1, which uses php 8.0 for its dependencies) I had to make the fixes as made in this pull request.

fbouynot commented 2 years ago

Hi, it works for me with php8.1.

fbouynot commented 2 years ago

Although the editor crash as soon as I create a link (nodes are OK) with an error 500 { "message": "Server Error: Set APP_DEBUG=true to see details." }

fbouynot commented 2 years ago

So using su - librenms -c "APP_DEBUG=true /opt/librenms/html/plugins/Weathermap/map-poller.php" gives me the two attached files (one with nodes only, the other with one link added). It looks like the links issue is related to imagefilledpolygon() and imagepolygon(), although there is although issues with strftime() , imagefilledrectangle(), imagerectangle() and imagestring().

If https://librenms/plugins/Weathermap/editor.php is not working (see picture), https://librenms/plugins/Weathermap/xxx.html still works. 2022-05-17 15_00_27-PHP Weathermap Editor 0 98b librenms_weathermap_php81_nolinks.txt librenms_weathermap_php81_withlinks.txt

LoveSkylark commented 1 year ago

So using su - librenms -c "APP_DEBUG=true /opt/librenms/html/plugins/Weathermap/map-poller.php" gives me the two attached files (one with nodes only, the other with one link added). It looks like the links issue is related to imagefilledpolygon() and imagepolygon(), although there is although issues with strftime() , imagefilledrectangle(), imagerectangle() and imagestring().

haven't found the fix for this, changing the link labels from bits > percentages will allow the map to be drawn.

BarbarossaTM commented 1 year ago

This seems to have been adressed in #82, thanks :)