zabbix server和zabbix agent的安装
Posted konglingxi
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了zabbix server和zabbix agent的安装相关的知识,希望对你有一定的参考价值。
阿里云要开放10050和10051端口
(一).zabbix server
1.安装zabbix包
1.设置主机名 hostnamectl set-hostname zabbix_server systemctl stop firewalld.service #关闭防火墙 systemctl disable firewalld.service setenforce 0 #关闭selinux 2.准备zabbix-repo,http://repo.zabbix.com/zabbix/ rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm yum makecache 3.安装zabbix服务器 yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-get zabbix-agent
2.初始化zabbix数据库
1.安装mysql 2.创建数据库 mysql -uroot -p create database zabbix character set utf8 collate utf8_bin grant all privileges zabbix.* to root@localhost identified by ‘root‘; flush privileges; 3.初始化zabbix数据库 cd /usr/share/doc/zabbix-server-mysql-3.2.11/ zcat create.sql.gz|mysql -uroot zabbix
3.启动zabbix server
1.配置mysql账号密码 vim /etc/zabbix/zabbix_server.conf DBHost=localhost DBName=zabbix DBUser=root DBPassword=root 2.启动zabbix systemctl enable zabbix-server.service systemctl start zabbix-server.service
4.编辑zabbix前端的php配置
1.vim /etc/httpd/conf.d/zabbix.conf php_value date.timezone Asia/Shanghai 2.systemctl start httpd systemctl enable httpd
5.访问zabbix web ui
1.http://zabbix-server-ip/zabbix 2.登录zabbix,用户Admin,密码默认zabbix
6.zabbix界面乱码
1.windows主机Win+R,输入fonts。找到微软雅黑-常规字体,复制并改名msyh.ttf 2.将msyh.ttf上传到服务器zabbix字体目录/usr/share/zabbix/fonts/ 3.查看字段配置grep FONT_NAME /usr/share/zabbix/include/defines.inc.php -n 4.执行快捷替换sed -i "s/graphfont/msyh/g" /usr/share/zabbix/include/defines.inc.php 5.确认是否替换成功grep FONT_NAME /usr/share/zabbix/include/defines.inc.php -n
(二).zabbix agent
1.设置主机名
hostnamectl set-hostname zabbix_web systemctl stop firewalld.service #关闭防火墙 systemctl disable firewalld.service setenforce 0 #关闭selinux
2.准备zabbix-repo,http://repo.zabbix.com/zabbix/
rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm yum makecache vim /etc/yum.repos.d/zabbix.repo设置gpgcheck=0
3.安装zabbix-agent
yum -y install zabbix-agent
4.配置主服务器地址
vim /etc/zabbix/zabbix_agentd.conf Server=129.211.79.128 ServerActive=129.211.79.128 Hostname=zabbix_web
5.启动zabbix-agent
systemctl start zabbix-agent systemctl enable zabbix-agent netstat -tplnu或者ss -anlp|grep :10050
(三)检验
zabbix_get -s 114.67.170.11 -k system.uname zabbix_get -s 114.67.170.11 -k net.tcp.service[http]
ps: 114.67.170.11是被控主机ip,129.211.79.128是服务主机
以上是关于zabbix server和zabbix agent的安装的主要内容,如果未能解决你的问题,请参考以下文章