CentOS7搭建zabbix监控平台(服务端与客户端)
先要搭建 LAMP 平台: linux搭建简单的LAMP服务架构
再搭建 zabbix 服务端
修改时区
yum -y install zabbix-server
vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai
systemctl reload httpd
创建数据库、用户访问授权
mysql -uroot
MariaDB [(none)]> create database zabbix character set ut f8 collate utf8_bin; MariaDB [(none)]> grant all on *.* to zabbix@localhost identified by 'pwd@123'; 创建新用户
使用zabbix登录mysql,查看zabbix库当中的表
mysql -uzabbix -ppwd@123
MariaDB [(none)]> use zabbix ; MariaDB [zabbix]> show tables; MariaDB [zabbix]> quit
zcat /usr/share/doc/zabbix-server-mysql-3.4.14/create.sql.gz | mysql -uzabbix -ppwd@123 zabbix
修改zabbix配置连接数据库
vim /etc/zabbix/zabbix_server.conf
DBName=zabbix 101行 DBUser=zabbix 117行 DBPassword=pwd@123 125行
systemctl restart zabbix-server zabbix-agent
systemctl enable zabbix-server zabbix-agent
systemctl reload httpd
替换字体,解决乱码
cp /usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc /usr/share/zabbix/fonts/graphfont.ttf
---------------------------------------------------------------------------------------------
zabbix 客户端
在其他客户端主机上安装 zabbix-agent: yum -y install zabbix-agent
修改配置文件:vim /etc/zabbix/zabbix_agentd.conf
Server=192.168.1.7 97行 填写服务端的地址 ServerActive=192.168.1.7 138行 填写服务端地址 Hostname=svr8.tedu.cn 148行 填写本机(客户端)的主机名
重启服务:systemctl restart zabbix-agent
浙公网安备 33010602011771号