[Debian] Zabbix 5.0 安裝 中文化
ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.96.144
ansible -i hosts.yml -m apt -a "name=sudo" serverlab11
ansible-playbook -i hosts.yml deploy_Debian_host.yml -e VMhost=serverlab11
中文化
事前準備
設定語系
# 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/
a. Install Zabbix repository
# wget https://repo.zabbix.com/zabbix/5.0/debian/pool/main/z/zabbix-release/zabbix-release_5.0-1+buster_all.deb
# dpkg -i zabbix-release_5.0-1+buster_all.deb
# apt update
# apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-agent
# apt -y install mariadb-server mariadb-client
# 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
修改檔案 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
啟動
# systemctl restart zabbix-server zabbix-agent apache2
# systemctl enable zabbix-server zabbix-agent apache2
#
#
#
# HTML Meta Tag<!/title>
#
# <!/head>
#
# Redirecting to another URL<!/p>
# <!/body>
#<!/html>
<!DOCTYPE html>
<html>
<head>
<title>HTML Meta Tag</title>
<meta http-equiv = "refresh" content = "0; url = /zabbix/" />
</head>
<body>
<p>Redirecting to another URL</p>
</body>
</html>
如同上面 更新 zabbix 套件還是必要的
安裝 zabbix proxy
更新步驟還是需要
apt -y install zabbix-proxy-mysql zabbix-agent
配置mysql
shell> mysql -uroot -p <!-root_password>
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
1
沒有留言:
張貼留言