Hm
That issue may only occurr if it is not able to connect to the database or is using a different database.
Where is your config.php file located and does it contain the correct database information? Maybe there's another config file lying around somewhere. Can you check ?
It should use these global variables:
Code: Select all
global $database_type, $database_default, $database_hostname, $database_username, $database_password;
You can check if that weathermap is actually using the correct entries by adding the following to the lib/database.php file:
Code: Select all
file_put_contents('/tmp/weathermap_database.txt', "$database_type, $database_default, $database_hostname, $database_username, $database_password");
so the function in the lib/database.php file looks like this:
Code: Select all
function weathermap_get_pdo()
{
// This is the Cacti standard settings
global $database_type, $database_default, $database_hostname, $database_username, $database_password;
global $config;
$cacti_version = $config["cacti_version"];
$host = $database_hostname;
$dbname = $database_default;
$user = $database_username;
$pass = $database_password;
file_put_contents('/tmp/weathermap_database.txt', "$database_type, $database_default, $database_hostname, $database_username, $database_password");
$pdo = null;
try {
# MySQL with PDO_MYSQL
$pdo = new \PDO("mysql:host=$host;dbname=$dbname", $user, $pass);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
echo $e->getMessage();
}
return $pdo;
Then check the /tmp/weathermap_database.txt file