- 关闭防火墙
[root@localhost ~]# systemctl stop firewalld.service
- 关闭防火墙的开机自启
[root@localhost ~]# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
- 替换防火墙参数
[root@localhost ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
- 查看防火墙状态
[root@localhost ~]# grep SELINUX=disabled /etc/selinux/config
SELINUX=disabled
- 关闭当前防火墙
[root@localhost ~]# setenforce 0
- 安装vim和wget
[root@localhost ~]# yum install openssh vim wget -y
- 系统更新(需要几分钟时间)
[root@localhost ~]# yum update
- 下载zabbix3.4.4RPM
[root@localhost ~]# rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm
- 安装服务端
[root@localhost ~]# yum install zabbix-server-mysql zabbix-web-mysql
- 安装客户端(不装也行,非必须)
[root@localhost ~]# yum install zabbix-agent
- 安装数据库
[root@localhost ~]# yum install mariadb mariadb-server -y
- 启动数据库
[root@localhost ~]# systemctl start mariadb
- 设置开机自启动
[root@localhost ~]# systemctl enable mariadb.service
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
- 为zabbix创建数据库
[root@localhost ~]# mysql
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit
- 初始化数据库(password:zabbix)
[root@localhost zabbix-server-mysql-3.4.4]# cd /usr/share/doc/zabbix-server-mysql-3.4.4
[root@localhost zabbix-server-mysql-3.4.4]# zcat /usr/share/doc/zabbix-server-mysql-3.4.4/create.sql.gz | mysql -uzabbix -p zabbix
Enter password:
- 查看下数据库表单是否有生成导入
[root@localhost zabbix-server-mysql-3.4.4]# mysql
MariaDB [(none)]> use zabbix
MariaDB [zabbix]> show tables;
+----------------------------+
| Tables_in_zabbix |
+----------------------------+
| acknowledges |
| actions |
| alerts |
................
.............
.........
MariaDB [zabbix]> exit
Bye
- 为Zabbix server配置数据库
[root@localhost zabbix-server-mysql-3.4.4]# vim /etc/zabbix/zabbix_server.conf
DBHost=localhost #第91行去掉前面#
DBName=zabbix #第101行不需要修改#
DBUser=zabbix #第117行不需要修改#
DBPassword=zabbix #第125行去掉前面#修改数据库密码=zabbix#
:wq #保存退出
- 启动zabbix 服务及设置开机启动
[root@localhost zabbix-server-mysql-3.4.4]# systemctl start zabbix-server
[root@localhost zabbix-server-mysql-3.4.4]# systemctl enable zabbix-server
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-server.service to /usr/lib/systemd/system/zabbix-server.service.
- 配置修正php 内部参数
[root@localhost zabbix-server-mysql-3.4.4]# vim /etc/httpd/conf.d/zabbix.conf
- 修改参数如下
php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M #16M/32M 都可
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 #修改此行时区
:wq!
- 重新启动httpd,刷新配置
[root@localhost zabbix-server-mysql-3.4.4]# systemctl start httpd
至此服务端的安装已结束,现在就可以浏览器打开http://serverIP/zabbix进行最后的配置咯
1, 直接下一步
2, 检查配置,如果全是OK则可下一步
3, 连接数据库,最后一项password:zabbix
4, 连接服务器,最后一项Name:zabbix
5, 直接下一步即完成配置
6, 默认管理员帐号:Admin密码:zabbix
至此全部完成,开启你的zabbix监控之旅吧,后面还有好多好玩的。