zabbix

centos7安装zabbix 3.4

2017-10-31  本文已影响432人  think_lonely

1.安装zabbix yum源

# rpm -ivhhttp://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm

2.安装zabbix软件包

# yum install zabbix-server-mysql

# yum install zabbix-web-mysql

3.epel源安装

yum install epel-release -y

4.mariadb数据库安装

# yum install mariadb-server -y

启动数据库

# systemctl start mariadb

设置mariadb开机启动

# systemctl enable mariadb

查看数据库状态

[root@zabbix ~]# systemctl is-activemariadb.service

5.进入mariadb,授权建立账户

# mysql

#建立数据库

MariaDB [(none)]> create databasezabbix;

Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all privilegeson zabbix.* to zabbix@localhost identified by 'zabbix';

Query OK, 0 rows affected (0.00 sec)

6.导入数据库

#进入mysql备份放置的目录

cd/usr/share/doc/zabbix-server-mysql-3.4.3/

# ls

AUTHORSChangeLogCOPYINGcreate.sql.gzNEWSREADME#create.sql.gz是需要的

#执行下边命令导入数据库

# zcat create.sql.gz | mysql -uzabbix -pzabbix

Enter password:

会提示输入密码:上边设置的密码为zabbix

7.修改zabbixsever端的数据库配置项

# vi/etc/zabbix/zabbix_server.conf

DBHost=localhost

DBName=zabbix

DBUser=zabbix

DBPassword=zabbix#上边设置的密码

8.启动zabbix-server客户端

# systemctl start zabbix-server

# systemctl enable zabbix-server

9. zabbix前端配置

# vim /etc/httpd/conf.d/zabbix.conf

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服务,设置开机自启动

# systemctl start httpd

# systemctl enable httpd

Created symlink from/etc/systemd/system/multi-user.target.wants/httpd.service to/usr/lib/systemd/system/httpd.service.

10. 防火墙默认开启的,关闭防火墙

# systemctl stop firewalld

#systemctl is-active firewalld

Inactive

11. web安装开

在浏览器输入网址http://192.168.238.152/zabbix/

点击下一步,查看状态是否正确

设置数据库的地址端口号密码

点击下一步,有错误会报错,没有错误一直下一步到结束

到此位置安装结束

12.登陆测试

浏览器输入用户名密码

初始用户名密码为:

用户名:Admin

密码: Zabbix

安装成功

13. Agent installation(代理的安装)

安装zabbix-agent

# yum install zabbix-agent -y

启动zabbix-agent

# systemctl start zabbix-agent

# systemctl enable zabbix-agent

Created symlink from/etc/systemd/system/multi-user.target.wants/zabbix-agent.service to/usr/lib/systemd/system/zabbix-agent.service.


错误处理:

cannot set resource limit: [13] Permissiondenied

此时只需要关闭Selinux,两种方案;

1)临时关闭

# setenforce 0

2)永久关闭(reboot host)

# vim /etc/selinux/config

SELINUX=enforcing

SELINUX=disabled


上一篇 下一篇

猜你喜欢

热点阅读