Problem with Weathermap temperature map, when manually running it generates the message "PHP Deprecated: The each() function is deprecated."

Message

librenms@srv-nms-01:/opt/librenms$ su -l librenms -c /opt/librenms/html/plugins/Weathermap/map-poller.php
Senha:
PHP Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /opt/librenms/html/plugins/Weathermap/lib/Weathermap.class.php on line 778
libpng warning: iCCP: known incorrect sRGB profile
PHP Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /opt/librenms/html/plugins/Weathermap/lib/Weathermap.class.php on line 778
PHP Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /opt/librenms/html/plugins/Weathermap/lib/Weathermap.class.php on line 778
libpng warning: iCCP: known incorrect sRGB profile

If anyone can help I appreciate it.

i think you need to install php pear

1 Like

php-pear is already installed any more suggestions?

@darlan_simoes
Weathermap plugin is old, and must be ugpraded to stop using deprecated PHP functions.
LibreNMS is contributors based, so anybody can jump in and provide a patch :slight_smile:

1 Like

Not sure how the librenms plugin works, but Weathermap 0.98a doesn’t have each() on line 778. Weathermap is indeed old, but I think the librenms plugin is not the latest version :slight_smile: I went through cleaning up a lot of deprecated functions for 0.98a.

(just looked - librenms uses 0.97c. These are the changes since then:

0.98a
    FIXED - Works with PHP 7.x and 5.6 - removed all mysql_*() function calls, and use PDO instead
    FIXED - Blank line issue with RRDtool 1.5+

0.98
    FIXED - MySQL error in table-creation. MySQL 5.6 is fussier.
    FIXED - Editor 'delete link' broken
    FIXED - KILO was ignored when processing %k in special tokens
    FIXED - Various fixes for PHP deprecated or strict-mode warnings
    FIXED - Line-ending trimming in 'external script' data source
    FIXED - rounding error 'kinks' in angled VIA links
    FIXED - Config file path validation issue in editor (CVE-2013-3739)
    FIXED - Cloning a templated node in editor retains the template in the clone
    FIXED - cacti_use_ifspeed incorrect when interfaces > 20M and ifhighspeed available
    FIXED - More PHP 5.3/5.4/strict related errors (split -> explode)
    CHANGE - Finally switch to "new-style" plugin API.
    CHANGE - Editor data picker improved sort (thanks shd)
    CHANGE - (Cacti plugin only) images are written to a temporary file first, to avoid displaying half-written images
    CHANGE - Editor no longer uses editor-config.php
    ADDED - Weathermap will use anti-aliasing if your GD supports it (php-bundled GD doesn't) (thanks shd)
    ADDED - Special token formatting can handle timeticks and time_t formatting (%T and %t respectively)
    ADDED - new DATAOUTPUTFILE allows collected data to be written to a file for later use (automatically enabled in Cacti)
    ADDED - new wmdata: datasource plugin can read data from files produced by DATAOUTPUTFILE
    ADDED - IMAGEOUTPUTFILE and HTMLOUTPUTFILE are honoured in Cacti poller as a location for a second copy of those files.
    ADDED - Editor 'tidy link' function replaces Vert & Horiz, and does much nicer job
    ADDED - 'retidy' option in editor to recalculate all links previously positioned with 'tidy'.
    ADDED - KEYBGCOLOR and KEYOUTLINECOLOR both accept 'none'
    ADDED - command-line weathermap has new --no-warn option to disable warnings
    ADDED - AICONFILLCOLOR accepts 'none' for drawing giant transparent shapes.
    ADDED - Extra warning for Boost users about poller_output
    ADDED - if there are actually 0 maps in the database, the 'Weathermaps' tab gives some basic instructions.
    ADDED - Cacti data picker in editor tracks most recently used hosts (thanks Zdolny)
    ADDED - New permission in Cacti: edit maps. Maps can be edited by authorized users without needing to enable the editor in the source code.

Thanx @howardjones

@darlan_simoes : it is confirmed that Weathermap plugin should be upgraded, or and even (may be) integrated into LibreNMS as a feature.
One way or the other, we are community based, so if you feel comfortable starting this, the community will be happy to receive your contribution.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.