FATAL: Connection to Cacti database failed.

Проблемы с установкой, настройкой и работой системных и сетевых программ.

Модераторы: GRooVE, alexco

Правила форума
Убедительная просьба юзать теги [code] при оформлении листингов.
Сообщения не оформленные должным образом имеют все шансы быть незамеченными.
Аватара пользователя
tom.cat
старшина
Сообщения: 446
Зарегистрирован: 2007-11-24 20:23:49
Откуда: Мытищи
Контактная информация:

FATAL: Connection to Cacti database failed.

Непрочитанное сообщение tom.cat » 2019-01-30 14:46:07

Одолела проблема с кактусом :st:
БД для кактуса сделал, юзера с паролем и правами тоже, но вижу такое сообще в браузере
FATAL: Connection to Cacti database failed. Please ensure:

the PHP MySQL module is installed and enabled.
the database is running.
the credentials in config.php are valid.
Что имеем:

Код: Выделить всё

# php --ini
Configuration File (php.ini) Path: /usr/local/etc
Loaded Configuration File:         /usr/local/etc/php.ini
Scan for additional .ini files in: /usr/local/etc/php
Additional .ini files parsed:      /usr/local/etc/php/ext-18-session.ini,
/usr/local/etc/php/ext-20-bz2.ini,
/usr/local/etc/php/ext-20-ctype.ini,
/usr/local/etc/php/ext-20-filter.ini,
/usr/local/etc/php/ext-20-gd.ini,
/usr/local/etc/php/ext-20-gettext.ini,
/usr/local/etc/php/ext-20-gmp.ini,
/usr/local/etc/php/ext-20-hash.ini,
/usr/local/etc/php/ext-20-json.ini,
/usr/local/etc/php/ext-20-ldap.ini,
/usr/local/etc/php/ext-20-mbstring.ini,
/usr/local/etc/php/ext-20-mysqli.ini,
/usr/local/etc/php/ext-20-openssl.ini,
/usr/local/etc/php/ext-20-pdo.ini,
/usr/local/etc/php/ext-20-posix.ini,
/usr/local/etc/php/ext-20-simplexml.ini,
/usr/local/etc/php/ext-20-snmp.ini,
/usr/local/etc/php/ext-20-sockets.ini,
/usr/local/etc/php/ext-20-xml.ini,
/usr/local/etc/php/ext-20-zip.ini,
/usr/local/etc/php/ext-20-zlib.ini,
/usr/local/etc/php/ext-30-pdo_mysql.ini
Версия php

Код: Выделить всё

# php -v
PHP 7.2.14 (cli) (built: Jan 30 2019 12:19:04) ( ZTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
Модули:

Код: Выделить всё

# php -m
[PHP Modules]
bz2
Core
ctype
date
filter
gd
gettext
gmp
hash
json
ldap
libxml
mbstring
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
posix
Reflection
session
SimpleXML
snmp
sockets
SPL
standard
xml
zip
zlib

[Zend Modules]
Конфиг кактуса

Код: Выделить всё

$database_type     = 'mysql';
$database_default  = 'cacti';
$database_hostname = 'localhost';
$database_username = 'cacti';
$database_password = 'cacti';
$database_port     = '/tmp/mysql.sock';
$database_ssl      = false;
$database_ssl_key  = '';
$database_ssl_cert = '';
$database_ssl_ca   = '';
Сокет mysql прописан в php.ini

Код: Выделить всё

 # cat php.ini | grep mysql.default_socket
pdo_mysql.default_socket=
mysql.default_socket = /tmp/mysql.sock
Из командной строки та же жопа:

Код: Выделить всё

# php /usr/local/share/cacti/poller.php
FATAL: Connection to Cacti database failed. Please ensure:

  - the PHP MySQL module is installed and enabled.
  - the database is running.
  - the credentials in config.php are valid.
Mysql

Код: Выделить всё

# sockstat | grep mysql
mysql    mysqld     65019 67 stream /tmp/mysql.sock
mysql    mysqld     65019 69 stream /tmp/mysqlx.sock
mysql    mysqld     65019 70 stream /tmp/mysql.sock
www      httpd      63700 9  stream -> /tmp/mysql.sock
Доступ в БД:

Код: Выделить всё

# mysql -u cacti -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 73
Server version: 8.0.14 Source distribution

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

cacti@localhost [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| cacti              |
| information_schema |
| mysql              |
+--------------------+
3 rows in set (0.00 sec)

cacti@localhost [(none)]> use cacti;
Database changed
cacti@localhost [cacti]> show tables;
+---------------------------------+
| Tables_in_cacti                 |
+---------------------------------+
| aggregate_graph_templates       |
| aggregate_graph_templates_graph |
| aggregate_graph_templates_item  |
| aggregate_graphs                |
| aggregate_graphs_graph_item     |
| aggregate_graphs_items          |
| automation_devices              |
| automation_graph_rule_items     |
| automation_graph_rules          |
| automation_ips                  |
| automation_match_rule_items     |
| automation_networks             |
| automation_processes            |
| automation_snmp                 |
| automation_snmp_items           |
| automation_templates            |
| automation_tree_rule_items      |
| automation_tree_rules           |
| cdef                            |
| cdef_items                      |
+---------------------------------+
20 rows in set (0.00 sec)

When you see pigs fly it means Windows has become open source

Хостинговая компания Host-Food.ru
Хостинг HostFood.ru
 

Услуги хостинговой компании Host-Food.ru

Хостинг HostFood.ru

Тарифы на хостинг в России, от 12 рублей: https://www.host-food.ru/tariffs/hosting/
Тарифы на виртуальные сервера (VPS/VDS/KVM) в РФ, от 189 руб.: https://www.host-food.ru/tariffs/virtualny-server-vps/
Выделенные сервера, Россия, Москва, от 2000 рублей (HP Proliant G5, Intel Xeon E5430 (2.66GHz, Quad-Core, 12Mb), 8Gb RAM, 2x300Gb SAS HDD, P400i, 512Mb, BBU):
https://www.host-food.ru/tariffs/vydelennyi-server-ds/
Недорогие домены в популярных зонах: https://www.host-food.ru/domains/

Аватара пользователя
tom.cat
старшина
Сообщения: 446
Зарегистрирован: 2007-11-24 20:23:49
Откуда: Мытищи
Контактная информация:

FATAL: Connection to Cacti database failed.

Непрочитанное сообщение tom.cat » 2019-02-11 13:24:45

В общем забил на запуск мониторинга на Mysql 8 версии. Откатил обратно на 5 версию и все заработало :)
When you see pigs fly it means Windows has become open source