Zabbix 监控系统搭建4

2022-02-09 19:45:21 浏览数 (1)

导入初始schema与数据

初始化数据在 /usr/share/doc/zabbix-server-mysql-2.4.7/create/

代码语言:javascript复制
[root@zabbix-server zabbix]# ll /usr/share/doc/zabbix-server-mysql-2.4.7/create/
total 2988
-rw-r--r--. 1 root root  972942 Nov 13 18:31 data.sql
-rw-r--r--. 1 root root 1978341 Nov 12 18:12 images.sql
-rw-r--r--. 1 root root  104816 Nov 12 18:39 schema.sql
[root@zabbix-server zabbix]# cd /usr/share/doc/zabbix-server-mysql-2.4.7/create/
[root@zabbix-server create]# ll
total 2988
-rw-r--r--. 1 root root  972942 Nov 13 18:31 data.sql
-rw-r--r--. 1 root root 1978341 Nov 12 18:12 images.sql
-rw-r--r--. 1 root root  104816 Nov 12 18:39 schema.sql
[root@zabbix-server create]# mysql -u root -p zabbix < schema.sql 
Enter password: 
[root@zabbix-server create]# mysql -u root -p zabbix < images.sql 
Enter password: 
[root@zabbix-server create]# mysql -u root -p zabbix < data.sql 
Enter password: 
[root@zabbix-server create]#

配置zabbix server

确保如下参数已经正确配置

代码语言:javascript复制
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix

操作过程

代码语言:javascript复制
[root@zabbix-server create]# grep -v "^#" /etc/zabbix/zabbix_server.conf | cat -s 

LogFile=/var/log/zabbix/zabbix_server.log

LogFileSize=0

PidFile=/var/run/zabbix/zabbix_server.pid

DBName=zabbix

DBUser=zabbix

DBSocket=/var/lib/mysql/mysql.sock

SNMPTrapperFile=/var/log/snmptt/snmptt.log

AlertScriptsPath=/usr/lib/zabbix/alertscripts

ExternalScripts=/usr/lib/zabbix/externalscripts

[root@zabbix-server create]# vim /etc/zabbix/zabbix_server.conf
[root@zabbix-server create]# grep -v "^#" /etc/zabbix/zabbix_server.conf | cat -s 

LogFile=/var/log/zabbix/zabbix_server.log

LogFileSize=0

PidFile=/var/run/zabbix/zabbix_server.pid

DBHost=localhost

DBName=zabbix

DBUser=zabbix

DBPassword=zabbix

DBSocket=/var/lib/mysql/mysql.sock

SNMPTrapperFile=/var/log/snmptt/snmptt.log

AlertScriptsPath=/usr/lib/zabbix/alertscripts

ExternalScripts=/usr/lib/zabbix/externalscripts

[root@zabbix-server create]# diff /tmp/old  /tmp/new 
7a8,9
> DBHost=localhost
> 
11a14,15
> DBPassword=zabbix
> 
[root@zabbix-server create]# 

0 人点赞