Open olie93 opened 4 years ago
Make sure your LibreNMS conf location is correct in weathermapper.conf.php.
It uses the same DB connection mechanism as LibreNMS.
My config is the default as my libreNMS installation is in /opt/librenms
Are you running the weathermapper on the same machine as the LibreNMS installation? The LibreNMS installation works correctly and does not have this error?
Usually this issue is caused by a mismatch in where mysql is listening vs where you are trying to connect. E.g., mysql is listening on 127.0.0.1 but you have configured the connection for the server IP.
Please provide more information about the mysql listener, where librenms is in running and from where it is connecting, and also where weathermapper is running and from where it is connecting.
LibreNMS and Weathermapper are running on the same machine
LibreNMS is working without any problems
MySQL is listening on 127.0.0.1 and also the IP of the server
this seems to have become an issue due to LibreNMS removing the values for db_host, db_user, db_name and db_pass from LibreNMS' main config.php, which WeatherMapper relies on for it's db credentials.
@m3hrz4d thanks for pointing that out, I'll test this and put in a patch.
Hi @pblasquez. Thank you for your time and trouble with this plugin. Have you perhaps had time to look into this issue. I have tried changing the location of the details to .env but then I get
php weathermapper.php
APP_KEY=SCRUBBED
DB_HOST=localhost
DB_DATABASE=librenms
DB_USERNAME=librenms
DB_PASSWORD=password
#APP_URL=
NODE_ID=SCRUBBED
LIBRENMS_USER=librenms
PHP Notice: Undefined variable: config in /opt/weathermapper/weathermapper.php on line 21
PHP Notice: Trying to access array offset on value of type null in /opt/weathermapper/weathermapper.php on line 21
PHP Notice: Undefined variable: config in /opt/weathermapper/weathermapper.php on line 22
PHP Notice: Trying to access array offset on value of type null in /opt/weathermapper/weathermapper.php on line 22
PHP Notice: Undefined variable: config in /opt/weathermapper/weathermapper.php on line 23
PHP Notice: Trying to access array offset on value of type null in /opt/weathermapper/weathermapper.php on line 23
PHP Notice: Undefined variable: config in /opt/weathermapper/weathermapper.php on line 24
PHP Notice: Trying to access array offset on value of type null in /opt/weathermapper/weathermapper.php on line 24
SQLSTATE[HY000] [1045] Access denied for user ' '@'localhost' (using password: NO)
I would really appreciate any help on this?
I'll test this and put in a patch.
@pblasquez
Did you ever add a patch for this (librenms moved its SQL parameters into a .env
file instead of in config.php)?
What's the best way to work-around in the meantime? I have access to the .env file in /opt/librenms, so I know the name of the DB and user/pass... can those just be hardcoded in weathermapper.conf.php somehow? (I am not very experienced with PHP so I'm not sure how to set those variables to override whatever it is trying to pull from the librenms config.php...)
Having the same issue with
PHP Notice: Undefined variable: config in /opt/weathermapper/weathermapper.php on line 21
PHP Notice: Trying to access array offset on value of type null in /opt/weathermapper/weathermapper.php on line 21
PHP Notice: Undefined variable: config in /opt/weathermapper/weathermapper.php on line 22
PHP Notice: Trying to access array offset on value of type null in /opt/weathermapper/weathermapper.php on line 22
PHP Notice: Undefined variable: config in /opt/weathermapper/weathermapper.php on line 23
PHP Notice: Trying to access array offset on value of type null in /opt/weathermapper/weathermapper.php on line 23
PHP Notice: Undefined variable: config in /opt/weathermapper/weathermapper.php on line 24
PHP Notice: Trying to access array offset on value of type null in /opt/weathermapper/weathermapper.php on line 24
I'm going to see if I can figure out how to manually change the .php file to get that going. Looks like owner might be inactive now on github.
Hi,
When i run php weathermapper.php to generate my map i get the following error:
SQLSTATE[HY000] [2002] Connection refused
What would be the cause of this?