I have Zabbix running on a my CentOS install. I was able to configure it with remote MySQL/MariaDB but i'm getting this in the logs.
21673:20151228:215724.611 [Z3001] connection to database 'zabbix' failed: [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
21673:20151228:215724.611 database is down: reconnecting in 10 seconds
21673:20151228:215734.611 [Z3001] connection to database 'zabbix' failed: [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
21673:20151228:215734.611 database is down: reconnecting in 10 seconds
21673:20151228:215744.611 [Z3001] connection to database 'zabbix' failed: [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
21673:20151228:215744.611 database is down: reconnecting in 10 seconds
21673:20151228:215754.612 [Z3001] connection to database 'zabbix' failed: [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
21673:20151228:215754.612 database is down: reconnecting in 10 seconds
[user@asm-zabbix01 ~]$
sudo netstat -tunlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 4845/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1590/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1592/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2764/master
tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 16202/zabbix_agentd
tcp6 0 0 :::80 :::* LISTEN 1606/httpd
tcp6 0 0 :::22 :::* LISTEN 1590/sshd
tcp6 0 0 ::1:631 :::* LISTEN 1592/cupsd
tcp6 0 0 ::1:25 :::* LISTEN 2764/master
tcp6 0 0 :::10050 :::* LISTEN 16202/zabbix_agentd
udp 0 0 192.168.122.1:53 0.0.0.0:* 4845/dnsmasq
udp 0 0 0.0.0.0:67 0.0.0.0:* 4845/dnsmasq
udp 0 0 0.0.0.0:56536 0.0.0.0:* 861/avahi-daemon: r
udp 0 0 0.0.0.0:5353 0.0.0.0:* 861/avahi-daemon: r
sudo getsebool -a|egrep "httpd_can_connect_zabbix|zabbix_can_network|httpd _can_network_connect|httpd_can_network_connect_db| httpd_can_network_relay"
httpd_can_connect_zabbix --> on
httpd_can_network_connect --> on
httpd_can_network_connect_cobbler --> off
httpd_can_network_connect_db --> on
httpd_can_network_relay --> on
zabbix_can_network --> on
sudo firewall-cmd --zone=public --list-all
public (default, active)
interfaces: ens160
sources:
services: dhcpv6-client http https ssh
ports:
masquerade: no
forward-ports:
icmp-blocks:
rich rules:
[user@asm-zabbix01 ~]$ mysql -h 10.150.1.80 -u zabbix -D zabbix -p
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4186
Server version: 5.5.44-MariaDB-log MariaDB Server
Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [zabbix]> use zabbix
Database changed
MariaDB [zabbix]> show database
-> show
-> show tables;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'database
show
show tables' at line 1
MariaDB [zabbix]> show databases;
+------------------------+
| Database |
+------------------------+
| information_schema |
| clouddb |
| mysql |
| #mysql50#mysql-bin-log |
| nedi |
| netxms |
| otrs2 |
| performance_schema |
| pydiodb |
| rattic |
| rattic2 |
| test |
| zabbix |
+------------------------+
13 rows in set (0.00 sec)
MariaDB [zabbix]> \q
Bye
[user@asm-zabbix01 ~]$
21673:20151228:215724.611 [Z3001] connection to database 'zabbix' failed: [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
21673:20151228:215724.611 database is down: reconnecting in 10 seconds
21673:20151228:215734.611 [Z3001] connection to database 'zabbix' failed: [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
21673:20151228:215734.611 database is down: reconnecting in 10 seconds
21673:20151228:215744.611 [Z3001] connection to database 'zabbix' failed: [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
21673:20151228:215744.611 database is down: reconnecting in 10 seconds
21673:20151228:215754.612 [Z3001] connection to database 'zabbix' failed: [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
21673:20151228:215754.612 database is down: reconnecting in 10 seconds
[user@asm-zabbix01 ~]$
sudo netstat -tunlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 4845/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1590/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1592/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2764/master
tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 16202/zabbix_agentd
tcp6 0 0 :::80 :::* LISTEN 1606/httpd
tcp6 0 0 :::22 :::* LISTEN 1590/sshd
tcp6 0 0 ::1:631 :::* LISTEN 1592/cupsd
tcp6 0 0 ::1:25 :::* LISTEN 2764/master
tcp6 0 0 :::10050 :::* LISTEN 16202/zabbix_agentd
udp 0 0 192.168.122.1:53 0.0.0.0:* 4845/dnsmasq
udp 0 0 0.0.0.0:67 0.0.0.0:* 4845/dnsmasq
udp 0 0 0.0.0.0:56536 0.0.0.0:* 861/avahi-daemon: r
udp 0 0 0.0.0.0:5353 0.0.0.0:* 861/avahi-daemon: r
sudo getsebool -a|egrep "httpd_can_connect_zabbix|zabbix_can_network|httpd _can_network_connect|httpd_can_network_connect_db| httpd_can_network_relay"
httpd_can_connect_zabbix --> on
httpd_can_network_connect --> on
httpd_can_network_connect_cobbler --> off
httpd_can_network_connect_db --> on
httpd_can_network_relay --> on
zabbix_can_network --> on
sudo firewall-cmd --zone=public --list-all
public (default, active)
interfaces: ens160
sources:
services: dhcpv6-client http https ssh
ports:
masquerade: no
forward-ports:
icmp-blocks:
rich rules:
[user@asm-zabbix01 ~]$ mysql -h 10.150.1.80 -u zabbix -D zabbix -p
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4186
Server version: 5.5.44-MariaDB-log MariaDB Server
Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [zabbix]> use zabbix
Database changed
MariaDB [zabbix]> show database
-> show
-> show tables;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'database
show
show tables' at line 1
MariaDB [zabbix]> show databases;
+------------------------+
| Database |
+------------------------+
| information_schema |
| clouddb |
| mysql |
| #mysql50#mysql-bin-log |
| nedi |
| netxms |
| otrs2 |
| performance_schema |
| pydiodb |
| rattic |
| rattic2 |
| test |
| zabbix |
+------------------------+
13 rows in set (0.00 sec)
MariaDB [zabbix]> \q
Bye
[user@asm-zabbix01 ~]$
Comment