LibreNMS changing DB issue


I have been using the libreNMS ubuntu VM and had recently modified it to use an external DB.

I’ve modified my config.php only to use the external db. Everything seemed to be working fine, except when I noticed that certain values on the web gui were not being updated (such as new devices were not listed, CPU values in the device summary never seemed to be updated, etc). Entries in the log tables seemed to also be updating normally, but not displayed on the GUI. It seems like for certain items, the local instance of mariadb is still used. When turning off the local mysql, the GUI does not display at all; complains that it cannot connect to the db (error_log point to an error where it’s trying to connect tot he localhost instance of mariadb).

I’ve run and .validate, and both produce no errors. The librenms.log file also show no errors in terms of db access, so not sure why the old DB is still being referenced when it’s been changed in the config.php file.

Where else can I look to determine what could be the cause of my issue? I’ve searched all files to try determine where it could be referring to the old DB credentials, but cannot find any reference at all.



Component Version
LibreNMS 1.42.01-27-g45d35ef
DB Schema 258
PHP 7.0.30-0ubuntu0.16.04.1
MySQL 5.5.56-MariaDB
RRDTool 1.5.5


[OK] Composer Version: 1.7.1
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
[FAIL] Some devices have not completed their polling run in 5 minutes, this will create gaps in data.
[FIX] Check your poll log and see:

error_log when I disable the local mariadb instance:

2018/08/13 11:51:51 [error] 1208#1208: *27294 FastCGI sent in stderr: “PHP message: [2018-08-13 11:51:51] production.ERROR: LibreNMS\Exceptions\DatabaseConnectException: Connection refused in /opt/librenms/includes/dbFacile.php:86
Stack trace:
#0 /opt/librenms/app/Providers/AppServiceProvider.php(33): dbConnect(‘’, ‘librenms’, ‘xxxxxx’, ‘librenms2’, NULL, NULL)
#1 [internal function]: App\Providers\AppServiceProvider->boot()
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array)
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container{closure}()
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(539): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Applicatio” while reading response header from upstream, client: xxxx, server:, request: “HEAD / HTTP/1.0”, upstream: “fastcgi://unix:/var/run/php/php7.0-fpm.sock:”

error message on the GUI when local database instance is disabled:

Error connecting to database.

Connection refused



You should edit .env too with new host/credentials

Thank You!

That worked Perfectly.