本文共 2176 字,大约阅读时间需要 7 分钟。
一,安装Zabbix rpm包仓库
[root@localhost ~]# rpm -vhi#可先用浏览器进入查看自己所需的版本安装
二,安装zabbix数据库[root@localhost ~]# yum install -y zabbix-server-mysql zabbix-web-mysql三,安装并且启动mysql及初始化数据库信息[root@localhost ~]# rpm -ivh
[root@localhost ~]# yum install -y mysql-community-server [root@localhost ~]# systemctl start mysqld或者[root@localhost ~]# service mysqld start #推荐使用,能看到启动状态[root@localhost ~]# /sbin/chkconfig mysqld on #开机启动
[root@localhost ~]# mysql_secure_installation #初始化数据库#初始root密码是无,直接回车就行四,创建zabbix数据库,创建zabbix账号
[root@localhost ~]# mysql -uroot -p
mysql> create database zabbix character set utf8 collate utf8_bin;mysql> grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by 'zabbix';mysql> flush privileges;mysql> quit五,导入默认的zabbix数据库模板
[root@localhost zabbix-server-mysql-3.0.26]# zcat /usr/share/doc/zabbix-server-mysql-3.0.26/create.sql.gz | mysql zabbix -uzabbix –pzabbix六,修改zabbix_server.conf配置文件
[root@localhost ~]# vi /etc/zabbix/zabbix_server.confDBHost=localhost
DBName=zabbixDBUser=zabbixDBPassword=zabbix七,修改配置/etc/httpd/conf.d/zabbix.conf,时区改成 Asia/Shanghai
php_value date.timezone Asia/Shanghai
八,启动httpd和zabbixserver服务并设置为开机启动
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# systemctl enable httpd[root@localhost ~]# netstat -an |grep 80tcp6 0 0 :::80 :::* LISTEN tcp6 0 0 10.5.41.157:80 10.5.41.52:61533 ESTABLISHEDtcp6 0 0 10.5.41.157:80 10.5.41.52:61534 ESTABLISHEDunix 2 [ ACC ] STREAM LISTENING 20680 public/qmgrunix 3 [ ] STREAM CONNECTED 14802 unix 2 [ ] DGRAM 18039 [root@localhost ~]# systemctl start zabbix-server[root@localhost ~]# systemctl enable zabbix-server
九,关闭selinux和iptables
[root@localhost ~]# systemctl stop firewalld.service [root@localhost 2~]# setenforce 0setenforce: SELinux is disabled推荐:1.vi /etc/selinux/config
将selinux=xxx改为 selinux=disable 关闭该功能tailf /var/log/zabbix/zabbix_server.log # 查看zabbix-server日志
十.访问网站,例如::
上面图形界面的操作都写到一个配置文件中
[root@localhost zabbix]# more /etc/zabbix/web/zabbix.conf.php
十一:web登陆的默认账号Admin 密码zabbix
备注:Admin(A为大写)附:zabbix官网相关文件转载于:https://blog.51cto.com/11579920/2374001