shell脚本一键部署安装zabbix(simkai.ttf)字体需要提前手动导入

#!/bin/bash
systemctl stop firewalld.service
echo "防火墙正在关闭"
setenforce 0
echo "selinux正在关闭"
wget https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm &> /dev/null
echo "zabbix的rpm包下载成功"
yum -y install httpd mariadb mariadb-server php php-gd php-devel php-mysql &> /dev/null
echo "apache、php、mysql安装成功"
systemctl start mariadb &> /dev/null
if [ $? -eq 0 ];then
	echo "mysql启动成功"
else
	systemctl restart mariadb
	echo "mysql 重启成功"
fi
mysql -e "create database zabbix charset utf8;" &> /dev/null
if [ $? -ne 0 ];then
	echo "数据库创建失败,请重试"
	mysql -e "drop database zabbix;"
	mysql -e "create database zabbix charset utf8;"
	echo "数据库重新创建成功"
else
	echo "数据库创建成功"
fi
mysql -e "grant all on *.* to zabbix@'localhost' identified by 'zabbix';"
if [ $? -eq 0 ];then
	echo "zabbix授权成功"
else
	echo "zabbix授权失败,请重新操作"
	mysql -e "DROP  USER zabbix@'localhost';"
	mysql -e "grant all on *.* to zabbix@'localhost' identified by 'zabbix';"
	echo "zabbix授权成功"
fi
mysql -e "flush privileges;"
echo "刷新权限成功"
systemctl start httpd &> /dev/null
if [ $? -eq 0 ];then
	echo "apache启动成功"
else
	systemctl restart httpd
	echo "apache重启成功"
fi
rpm -ivh zabbix-release-3.4-2.el7.noarch.rpm &> /dev/null
echo "zabbix的rpm包安装成功"
rm -rf zabbix-release-3.4-2.el7.noarch.rpm
yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent &> /dev/null
while :
do
	
        yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent &> /dev/null
	if [ $? -ne 0 ];then
                echo "zabbix安装没有成功,重新安装"
        else
                echo "zabbix安装成功"
                break
        fi
done
zcat /usr/share/doc/zabbix-server-mysql-3.4.15/create.sql.gz | mysql -uzabbix -pzabbix zabbix
sed -i '/DBHost=localhost/cDBHost=localhost' /etc/zabbix/zabbix_server.conf
sed -i '/DBName=zabbix/cDBName=zabbix' /etc/zabbix/zabbix_server.conf
sed -i '/DBUser=zabbix/cDBUser=zabbix' /etc/zabbix/zabbix_server.conf
sed -i '/DBPassword=/cDBPassword=zabbix' /etc/zabbix/zabbix_server.conf
echo "配置文件修改成功"
systemctl start zabbix-server.service
echo "zabbin启动成功"
#sed -i '1adate.timezone = Asia/Shanghai' /etc/php.ini
sed -i '/php_value date.timezone/c        php_value date.timezone Asia/Shanghai' /etc/httpd/conf.d/zabbix.conf
echo "修改时区成功"
systemctl restart httpd
echo "apache重启成功"
cp simkai.ttf /usr/share/zabbix/fonts/
sed -i "54c define('ZBX_GRAPH_FONT_NAME',           'simkai');" /usr/share/zabbix/include/defines.inc.php 
echo "字体修改成功"
echo "请到网页查看zabbix"

													马治
包括:times new roman,中山行书百年纪念版,calibri,Christopherhand,DejaVuSansMono,方正兰亭黑,James Fajardo,Monaco,微软雅黑,仿宋,黑体,楷体,宋体,yahei_mono,仿宋_GB2312,楷体_GB2312,迷你简行楷碑。 文件名列表: bb1550.ttf calibri.ttf calibrib.ttf calibrii.ttf calibriz.ttf comesinhandy.ttf DejaVuSansMono-Bold.ttf DejaVuSansMono-BoldOblique.ttf DejaVuSansMono-Oblique.ttf DejaVuSansMono.ttf DroidSansFallback.ttf James_Fajardo.ttf Monaco.ttf msyh.ttf msyhbd.ttf simfang.ttf simhei.ttf simkai.ttf simsun.ttc times.ttf timesbd.ttf timesbi.ttf timesi.ttf yahei_mono.ttf 仿宋_GB2312.ttf 使用方法.txt 楷体_GB2312.ttf 迷你简行楷碑.TTF 使用方法: ==================================================================================================================== ==================================================================================================================== windows: 将所有的ttf文件拷贝到 系统所在分区的windows\fonts 目录下即可 linux: Install and configure Unicode TrueType fonts in Linux Uncompress the downloaded font archive to a directory and add it to the font path, a list of directories containing fonts: 1. Uncompress the archive # tar xvzf utf8.tar.gz or # tar xvjf arial.tar.bz2 2. Create a directory for new fonts # mkdir /usr/share/fonts/truetype 3. Move the uncompressed font files to the new font directory # mv *.ttf /usr/share/fonts/truetype 4. Navigate to the font directory # cd /usr/share/fonts/truetype 5. Create fonts.scale and fonts.dir # mkfontscale && mkfontdir # fc-cache 6. Add the new font directory to the X11 font path # chkfontpath --add /usr/share/fonts/truetype 7. Restart X font server # /etc/rc.d/init.d/xfs restart You can verify the successful addition of the new path by running chkfontpath command or by listing X font server's /etc/X11/XF86Config file. If you do not have root access, copy the *.ttf to ~/.fonts directory instead. Make X11 fonts available to Java Perform one of the following: 1. Open /etc/profile and add a new environment variable JAVA_FONTS=/usr/share/fonts/truetype export JAVA_FONTS 2. Open font.properties file under jre/lib directory, uncommnent and set to the appropriate font directory appendedfontpath=/usr/share/fonts/truetype
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值