Zabbix server 安装配置文档
环境准备
Zabbix Server需要运行在CentOS、RedHat Linux、Debain等Linux系统上,这里以CentOS6作为部署环境,Root用户安装必须的包,建议配置好yum,通过yum安装下列包,解决包的依赖关系。
1) LAMP(Linux+ Apache + Mysql + PHP)环境
yum installmysql-server httpd php
2) 安装依赖包
yum installmysql-devel net-snmp-devel OpenIPMI-devel openssl-develfping-devel libcurl-develperl-DBI php-gd php-mysql php-bcmath php-mbstring php-xml gcc
3) 可以到官网下载最新安装包
http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.3/zabbix-2.2.3.tar.gz
或者采用yum安装
http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/红帽yum源
安装步骤
1)创建zabbix用户和组
groupadd zabbix
useradd zabbix-g zabbix
2)创建数据库,添加授权账号
create databasezabbix character set utf8;
grant allprivileges on zabbix.* to zabbix@localhost identified by ‘zabbix‘;
3) 编译安装zabbix
tar xzf zabbix-2.2.3.tar.gz
cd zabbix-2.2.3
./configure --prefix=/usr/local/zabbix --enable-server --enable-agent \
--with-mysql --with-net-snmp --with-libcurl
make install
4)导入数据库
mysql -uzabbix-pzabbix -hlocalhost zabbix < database/mysql/schema.sql
mysql -uzabbix-pzabbix -hlocalhost zabbix < database/mysql/images.sql
mysql -uzabbix -pzabbix-hlocalhost zabbix < database/mysql/data.sql
5)修改配置文件
cpmisc/init.d/fedora/core/zabbix_server /etc/init.d/
cpmisc/init.d/fedora/core/zabbix_agentd /etc/init.d/
cp -Rfrontends/php /var/www/html/zabbix
sed -i‘s/^DBUser=.*$/DBUser=zabbix/g‘ /usr/local/zabbix/etc/zabbix_server.conf
sed -i‘s/^.*DBPassword=.*$/DBPassword=zabbix/g‘/usr/local/zabbix/etc/zabbix_server.conf
sed -i‘s/BASEDIR=\/usr\/local/BASEDIR=\/usr\/local\/zabbix/g‘/etc/init.d/zabbix_server
sed -i‘s/BASEDIR=\/usr\/local/BASEDIR=\/usr\/local\/zabbix/g‘/etc/init.d/zabbix_agentd
6)添加服务端口
cat>>/etc/services <<EOF
zabbix-agent10050/tcp Zabbix Agent
zabbix-agent10050/udp Zabbix Agent
zabbix-trapper10051/tcp Zabbix Trapper
zabbix-trapper10051/udp Zabbix Trapper
EOF
7)启动服务并开机启动
/etc/init.d/zabbix_serverstart
/etc/init.d/zabbix_agentdstart
echo"/etc/init.d/zabbix_server start" >> /etc/rc.local
echo"/etc/init.d/zabbix_agentd start" >> /etc/rc.local
8)修改php.ini
Vi /etc/php.ini
memory_limit = 256M
date.timezone = Asia/Shanghai
post_max_size = 32M
max_execution_time = 600
upload_max_filesize = 16M
max_input_time = 600
9)web页面安装配置,打开浏览器输入http://zabbixserver ip地址/zabbix
确认每个Required都是ok的才会显示Next按钮,如果有Fail的需要完善系统要求
更换中文字体,登陆后在页面的右上边点击“Prefile”
在Language选项中选择“Chinese(zh_CN)”,然后Save
本文出自 “常用文档” 博客,请务必保留此出处http://yujianglei.blog.51cto.com/7215578/1561575
原文地址:http://yujianglei.blog.51cto.com/7215578/1561575