Zabbix 3.0 for Ubuntu 14.04 LTS 安装



准备工作

apt-get install gettext
apt-get install unzip
apt-get install rar
一、安装主程序

代码: 全选
wget http://repo.zabbix.com/zabbix/3.0/ubunt ... ty_all.deb

dpkg -i zabbix-release_3.0-1+trusty_all.deb
apt-get update
apt-get install zabbix-server-mysql zabbix-frontend-php# 装服务器端
apt-get install zabbix-agent


二、设置数据库表(假设你设置的mysql的root密码是123456)

shell> mysql -uroot -p123456
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all on zabbix.* to zabbix@localhost identified by 'zabbix';
mysql> quit;
shell> cd /usr/share/doc/zabbix-server-mysql
shell> zcat create.sql.gz | mysql -uroot -p123456 zabbix

三、编辑zabbix的设置文件

# vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix

四、编辑conf文件,准备安装

vi /etc/apache2/conf-enabled/zabbix.conf
编辑时区
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 always_populate_raw_post_data -1
# php_value date.timezone Europe/Riga

最后一行,去掉#号,时区改成 Asia/Shanghai

开始安装
先重启服务
service zabbix-server start
service apache2 restart

然后浏览器登录:

http://yourhost/zabbix

数据库帐号是zabbix,密码是你设置的密码:zabbix
一路安装。。。web登录帐号是Admin/zabbix,基本ok!

五、优化设置

1、启用中文
vi /usr/share/zabbix/include/locales.inc.php
把zh_CN后面参数写true

然后去选择语言吧。

如果,去选择语言的时候,你发现还是不能选择。。。。
提示:
You are not able to choose some of the languages, because locales for them are not installed on the web server.
是因为你系统里没中文环境
那么:设置中文环境
第一步,安装中文包:
apt-get install language-pack-zh-hant language-pack-zh-hans
第二步,配置相关环境变量:
vi /etc/environment
在文件中增加语言和编码的设置:
LANG="zh_CN.UTF-8"
LANGUAGE="zh_CN:zh:en_US:en"
第三步,重新设置本地配置:
dpkg-reconfigure locales

现在重启apache&zabbix_server两个服务一下,应该可以选了。。

2、但是我发现翻译的不好,有大神做了更好的翻译
参见:https://github.com/echohn/zabbix-zh_CN
先进入
cd /usr/share/zabbix/locale/zh_CN/LC_MESSAGES目录
代码: 全选
wget https://github.com/echohn/zabbix-zh_CN/ ... master.zip

unzip master.zip
rm frontend.mo
cp zabbix-zh_CN-master/frontend.mo frontend.mo

现在重启apache&zabbix_server两个服务
service zabbix-server restart
service apache2 restart

3、看图时候,如果有中文,会乱码
调整图像里的中文乱码
下载雅黑
代码: 全选
wget http://dx.sc.chinaz.com/Files/DownLoad/font2/dd.rar

解压缩文件
rar x dd.rar
cp dd/msyh.ttf msyh.ttf
然后修改 vi /usr/share/zabbix/include/defines.inc.php
找到
define('ZBX_GRAPH_FONT_NAME', 'graphfont'); // font file name
修改成:
define('ZBX_GRAPH_FONT_NAME', 'msyh'); // font file name

重启apache服务即可

4、重要的mibs库,必须更新,否则snmp监控交换机时,mib会报错。
apt-get install snmp-mibs-downloader
六、一些提示 tips

重新启动zabbix-server服务进程
# service zabbix-server restart
重新启动zabbix-agent进程
# service zabbix-server restart
重启apache进程
#service apache2 restart

重要目录:
log: /var/log/zabbix/zabbix_server/log和agent.log 排查错误必须
conf:/etc/zabbix/*.conf
安装目录:/usr/share/zabbix 重要的include,font .etc
根web目录在var/www/html

posted on 2016-07-27 22:55  DavidZang  阅读(3192)  评论(0编辑  收藏  举报