本文共 3904 字,大约阅读时间需要 13 分钟。
zabbix 3.0安装
zabbix最低需要mysql 5.5 php5.3
查询mysql版本
yum list installed | grep mysql##mysql-libs.x86_64 5.1.73-5.el6_6 @anaconda-CentOS-201508042137.x86_64/6.7卸载mysql
yum remove mysql*指定mysql源
rpm -ivh安装mysql
yum install mysql-server安装vim 文本编辑器
yum install vim -y修改mysql配置
vim /etc/my.cnf[mysqld]
innodb_file_per_table启动mysql服务
service mysqld start更新配置
mysql_secure_installationEnter current password for root (enter for none):Set root password? [Y/n]
Remove anonymous users? [Y/n]
Disallow root login remotely? [Y/n]
Remove test database and access to it? [Y/n]
Reload privilege tables now? [Y/n]
登陆mysql数据库
mysql -u root -p创建zabbix的数据库
CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;授权zabbix系统访问Mysql数据库的用户和密码:GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY 'zabbix';查询数据库信息
mysql> show databases;+--------------------+Database+--------------------+information_schemamysqlperformance_schemazabbix+--------------------+4 rows in set (0.00 sec)If everything is fine then exit the database for now.exit
Zabbix 3.0 requires PHP to be at least version 5.4 or higher. Our CentOS 6.7 repositories come with PHP 5.3.3 therefore we need to install a newer one.
指定zabbix源
rpm -ivh安装php等支持库
yum install httpd php56w php56w-gd php56w-mysql php56w-bcmath php56w-mbstring php56w-xml php56w-ldap编辑php配置
vim /etc/php.inipost_max_size=16Mmax_execution_time=300max_input_time=300date.timezone=Europe/Rigaalways_populate_raw_post_data=-1启动Apache服务
service httpd start防火墙放行80端口
iptables -I INPUT -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPTiptables-save > /etc/sysconfig/iptables查询防火墙ip a创建zabbix用户
groupadd zabbixuseradd -g zabbix zabbix创建zabbix下载路径并进入
mkdir /home/zabbix/downloadscd /home/zabbix/downloads安装 wget下载工具
yum install wget -y下载zabbix3.0gz包
wget " Latest Development/3.0.0beta1/zabbix-3.0.0beta1.tar.gz"wget " Latest Development/3.0.0alpha2/zabbix-3.0.0alpha2.tar.gz"解压tar -zxvf zabbix-3.0.0beta1.tar.gz导入数据库
cd /home/zabbix/downloads/zabbix-3.0.0beta1/database/mysqlmysql -u zabbix -p zabbix < schema.sqlmysql -u zabbix -p zabbix < images.sqlmysql -u zabbix -p zabbix < data.sql安装依赖库
yum install gcc mysql-community-devel libxml2-devel unixODBC-devel net-snmp-devel libcurl-devel libssh2-devel OpenIPMI-devel openssl-devel openldap-develcd ../..
查看编译帮助./configure --helpConfigure all components required for Zabbix.编译./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 --with-unixodbc --with-ssh2 --with-openipmi --with-openssl安装zabbixmake install配置zabbix-server
vim /usr/local/etc/zabbix_server.confDBName=zabbix
DBUser=zabbixDBPassword=your_password创建服务路径
mkdir /var/www/html/zabbixcd /home/zabbix/downloads/zabbix-3.0.0beta1/frontends/php/cp -a . /var/www/html/zabbix/
创建规则,以允许我们的Web服务器来访问前端文件。
chcon -Rv --type=httpd_sys_content_t /var/www/htmlselinux未关闭赋予权限
setsebool -P httpd_can_network_connect=1setsebool -P zabbix_can_network=1Set Apache user as owner of the web interface files.赋予权限
chown -R apache:apache /var/www/html/zabbixchmod +x /var/www/html/zabbix/conf/拷贝数据
cp /home/zabbix/downloads/zabbix-3.0.0beta1/misc/init.d/fedora/core/zabbix_server /etc/init.d/zabbix_servercp /home/zabbix/downloads/zabbix-3.0.0beta1/misc/init.d/fedora/core/zabbix_agentd /etc/init.d/zabbix_agentdAdd Zabbix server and Zabbix agent as services.自启动
chkconfig --add /etc/init.d/zabbix_serverchkconfig --add /etc/init.d/zabbix_agentdchkconfig httpd onchkconfig mysqld onchkconfig zabbix_server onchkconfig zabbix_agentd on启动服务
service zabbix_server startservice zabbix_agentd start#####修改中文支持
开启中文支持
locales.inc.php'zhCN' => ['name' => ('Chinese (zh_CN)'), 'display' => true]解决中文乱码
defines.inc.php#修改第93行define('ZBX_FONT_NAME', 'msyh');#修改第45行改为define('ZBX_GRAPH_FONT_NAME', 'msyh')转载于:https://blog.51cto.com/jiafm/2300020