Zabbix:編譯安裝zabbix-4.0

1、安裝環境php

系統:html

centos6.5前端

軟件版本及連接:mysql

nginx-1.15.0:http://nginx.org/download/nginx-1.15.0.tar.gznginx

        zabbix-4.0.0:https://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/4.0.0/zabbix-4.0.0.tar.gzsql

        php-5.6.38:http://am1.php.net/distributions/php-5.6.38.tar.gz數據庫

        mysql-5.6.42:https://cdn.mysql.com//Downloads/MySQL-5.6/mysql-5.6.42.tar.gzvim

pcre-8.42:https://nchc.dl.sourceforge.net/project/pcre/pcre/8.42/pcre-8.42.tar.gzcentos

zlib-1.2.11:http://www.zlib.net/zlib-1.2.11.tar.gz瀏覽器

openssl-1.1.1:https://www.openssl.org/source/openssl-1.1.1.tar.gz

       image.png

        注:本文全部源碼包均放置在/opt目錄下,安裝目錄均在/usr/local目錄下,以對應軟件包命名

2、安裝nginx

一、安裝依賴

二、安裝nginx

#./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_stub_status_module --user=nginx --group=nginx --with-pcre=/opt/pcre-8.42 

--with-zlib=/opt/zlib-1.2.11 --with-http_geoip_module --with-http_gzip_static_module --with-http_flv_module --with-http_mp4_module

缺乏什麼devel包,yum安裝便可

#make && make install

        三、修改配置文件,結合php(PHP環境安裝可參考以前的文章)

        image.png

        

四、新建網站目錄

#mkdir -pv /zabbix/html/zabbix

3、安裝zabbix4.0

一、解包複製文件(啓動腳本、數據庫、zabbix前端文件)

#tar xf zabbix-4.0.0.tar.gz

#/opt/zabbix-4.0.0/misc/init.d/fedora/core

#cp *  /etc/init.d/

#chmod +x /etc/init.d/zabbix*

        image.png

二、導入數據庫(安裝mysql數據庫可參考以前的文章)

#建立zabbix數據庫並受權zabbix用戶

#mysql -uroot -p -e "create database zabbix default character set utf8 collate utf8_bin;"

#mysql -uroot -p -e "grant all on zabbix.* to 'zabbix'@'localhost' identified by 'zabbix';"

#導入數據庫

#cd /opt/zabbix-4.0.0/database/mysql

        image.png

#mysql -uzabbix -p zabbix < schema.sql

#mysql -uzabbix -p zabbix < images.sql

#mysql -uzabbix -p zabbix < data.sql

三、複製網站文件至nginx的網站目錄

#cd /opt/zabbix-4.0.0/frontends/php

#cp -r *  /zabbix/html/zabbix/

        image.png

        四、重命名zabbix.conf.php.example爲zabbix.conf.php並修改配置文件

        image.png

        #vim zabbix.conf.php

        image.png

        五、修改zabbix啓動腳本

        image.png

        六、修改zabbix配置文件並啓動zabbix服務

        image.png

#/etc/init.d/zabbix_server start

#/etc/init.d/zabbix_agent start

image.png

image.png

七、瀏覽器訪問

http://ip/zabbix

        image.png

        

默認用戶名:Admin

密碼:zabbix

        image.png

        

結束!

後續整理關於配置監控、微信告警、郵件告警。

        注:在瀏覽器進行安裝時,會報php配置參數錯誤,可按照提示修改php.ini文件後,重啓php-fpm便可。

相關文章
相關標籤/搜索