Weathermaps on LibreNMS - Not found files / html, png files

Ubuntu 22.04

installed php-pear

/opt/librenms/html/plugins/Weathermap/output# pear version
PEAR Version: 1.10.12
PHP Version: 8.1.2-1ubuntu2.6
Zend Engine Version: 4.1.2
Running on: Linux ip-172-31-33-115 5.15.0-1022-aws #26-Ubuntu SMP Thu Oct 13 12:59:25 UTC 2022 x86_64

Changed librenms/ folder permissions

drwxrwx–x 29 librenms librenms 4096 Oct 27 10:17 librenms/


/opt/librenms/html/plugins/Weathermap/configs# ll
total 20
drwxrwxr-x 2 librenms librenms 4096 Oct 27 11:48 ./
drwxrwxr-x 12 librenms librenms 4096 Oct 26 17:38 …/
-rw-rw-r-- 1 librenms librenms 51 Oct 26 17:38 index.php
-rw-r–r-- 1 librenms librenms 1084 Oct 27 11:10 test.conf
-rw-r–r-- 1 librenms librenms 396 Oct 27 11:48 test2.conf


Map Properties
Map Title : Test2 Map
Output Image Filename : output/test2.png
Output HTML Filename : output/test2.html

submit

/opt/librenms/html/plugins/Weathermap/output# ll
total 12
drwxrwxr-x 2 librenms librenms 4096 Oct 27 10:26 ./
drwxrwxr-x 12 librenms librenms 4096 Oct 26 17:38 …/
-rw-rw-r-- 1 librenms librenms 51 Oct 26 17:38 index.php

not found files

Web : Overview > Plugins > Weathermap > Test2 Map
404 | NOT FOUND

What happens when you manually run your cron entry? You might find you need to add ‘php’ in front of it, see: WeatherMap editor and php 8.1 : incompatibility? - #15 by Philip_Jewell

Related is also referenced here: Shebang missing in map-poller.php · Issue #86 · librenms-plugins/Weathermap · GitHub

librenms$ ./validate.php

Component Version
LibreNMS 22.10.0-40-gb90fbcb9b (2022-10-28T04:02:27+09:00)
DB Schema 2022_09_03_091314_update_ports_adsl_table_with_defaults (248)
PHP 8.1.2-1ubuntu2.6
Python 3.10.6
Database MariaDB 10.6.7-MariaDB-2ubuntu1.1
RRDTool 1.7.2
SNMP 5.9.1

===========================================

[OK] Composer Version: 2.4.3
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK]
[OK] Database schema correct
[OK] MySQl and PHP time match
[OK] Active pollers found
[OK] Dispatcher Service not detected
[OK] Locks are functional
[OK] Python poller wrapper is polling
[OK] Redis is unavailable
[OK] rrd_dir is writable
[OK] rrdtool version ok
librenms$


$ cat /etc/cron.d/librenms

Using this cron file requires an additional user on your system, please see install docs.

33 */6 * * * librenms /opt/librenms/cronic /opt/librenms/discovery-wrapper.py 1
*/5 * * * * librenms /opt/librenms/discovery.php -h new >> /dev/null 2>&1
*/5 * * * * librenms /opt/librenms/cronic /opt/librenms/poller-wrapper.py 16

          • librenms /opt/librenms/alerts.php >> /dev/null 2>&1
            */5 * * * * librenms /opt/librenms/poll-billing.php >> /dev/null 2>&1
            01 * * * * librenms /opt/librenms/billing-calculate.php >> /dev/null 2>&1
            */5 * * * * librenms /opt/librenms/check-services.php >> /dev/null 2>&1
          • librenms cd /opt/librenms/ && php artisan schedule:run >> /dev/null 2>&1
            */5 * * * * librenms /opt/librenms/html/plugins/Weathermap/map-poller.php >> /dev/null 2>&1

Daily maintenance script. DO NOT DISABLE!

If you want to modify updates:

Switch to monthly stable release: Choosing a release - LibreNMS Docs

Disable updates: Updating - LibreNMS Docs

19 0 * * * librenms /opt/librenms/daily.sh >> /dev/null 2>&1

$ ./daily.sh
Updating to latest codebase OK
Updating Composer packages OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK
Caching Mac OUI data OK

/opt/librenms/html/plugins/Weathermap/output# ll
total 12
drwxrwxr-x 2 librenms librenms 4096 Oct 28 10:05 ./
drwxrwxr-x 12 librenms librenms 4096 Oct 28 10:08 …/
-rw-rw-r-- 1 librenms librenms 51 Oct 26 17:38 index.php


there is no files

What if you run

su - librenms
/opt/librenms/html/plugins/Weathermap/map-poller.php

$ /opt/librenms/html/plugins/Weathermap/map-poller.php
/opt/librenms/html/plugins/Weathermap/map-poller.php: line 1: ?php: No such file or directory
/opt/librenms/html/plugins/Weathermap/map-poller.php: line 3: syntax error near unexpected token (' /opt/librenms/html/plugins/Weathermap/map-poller.php: line 3: // Copyright (C) 2013 Neil Lathwood [email protected]

apt install php-pear

Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
php-pear is already the newest version (1:1.10.12+submodules+notgz+20210212-1ubuntu3).
0 upgraded, 0 newly installed, 0 to remove and 25 not upgraded.

My guess is php-fpm is running as the web user (not librenms) this means it doesn’t have permission to write to that directory according to your original post.

Either amend the permissions, or set the the librenms php-fpm pool as described in the current documentation.

It was set according to the Librenms manual.

added
chown -R librenms:librenms /etc/php/8.1/fpm
chmod 775 /etc/php/8.1/fpm

drwxrwxr-x 4 librenms librenms 4096 Nov 2 14:25 fpm/

Still the same 404 not found

/etc/php/8.1/fpm/pool.d# ll
-rw-r–r-- 1 librenms librenms 20883 Nov 2 14:32 librenms.conf
-rw-r–r-- 1 librenms librenms 20876 Sep 15 20:30 www.conf

vi librenms.conf
; Start a new pool named ‘www’.
; the variable $pool can be used in any directive and will be replaced by the
; pool name (‘www’ here)
[librenms]

user = librenms
group = librenms

listen = /run/php-fpm-librenms.sock

librenms should NOT own the php-fpm files.

Note that the Weathermap plugin has problems and might require manual intervention. It seems mostly unmaintained.

Check here: