zabbix 4.0 安装配置

1、安装软件包:

1、安装软件包:
  yum install -y httpd mariadb-server mariadb php php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mhash php-mbstring php-bcmath
  rpm -ivh http://repo.zabbix.com/zabbix/3.5/rhel/7/x86_64/zabbix-release-3.5-1.el7.noarch.rpm
  yum install zabbix-server-mysql zabbix-web-mysql
zabbix-get zabbix-server zabbix-web zabbix-agent

2、配置数据库:

1、启动数据库:
  systemctl start mariadb.service
2、初始化数据库:
  mysql_secure_installation
3、创建zabbix库及账号密码:
  mysql -u root -p 
  CREATE DATABASE zabbix character set utf8 collate utf8_bin;   
  GRANT all ON zabbix.* TO 'zabbix'@'%' IDENTIFIED BY 'zabbix@123'
  flush privileges; 
4、导入数据:
  zcat /usr/share/doc/zabbix-server-mysql-4.0.0/create.sql.gz | mysql -uzabbix -p -h 192.168.128.100 zabbix  

3、修改配置文件:

1、修改/etc/httpd/conf/httpd.conf:
  DirectoryIndex index.html index.php
2、修改 /etc/php.ini:
  date.timezone = PRC 
3、修改selinux为disabled:
  setenforce 0
4、修改/etc/zabbix/zabbix_server.conf:
  DBName=zabbix
  DBUser=zabbix
  DBPassword=zabbix@123
5、修改/etc/httpd/conf.d/zabbix.conf:
  php_value date.timezone Asia/Shanghai

4、启动服务:

1、加入自启动
  systemctl enable zabbix-server
  systemctl enable zabbix-agent
  systemctl enable httpd
  systemctl enable mariadb
2、重启服务:
  systemctl restart zabbix-server
  systemctl restart zabbix-agent
  systemctl restart httpd
  systemctl restart mariadb
3、关闭防火墙:
  systemctl stop firewalld.service
  systemctl disable firewalld

5、初始化zabbix:

1、访问进行初始化后账号密码为Admin,zabiix:
    http://192.168.80.181/zabbix/

5、客户端配置:

1、修改/etc/zabbix/zabbix-agent.conf:
  Server=*.*.*.* #主动模式地址
  ServerActive=*.*.*.* #被动模式地址
  Hostname=主机名(最好和zabbix的主机名一样,不然主动来拉取地址的时候会有问题
2、重启:
  systemctl restart zabbix-agent

 

posted @ 2018-11-24 23:03  灬魑魅魍魉灬  阅读(459)  评论(0编辑  收藏  举报