ubuntu安装zabbix 3.2(转)

转自:http://www.zabbix.org.cn/viewtopic.php?f=13&t=1096
本人略作了写修改。

准备工做
apt-get updatephp

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

代码: 全选
wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+trusty_all.debhtml

dpkg -i zabbix-release_3.2-1+trusty_all.debnode


apt-get update
apt-get install zabbix-server-mysql zabbix-frontend-php# 装服务器端
apt-get install zabbix-agent


2、设置数据库表(假设你设置的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

3、编辑zabbix的设置文件

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

4、编辑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!

5、优化设置

一、启用中文
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两个服务一下,应该能够选了。。

二、可是我发现翻译的很差,有大神作了更好的翻译
参见: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

三、看图时候,若是有中文,会乱码
调整图像里的中文乱码
下载雅黑 
代码: 全选
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服务便可

四、重要的mibs库,必须更新,不然snmp监控交换机时,mib会报错。
apt-get install snmp-mibs-downloader
6、一些提示 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/htmlmysql

 

 

 

碰见的问题:linux

一、Ubuntu 环境,当apache2重启提示:git

* Starting web server apache2   
apache2: Could not reliably determine the server's fully qualified domain name, 
... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerNamegithub

 

解决的问题是:web

sudo vim /etc/apache2/sites-available/defaultsql

打开default文件后,在default文件顶端加入:shell

ServerName 127.0.0.1

重启apache2 就不会提示上述错误了。

vim /etc/hosts
添加 127.0.0.1 hostname

 

/etc/apache2/apache2.conf

在文件后面加上:
#Server Name
ServerName 127.0.0.1

 

 

补充:

Zabbix客户端的安装及配置
apt-get update

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

代码: 全选
wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+trusty_all.deb

dpkg -i zabbix-release_3.2-1+trusty_all.deb


apt-get update
apt-get install zabbix-agent

配置:

一、  vim /etc/zabbix/zabbix_agentd.conf

Server=192.168.0.251

ServerActive=192.168.0.251

#ListenPort=10050

StartAgents=0

Hostname=node-31

修改后保存便可。

Server:被动模式server的ip地址

ServerActive:主动模式

相关文章
相关标签/搜索