wcdz 发表于 2019-1-17 14:00:44

【安装zabbix3.4之3-zabbix和mariadb】centos7 安装zabbix3.4-kanglidebj的博客

  一、系统环境
  cat /etc/redhat-release

  CentOS Linux>  关闭防火墙及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
  二、数据库安装及配置
  1、MariaDB概述
  MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可。
  开发这个分支的原因是:甲骨文公司收购了MySQL后,有将MySQL闭源的潜在风险,因此社区采用分支的方式来避开这个风险。
  MariaDB的目的是完全兼容MySQL,包括API和命令行,使之能轻松成为MySQL的代替品。
  2、安装mariadb
  yum install mariadb-server mariadb -y
  mariadb数据库的相关命令是:
  systemctl start mariadb#启动MariaDB
  systemctl stop mariadb#停止MariaDB
  systemctl restart mariadb#重启MariaDB
  systemctl enable mariadb#设置开机启动
  三、Zabbix3.4安装及配置
  1、Zabbix3.4新功能概述
  More newly developed and improved features of Zabbix 3.4 are now availabe for you!
  Have a closer look at What's New in Zabbix 3.4:
  Have a closer look at What's New in Zabbix 3.4:
  Remote command support through proxies
  Parallel processing of alerts
  Being notified on problem acknowledgement
  Item value preprocessing
  New preprocessing options
  Configurable JMX endpoints
  JMX low-level discovery
  PCRE library for regular expressions
  URL-encoding support in web monitoring
  Automatic URL-encoding
  Flexible URL-encoding for variables
  Unicode support in domain names
  Support of macros and time suffixes in time periods
  Host macro support in event tags
  Frontend improvements
  Dropping IE9 and IE10 support
  Full cloning of screens and maps
  Unified style for radio buttons and checkboxes
  Applying same permissions to nested host groups

  Increased field>  Miscellaneous
  Daemon improvements
  IPMI polling
  Configuration parameters
  More information on agent metric thread crashes
  Item changes/improvements
  Low-level discovery
  Return code check for scripts and commands
  zabbixe中文文档 https://www.zabbix.com/documentation/3.4/zh/manual
  2、Zabbix3.4安装
  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
  3、创建数据库
  create database zabbix character set utf8 collate utf8_bin;

  grant all privileges on zabbix.* to zabbix@localhost>  4、导入数据
  zcat /usr/share/doc/zabbix-server-mysql-3.4.0/create.sql.gz | mysql -uzabbix -pzabbix zabbix
  5、配置数据库用户及密码
  grep -n '^' /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
  6、启动zabbix server并设置开机启动
  systemctl enable zabbix-server
  systemctl start zabbix-server
  7、编辑Zabbix前端PHP配置,更改时区
  vim /etc/httpd/conf.d/zabbix.conf
  php_value date.timezone Asia/Shanghai
  8、SELinux配置
  setsebool -P httpd_can_connect_zabbix on
  setsebool -P httpd_can_network_connect_db on
  9、启动httpd并设置开机启动
  systemctl start httpd
  systemctl enable httpd
  四、安装Zabbix Web
  1、浏览器访问,并进行安装
  http://10.12.7.116/zabbix/
http://i2.运维网.com/images/blog/201804/23/0bbf7e700628e883219754047bfa4dea.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=
  2、点击next会出现检查状态
http://i2.运维网.com/images/blog/201804/23/82318c4651f68ed08ce387ac91e20f81.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=
  3、检查系统环境设置,必须全部都为ok,才能继续
http://i2.运维网.com/images/blog/201804/23/50b9dfdd02f76def707dcd89615b83b4.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=
  4、输入连接到数据库详细信息。Zabbix数据库必须已经创建好
http://i2.运维网.com/images/blog/201804/23/9b91fafec17bbaaee030a9fed2febf3f.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=
http://i2.运维网.com/images/blog/201804/23/c60bc69c52a36db834f1f96864c8c68d.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=
  5、连接Zabbix服务细节,如果没有改变可选择默认
http://i2.运维网.com/images/blog/201804/23/2c5fc2a16685882d10985b92148e3959.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=
  7、完成安装,会将在/etc/zabbix/web/zabbix.conf.php生成配置文件
  Congratulations! You have successfully installed Zabbix frontend.
  Configuration file "/etc/zabbix/web/zabbix.conf.php" created.
http://i2.运维网.com/images/blog/201804/23/241989d6b21b4b57d56aa29072c75d38.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=
  8、登录最新版Zabbix3.4 默认用户Admin 默认密码zabbix
http://i2.运维网.com/images/blog/201804/23/24a6a2b68263315d35d9b12b8cf83289.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=
http://i2.运维网.com/images/blog/201804/23/3af94e7f28acb6b84fcba9f03a9f44bc.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=
  五、zabbxi-agent安装及配置
  1、安装zabbxi-agent
  yum install zabbix-agent -y
  2、配置zabbxi-agent
  grep -n '^' /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
  3、启动zabbxi-agent并设置开机启动
  systemctl enable zabbix-agent.service
  systemctl restart zabbix-agent.service

页: [1]
查看完整版本: 【安装zabbix3.4之3-zabbix和mariadb】centos7 安装zabbix3.4-kanglidebj的博客