Weathermap writes empty files and corrupts png images

Hi everyone every time the map-poller.php runs on the Weathermap it writes an empty file over the already existing html file and I lose the graphs. What is the problem with this? I am on v97c. Any help please!!

I fixed this issue, it was a permission problem the conf files were not writable by the librenms user and it was always showing a (readonly) on the Weathermap page.

If you are seeing this in the future make sure to run
sudo chown librenms:librenms && sudo chmod 777 against these two directories and all the files inside them /opt/librenms/html/plugins/Weathermap/configs and /opt/librenms/html/plugins/Weathermap/output

After that, you should be able to create and edit the weathermap easily without breaking anything!!!

Cheers
Ahmad

Hi

I have tried the above but I still have a (read-only) next to mapname.conf.

Is there a way I can troubleshoot this?

Thanks

What happens to me is I ran the following command as per documentation:

Inside the html/plugins directory, change the ownership of the Weathermap directory by typing chown -R librenms:librenms Weathermap/ Make the configs directory writeable chmod 775 /opt/librenms/html/plugins/Weathermap/configs Note if you are using SELinux you need to input the following command chcon -R -t httpd_cache_t Weathermap/

After I create a maps and do a validate.php i get the following

[FAIL] We have found some files that are owned by a different user than librenms, this will stop you updating automatically and / or rrd files being updated causing graphs to fail.
[FIX]:
sudo chown -R librenms:librenms /opt/librenms
sudo setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
sudo chmod -R ug=rwX /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
Files:
/opt/librenms/html/plugins/Weathermap/configs/Modo-WAN.conf
/opt/librenms/html/plugins/Weathermap/configs/All-Modo-Internet.conf

After I run

    sudo chown -R librenms:librenms /opt/librenms
    sudo setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
    sudo chmod -R ug=rwX /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/

Then my weather map says read-only

image

Below is the current permissions
root@cf-mod-monitoring:/opt/librenms/html/plugins/Weathermap/configs# dir -al
total 24

drwxrwxr-x 2 librenms librenms 4096 May 14 14:54 .
drwxr-xr-x 9 librenms librenms 4096 May 14 14:55 …
-rw-r–r-- 1 librenms librenms 3870 May 14 17:06 All-Modo-Internet.conf
-rwxr-xr-x 1 librenms librenms 33 May 14 11:37 .htaccess
-rw-r–r-- 1 librenms librenms 51 May 14 11:37 index.php
-rw-r–r-- 1 librenms librenms 3486 May 14 14:47 Modo-WAN.conf

Then I cannot edit my maps

Help!

If I do the following
root@cf-mod-monitoring:/opt/librenms# chmod 777 /opt/librenms/html/plugins/Weathermap/configs/All-Modo-Internet.conf
root@cf-mod-monitoring:/opt/librenms# cd /opt/librenms/html/plugins/Weathermap/configs
root@cf-mod-monitoring:/opt/librenms/html/plugins/Weathermap/configs# dir -al
total 24
drwxrwxrwx 2 librenms librenms 4096 May 14 17:20 .
drwxr-xr-x 9 librenms librenms 4096 May 14 17:17 …
-rwxrwxrwx 1 librenms librenms 3870 May 14 17:06 All-Modo-Internet.conf
-rwxr-xr-x 1 librenms librenms 33 May 14 11:37 .htaccess
-rw-r–r-- 1 librenms librenms 51 May 14 11:37 index.php
-rw-r–r-- 1 librenms librenms 3486 May 14 14:47 Modo-WAN.conf
root@cf-mod-monitoring:/opt/librenms/html/plugins/Weathermap/configs# chmod 777 /opt/librenms/html/plugins/Weathermap/configs/Modo-WAN.conf
root@cf-mod-monitoring:/opt/librenms/html/plugins/Weathermap/configs# dir -al
total 24
drwxrwxrwx 2 librenms librenms 4096 May 14 17:20 .
drwxr-xr-x 9 librenms librenms 4096 May 14 17:17 …
-rwxrwxrwx 1 librenms librenms 3870 May 14 17:06 All-Modo-Internet.conf
-rwxr-xr-x 1 librenms librenms 33 May 14 11:37 .htaccess
-rw-r–r-- 1 librenms librenms 51 May 14 11:37 index.php
-rwxrwxrwx 1 librenms librenms 3486 May 14 14:47 Modo-WAN.conf
root@cf-mod-monitoring:/opt/librenms/html/plugins/Weathermap/configs#

Then it works

Is there no way to automate this, becuase everytime im going to create a new map and run validate.php the process above is going need to be repeated