Zabbix系列之二:zabbix監控快速搭建

 

一、初始化系統配置

  • 關閉防火牆

  • 禁用SELINUX

  • 開啓網卡

  • 替換yum源

 

二、安裝LAMP環境

  1. yum -y install mariadb mariadb-server httpd php php-mysql
  2. systemctl start httpd 、systemctl start mariadb 、systemctl enable httpd 、systemctl enable mariadb
  3. 初始化數據庫mysql_secure_installation(一路輸入y即可),使用mysql -uroot -p 驗證,可登錄表示成功

 

三、安裝Zabbix環境

  1. 安裝官方yum源: rpm -ivh https://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
  2. 導入密鑰: rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
  3. 下載: yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent
  4. 初始化數據庫  
    mysql -u root -p
    create database zabbix default character set utf8 collate utf8_bin;
    grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';

     

  5. 讀入數據庫
    cd /usr/share/doc/zabbix-server-mysql-3.2.11/
    zcat create.sql.gz |mysql -uroot -p zabbix

     

  6. 啓動zabbix服務
    vim /etc/zabbix/zabbix_server.conf
        DBHost=localhost
        DBName=zabbix
        DBUser=zabbix
        DBPassword=zabbix
    systemctl start zabbix-server
    systemctl enable zabbix-server

     

  7. 編輯zabbix前端php配置
    vi /etc/httpd/conf.d/zabbix.conf
        php_value date.timezone Asia/Shanghai

     

  8. 調整時間同步
    yum -y install ntpdate
    ntpdate cn.pool.ntp.org

     

  9. 重啓apache服務: systemctl restart httpd

這個時候登錄web地址: 

如何直接輸入IP地址,不添加zabbix,也可以打開此界面,那麼需要修改/etc/httpd/conf/httpd.conf文件,修改爲:DocumentRoot "/usr/share/zabbix/",之後重啓apache服務。

正式開始平面化安裝:

登錄成功界面是:

需要將其修改爲中文:

地址再重新訪問,便改爲中文。

   10.配置zabbix_agentd.conf啓動agentd

vi /etc/zabbix/zabbix_agentd.conf

  Server=192.168.1.171

  ServerActive=192.168.1.171

  Hostname=192.168.1.171
systemctl start zabbix-agent
systemctl enable zabbix-agent

查看10050是否處於監聽狀態

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章