【Zabbix3.0】安装部署 Centos 7

前端之家收集整理的这篇文章主要介绍了【Zabbix3.0】安装部署 Centos 7前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

环境准备

  • OS:Centos 7 64bit
  • Zabbix版本:3.0.15
  • MysqL版本:5.6

注意:zabbix3.0相关要求 MysqL5.0以上版本、apache1.3以上版本、PHP5.4以上版本。

在版本选择建议选择官方技术支持时间较长(LTS)的稳定版本,从上图我我们可以看到没有最新最稳定的是Zabbix3.0

About Zabbix LTS

LTS stands for "Long Term Support". Zabbix LTS version is released every year and a half (1,5) and offers Zabbix customers Support services for five (5) years:
years of Full support – support of general,critical and security issues fixing
additional years of Limited Support – support of critical and security issues only

安装步骤

一、关闭selinux和iptables。

[root@linux-node2 ~]# systemctl stop firewalld.service
[root@linux-node2 ~]# setenforce 0
setenforce: SELinux is disabled

二,安装Zabbix rpm包仓库

[root@linux-node2 ~]# rpm -vhi http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm

三,安装zabbix-server-MysqL和zabbix-web-MysqL

[root@linux-node2 ~]# yum install -y zabbix-server-MysqL zabbix-web-MysqL

四,安装并且启动MysqL5.6及初始化数据库信息

[root@linux-node2 ~]# rpm -ivh http://repo.mysql.com/yum/mysql-5.6-community/el/6/x86_64/mysql-community-release-el6-5.noarch.rpm
[root@linux-node2 ~]# yum install -y MysqL-community-server
[root@linux-node2 ~]# systemctl start MysqLd
[root@linux-node2 ~]# /sbin/chkconfig MysqLd on #开机启动
[root@linux-node2 ~]# MysqL_secure_installation #初始化数据库信息

五,创建zabbix数据库,创建zabbix账号

[root@linux-node2 ~]# MysqL -uroot -p
...
MysqL> create database zabbix character set utf8 collate utf8_bin;
Query OK,1 row affected (0.00 sec)

MysqL> grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by 'zabbix';
Query OK,0 rows affected (0.00 sec)

MysqL> flush privileges;
Query OK,0 rows affected (0.01 sec)

六,导入默认的zabbix数据库信息

[root@linux-node2 zabbix-server-MysqL-3.0.12]# zcat /usr/share/doc/zabbix-server-MysqL-3.0.12/create.sql.gz | MysqL zabbix -uzabbix -pzabbix

七,修改zabbix_server.conf的配置文件

[root@linux-node2 ~]# grep ^DB /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix

八,修改配置文件/etc/httpd/conf.d/zabbix.conf,时区改成 Asia/Shanghai

PHP_value max_execution_time 300
PHP_value memory_limit 128M
PHP_value post_max_size 16M
PHP_value upload_max_filesize 2M
PHP_value max_input_time 300
PHP_value always_populate_raw_post_data -1
PHP_value date.timezone Asia/Shanghai

九,启动apache/zabbix-server服务并设置为开机启动

[root@linux-node2 ~]# systemctl start httpd
[root@linux-node2 ~]# systemctl enable httpd
[root@linux-node2 ~]# netstat -an |grep 80
tcp 0 0 192.168.56.11:80 0.0.0.0:* LISTEN
[root@linux-node2 ~]# systemctl start zabbix-server
[root@linux-node2 ~]# systemctl enable zabbix-server

查看zabbix-server日志

[root@linux-node1 ~]# tailf /var/log/zabbix/zabbix_server.log

6516:20171029:091122.131 Starting Zabbix Server. Zabbix 3.0.12 (revision 73586).
6516:20171029:091122.131 ** Enabled features **
6516:20171029:091122.131 SNMP monitoring: YES
6516:20171029:091122.131 IPMI monitoring: YES
6516:20171029:091122.131 Web monitoring: YES
6516:20171029:091122.131 VMware monitoring: YES
6516:20171029:091122.131 SMTP authentication: YES
6516:20171029:091122.131 Jabber notifications: YES
6516:20171029:091122.131 Ez Texting notifications: YES
6516:20171029:091122.131 ODBC: YES
6516:20171029:091122.131 SSH2 support: YES
6516:20171029:091122.131 IPv6 support: YES
6516:20171029:091122.131 TLS support: YES

zabbix-server的web目录

[root@linux-node1 zabbix]# ls /usr/share/zabbix
actionconf.PHP app chart.PHP hostgroups.PHP index.PHP popup_media.PHP scripts_exec.PHP tr_events.PHP
adm.gui.PHP applications.PHP charts.PHP hostinventoriesoverview.PHP items.PHP popup.PHP search.PHP trigger_prototypes.PHP
adm.housekeeper.PHP audio conf hostinventories.PHP js popup_right.PHP services.PHP triggers.PHP
adm.iconmapping.PHP auditacts.PHP conf.import.PHP host_prototypes.PHP jsLoader.PHP popup_trexpr.PHP setup.PHP tr_logform.PHP
adm.images.PHP auditlogs.PHP dashconf.PHP host_screen.PHP jsrpc.PHP profile.PHP slideconf.PHP tr_status.PHP
adm.macros.PHP authentication.PHP discoveryconf.PHP hosts.PHP latest.PHP queue.PHP slides.PHP tr_testexpr.PHP
adm.other.PHP browserwarning.PHP disc_prototypes.PHP httpconf.PHP local report2.PHP srv_status.PHP usergrps.PHP
adm.regexps.PHP chart2.PHP events.PHP httpdetails.PHP locale report4.PHP styles users.PHP
adm.triggerdisplayoptions.PHP chart3.PHP favicon.ico image.PHP maintenance.PHP robots.txt sysmap.PHP zabbix.PHP
adm.triggerseverities.PHP chart4.PHP fonts images map.import.PHP screenconf.PHP sysmaps.PHP
adm.valuemapping.PHP chart5.PHP graphs.PHP img map.PHP screenedit.PHP templates.PHP
adm.workingtime.PHP chart6.PHP history.PHP imgstore.PHP overview.PHP screen.import.PHP toptriggers.PHP
api_jsonrpc.PHP chart7.PHP host_discovery.PHP include popup_httpstep.PHP screens.PHP tr_comments.PHP

十,访问网站,例如:http://本机IP/zabbix。正常打开Zabbix 默认用户是Admin,默认密码是zabbix

猜你在找的CentOS相关文章