安装部署
[root@zabbix ~]
[root@zabbix ~]
[root@zabbix ~]
[root@zabbix ~]
[root@zabbix ~]
[root@zabbix ~]
[root@zabbix ~]
[root@zabbix ~]
[root@zabbix ~]
[root@zabbix ~]
[root@zabbix /service/mysql/support-files]
cp: overwrite ‘/etc/my.cnf’? y
[root@zabbix /service/mysql/support-files]
[root@zabbix /service/mysql/support-files]
[root@zabbix /service/mysql/scripts]
[root@zabbix ~]
[Unit]
Description=MySQL Server
Documentation=man:mysqld(8)
Documentation=https://dev.mysql.com/doc/refman/en/using-systemd.html
After=network.target
After=syslog.target
[Install]
WantedBy=multi-user.target
[Service]
User=mysql
Group=mysql
ExecStart=/service/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf
LimitNOFILE = 5000
[root@zabbix ~]
[root@zabbix ~]
basedir=/service/mysql
datadir=/service/mysql/data
[root@zabbix ~]
[root@zabbix ~]
export PATH=/service/mysql/bin:$PATH
[root@zabbix ~]
[root@zabbix ~]
mysql> create database zabbix character set utf8 collate utf8_bin;
[root@zabbix ~]
mysql> show databases;
mysql> use zabbix;
mysql> show tables;
mysql> grant all on zabbix.* to zabbix@'localhost' identified by 'zabbix';
[root@zzc ~]
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
[root@zabbix ~]
php_value date.timezone Asia/Shanghai
[root@zabbix ~]
启动zabbix-server,使用netstat -lntp没有zabbix-server:10051端口,
systemctl status zabbix-server状态正常,
tail -f /var/log/zabbix/zabbix_server.log查看日志报错
9665:20210424:104103.455 database is down: reconnecting in 10 seconds
9665:20210424:104113.457 [Z3001] connection to database 'zabbix' failed: [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
find查找mysql.sock文件位置,做软链接
[root@zabbix ~]
在windows系统中,找到字体存放目录C:\Windows\Fonts,找一个自己喜欢的字体,我选择的是楷体
[root@zabbix ~]
[root@zabbix /usr/share/zabbix]
[root@zabbix /usr/share/zabbix]
[root@zabbix /usr/share/zabbix/fonts]
SIMKAI.TTF
[root@zabbix /usr/share/zabbix/fonts]
[root@zabbix /etc/alternatives]
lrwxrwxrwx 1 root root 38 Apr 24 09:52 zabbix-web-font -> /usr/share/fonts/dejavu/DejaVuSans.ttf
[root@zabbix /etc/alternatives]
[root@zabbix /etc/alternatives]
[root@zabbix /etc/alternatives]
使用zabbix监控一台主机
主机 | IP | 服务 |
---|
zabbix | 10.0.0.71 | zabbix-server |
db01 | 10.0.0.51 | zabbix-agent |
[root@db01 ~]
[root@db01 ~]
[root@db01 ~]
[root@db01 ~]
Server=127.0.0.1,10.0.0.71
ServerActive=127.0.0.1,10.0.0.71
[root@db01 ~]
[root@db01 ~]
tcp6 0 0 :::10050 :::* LISTEN 8027/zabbix_agentd