hank_gao

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
统计
 

tags:zabbix

环境准备

操作系统版本

cat /etc/redhat-release 
CentOS Linux release 7.4.1708 (Core)

关闭防火墙和selinux

systemctl stop firewalld.service
systemctl disable firewalld.service
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
grep SELINUX=disabled /etc/selinux/config
setenforce 0

安装mariadb

yum install mariadb-server mariadb -y
systemctl start mariadb  #启动MariaDB
systemctl stop mariadb  #停止MariaDB
systemctl restart mariadb  #重启MariaDB
systemctl enable mariadb  #设置开机启动

zabbix安装

rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm
yum install zabbix-server-mysql zabbix-web-mysql -y

初始化数据库

mysql_secure_installation 

创建数据库

create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';

导入数据

zcat /usr/share/doc/zabbix-server-mysql-3.4.1/create.sql.gz | mysql -uzabbix -p zabbix

配置数据库用户及密码

grep -n '^'[a-Z] /etc/zabbix/zabbix_server.conf
38:LogFile=/var/log/zabbix/zabbix_server.log
49:LogFileSize=0
72:PidFile=/var/run/zabbix/zabbix_server.pid
99:DBName=zabbix
115:DBUser=zabbix
123:DBPassword=zabbix
314:SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
432:Timeout=4
474:AlertScriptsPath=/usr/lib/zabbix/alertscripts
484:ExternalScripts=/usr/lib/zabbix/externalscripts
520:LogSlowQueries=3000

启动zabbix server并设置开机启动

systemctl enable zabbix-server
systemctl start zabbix-server

编辑Zabbix前端PHP配置,更改时区

vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai

启动httpd并设置开机启动

systemctl start httpd
systemctl enable httpd

web zabbix安装

  • 浏览器访问http://172.16.0.254/zabbix/
  • 点击next会出现检查状态
  • 检查系统环境设置,必须全部都为ok,才能继续
  • 输入连接到数据库详细信息。Zabbix数据库必须已经创建好
  • 连接Zabbix服务细节,如果没有改变可选择默认
  • 完成安装,会将在/etc/zabbix/web/zabbix.conf.php生成配置文件CongratulationsYou have successfully installed Zabbix frontend.Configuration file "/etc/zabbix/web/zabbix.conf.php" created.
  • 登录最新版Zabbix3.4 默认用户Admin 默认密码zabbix

agent安装

  • 安装zabbxi-agent
yum install zabbix-agent -y
  • 配置zabbxi-agent
grep -n '^'[a-Z] /etc/zabbix/zabbix_agentd.conf 
13:PidFile=/var/run/zabbix/zabbix_agentd.pid
32:LogFile=/var/log/zabbix/zabbix_agentd.log
43:LogFileSize=0
97:Server=172.16.8.254
138:ServerActive=172.16.8.254
149:Hostname=Zabbix server
267:Include=/etc/zabbix/zabbix_agentd.d/*.conf
  • 启动zabbxi-agent并设置开机启动
systemctl enable zabbix-agent.service
systemctl restart zabbix-agent.service
posted on   hank_gao  阅读(140)  评论(0编辑  收藏  举报
编辑推荐:
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架
 
点击右上角即可分享
微信分享提示