2021年8月8日 星期日

Centos7 Zabbix4.2 安裝設定

 前置準備

1.先關防火牆及selinux:


systemctl stop firewalld

systemctl disable firewalld


vim /etc/selinux/config

SELIUNX=disabled


2.校時

ntpdate -u clock.stdtime.gov.tw


3.安裝php mariadb httpd相關套件:

yum -y install mariadb mariadb-server httpd php php-mysql

systemctl enable httpd

systemctl restart httpd

systemctl enable mariadb

systemctl start mariadb


初始化mariadb:

mysql_secure_installation



開始安裝

1.安裝zabbix  rpm源  (zabbix官網底下選zabbix 4.2.2-e19):

rpm -ivh http://repo.zabbix.com/zabbix/4.2/rhel/7/x86_64/zabbix-release-4.2-2.el7.noarch.rpm

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX

yum -y install zabbix-server-mysql zabbix-web-mysql  zabbix-agent



2.Mysql設定:

mysql -u root -p

進入mysql後 建立zabbix database及zabbix帳號db權限:


CREATE DATABASE zabbix DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;


grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';



3.將zabbix還原資料庫:

cd /usr/share/doc/zabbix-server-mysql-4.2.8/

zcat create.sql.gz | mysql -uroot -p  zabbix


4.編輯設定zabbix server conf

vim /etc/zabbix/zabbix_server.conf


============================================


DBHost=localhost

DBName=zabbix

DBUser=zabbix

DBPassword=zabbix

============================================


systemctl start zabbix-server


systemctl enable zabbix-server



重啟httpd服務,生成了一個zabbix.conf的檔案


systemctl restart httpd


vim /etc/httpd/conf/httpd.conf

=================================================

#修改documentroot(修改httpd 指向zabbix目錄)


/usr/share/zabbix


==================================================


編輯 zabbix 前端 php conf相關參數


vim /etc/httpd/conf.d/zabbix.conf


=======================================



<IfModule mod_php5.c>

        php_value max_execution_time 300

        php_value memory_limit 128M

        php_value post_max_size 16M

        php_value upload_max_filesize 2M

        php_value max_input_time 300

        php_value max_input_vars 10000

        php_value always_populate_raw_post_data -1

        php_value date.timezone Asia/Taipei

  </IfModule>


重啟httpd服務


systemctl restart httpd



開啟網頁打http:// your ip/zabbix








網頁初始相關設定如圖:(password:zabbix)






























初始登入畫面
username:Admin
Password:zabbix

























登入後進入畫面如下:













可以設定中文(簡體)

點選zabbix右上Admin

















沒有留言:

張貼留言