[Debian] 安裝新版的 Zabbix 5.2
#Step 01 –
基本 Debian 安裝
#
上傳F5 SNMP
Install Zabbix repository (安裝更新套件)
# wget https://repo.zabbix.com/zabbix/5.2/debian/pool/main/z/zabbix-release/zabbix-release_5.2-1+debian10_all.deb
# dpkg -i zabbix-release_5.2-1+debian10_all.deb
# apt update
b. Install Zabbix server, frontend, agent (安裝Zabbix)
# apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-agent
apt -y install mariadb-server mariadb-client
c. Create initial database
Run the following on your database host.
# mysql -uroot -p
password
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> create user zabbix@localhost identified by 'password';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> quit;
匯入資料庫
# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
d. Configure the database for Zabbix server
編輯 file /etc/zabbix/zabbix_server.conf
DBPassword=password
Start Zabbix server and agent processes
# systemctl restart zabbix-server zabbix-agent apache2
# systemctl enable zabbix-server zabbix-agent apache2
f. Configure Zabbix frontend
Connect to your newly installed Zabbix frontend: http://server_ip_or_name/zabbix
Follow steps described in Zabbix documentation: Installing frontend
修改檔案 vi /etc/zabbix/zabbix_server.conf
DBPassword=password
修改 php時區 vi /etc/zabbix/apache.conf
# php_value date.timezone Europe/Riga
# php_value date.timezone Asia/Taipei
#Step 02 –
修改中文語系
中文化
事前準備
設定語系
# locale -a
# dpkg-reconfigure locales (安裝語系)
# apt-get install xfonts-intl-chinese
# apt-get -y install apache2
修改中文語系 # 要等 zabbix 安裝完成後才能使用下列指令
sed -i '/zh_TW/s/false/true/' /usr/share/zabbix/include/locales.inc.php
上傳 中文自行檔 # 重要
目標目錄:/usr/share/zabbix/fonts/
cp kaiu.ttf /usr/share/zabbix/fonts/
Debian10 + zabbix 5 字型目錄為 /usr/share/zabbix/assets/fonts/
修改簡體中文語系 亂碼
[root@zabbix ~]# sed -i 's/graphfont/simkai/g' /usr/share/zabbix/include/defines.inc.php
換成繁體中文字形
[root@zabbix ~]# sed -i 's/graphfont/kaiu/g' /usr/share/zabbix/include/defines.inc.php
上傳 SNMP MIB檔案路徑
/usr/share/snmp/mibs/
#Step 03 – 另外安裝 zabbix proxy
如同上面 更新 zabbix 套件還是必要的
安裝 zabbix proxy
更新步驟還是需要
apt -y install zabbix-proxy-mysql zabbix-agent
配置mysql
shell> mysql -uroot -p
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to [email protected] identified by 'zabbix';
mysql> quit;
匯入資料表
zcat /usr/share/doc/zabbix-proxy-mysql/schema.sql.gz | mysql -u zabbix -p zabbix zabbix
修改配置檔案
# vi /etc/zabbix/zabbix_proxy.conf
Server=1.1.1.1
Hostname=zabbix-proxy-query
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
ConfigFrequency=40
DataSenderFrequency=5 #重要
重啟服務
/etc/init.d/zabbix-proxy restart
update-rc.d zabbix-proxy defaults
其他
modify /sys db provision.tomcat.extramb value 1024
tmsh restart sys service tomcat
watch -n 1 'top -cbn 1 | grep tomcat'
top -cbn 1
#Step 04 –
#Step 05 –
#Step 06 –
#Step 07 –
#Step 08 –
#Step 09 –
#Step 10 –
沒有留言:
張貼留言