[关闭]
@WillireamAngel 2018-06-09T08:49:52.000000Z 字数 1700 阅读 941

Zabbix部署教程

监控


主机规划

OS:centos7.4
Zabbix version:3.4.2
Database:MariaDB

关闭防火墙:

  1. systemctl stop firewalld

防火墙开机不自启:

  1. systemctl disable firewalld

关闭selinux:

  1. 临时:setenforce 0
  2. 永久:sed -i 's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config

修改hostname:

  1. hostname zabbix.hope.net
  2. vi /etc/hosts
  3. 10.86.1.188 zabbix.hope.net

安装部署

安装Zabbix

  1. rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
  1. yum install zabbix-server-mysql zabbix-web-mysql
  1. yum install zabbix-agent

安装配置Mariadb

  1. yum install -y mariadb mariadb-devel mariadb-server
  2. systemctl restart mariadb
  3. systemctl enable mariadb
  4. netstat -npl|grep 3306
  1. mysql_secure_installation
  2. a)为root用户设置密码y
  3. b)删除匿名账号y
  4. c)取消root用户远程登录y
  5. d)删除test库和对test库的访问权限y
  6. e)刷新授权表使修改生效y
  1. shell> mysql -uroot -p<password>
  2. mysql> create database zabbix character set utf8 collate utf8_bin;
  3. mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
  4. mysql> flush privileges;
  5. mysql> quit;
  1. cd /usr/share/doc/zabbix-server-mysql-3.4.9
  2. zcat create.sql.gz | mysql -uroot zabbix

配置Zabbix

  1. # vi /etc/zabbix/zabbix_server.conf
  2. DBHost=localhost
  3. DBName=zabbix
  4. DBUser=zabbix
  5. DBPassword=zabbix
  1. systemctl start zabbix-server
  2. systemctl enable zabbix-server
  1. vi /etc/httpd/conf.d/zabbix.conf
  2. php_value max_execution_time 300
  3. php_value memory_limit 128M
  4. php_value post_max_size 16M
  5. php_value upload_max_filesize 2M
  6. php_value max_input_time 300
  7. php_value always_populate_raw_post_data -1
  8. php_value date.timezone Asia/Shanghai
  1. systemctl start httpd
  2. systemctl enable httpd

浏览器打开http://10.1.1.188/zabbix,进行图形化安装,按默认点击即可(数据库端口为3306)。
登录zabbix,管理员帐号/密码:Admin/zabbix

配置主机监控

yum install zabbix-agent
vi /etc/zabbix/zabbix-agent.conf

启动邮件报警

参照:https://www.linuxidc.com/Linux/2017-07/145944.htm
关闭IPv6:
https://linux.cn/article-4935-1.html

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注