您的位置:首页 > 其它

安装zabbix3.0中文版

2016-03-14 08:34 399 查看
系统要求,centos7,最小化安装,其他版本没有试过,请见谅

下载使用rpm并安装zabbix安装包:

# rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
安装相关插件及数据库,有些插件因该没用,大家可以自行研究。

# yum install zabbix-server-mysql zabbix-web-mysql php php-gd php-mysql php-bcmath php-mbstring php-xml curl curl-devel net-snmp gcc net-snmp-devel perl-DBI
# yum install httpd mariadb*
数据库配置#systemctl start mariadb.service# mysql -u root -p
Enter password: ##输入MySQL密码,默认为空
MariaDB [(none)]> create database zabbix character set utf8; ##创建数据库zabbix,并且数据库编码使用utf8
MariaDB [(none)]> insert into mysql.user(Host,User,Password) >values('localhost','zabbix',password('zabbix')); ##新建账户zabbix,密码zabbix(可以随意改成自己或更复杂的。
MariaDB [(none)]> flush privileges; ##刷新系统授权
MariaDB [(none)]> grant all on zabbix.* to 'zabbix'@'localhost' identified by 'zabbix'; ##允许账户能从本机连接至数据库zabbix,红色的地方有些教程写的是127.0.0.1,那么后面的相关配置配置就都要写127.0.0.1,否则你会发现zabbix没有数据。
MariaDB [(none)]> flush privileges;
导入数据库
# cd /usr/share/doc/zabbix-server-mysql-3.0.1

zcat create.sql.gz | mysql -uroot zabbix
修改数据库root密码为root_passwd(导入完数据库文件,把root密码改成自己的
mysqladmin -u root password root_passwd

修改配置文件
# vi /etc/zabbix/zabbix_server.conf
81:DBHost=localhost ##数据库主机
91:DBName=zabbix ##数据库名
107:DBUser=zabbix ##数据库用户名
115:DBPassword=zabbix ##数据库密码
305:ListenIP=127.0.0.1 ##数据库IP地址
启动zabbix_server服务
# systemctl start zabbix-server
修改http配置文件
# vi /etc/httpd/conf.d/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 Asia/shanghai
启动httpd服务
# systemctl start httpd
修改配置文件需要重启机器:# vi /etc/selinux/config 将SELINUX=enforcing 改为SELINUX=disabled
需重启机器后启动数据库、zabbix-server及htttpd
systemctl start mariadb.service
systemctl start zabbix-server
systemctl start httpd
打开http://ip/zabbix
一路next就好了
添加中文
vi /usr/share/zabbix/include/locales.inc.php
把 'zh_CN' => ['name' => _('Chinese (zh_CN)'), 'display' => false],的false改成true
由于是小白,不会把这三个服务做成自启动,于是在/home下vi编辑了一个qidong.sh的文件写入以下内容:

#!/bin/sh
systemctl start mariadb.service
systemctl start zabbix-server
systemctl start httpd
保存并并在/home目录下执行
chmod u+x qidong.sh
做到开机自启动
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  zabbix