zabbix 4.0 安裝配置

一、安裝軟件包:

一、安裝軟件包:
  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

二、配置數據庫:

一、啓動數據庫:
  systemctl start mariadb.service
二、初始化數據庫:
  mysql_secure_installation
三、建立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; 
四、導入數據:
  zcat /usr/share/doc/zabbix-server-mysql-4.0.0/create.sql.gz | mysql -uzabbix -p -h 192.168.128.100 zabbix  

三、修改配置文件:

一、修改/etc/httpd/conf/httpd.conf:
  DirectoryIndex index.html index.php
二、修改 /etc/php.ini:
  date.timezone = PRC 
三、修改selinux爲disabled:
  setenforce 0
四、修改/etc/zabbix/zabbix_server.conf:
  DBName=zabbix
  DBUser=zabbix
  DBPassword=zabbix@123
五、修改/etc/httpd/conf.d/zabbix.conf:
  php_value date.timezone Asia/Shanghai

四、啓動服務:

一、加入自啓動
  systemctl enable zabbix-server
  systemctl enable zabbix-agent
  systemctl enable httpd
  systemctl enable mariadb
二、重啓服務:
  systemctl restart zabbix-server
  systemctl restart zabbix-agent
  systemctl restart httpd
  systemctl restart mariadb
三、關閉防火牆:
  systemctl stop firewalld.service
  systemctl disable firewalld

五、初始化zabbix:

1、訪問進行初始化後帳號密碼爲Admin,zabiix:
    http://192.168.80.181/zabbix/

五、客戶端配置:

一、修改/etc/zabbix/zabbix-agent.conf:
  Server=*.*.*.* #主動模式地址
  ServerActive=*.*.*.* #被動模式地址
  Hostname=主機名(最好和zabbix的主機名同樣,否則主動來拉取地址的時候會有問題
二、重啓:
  systemctl restart zabbix-agent
相關文章
相關標籤/搜索