xin1986xin 发表于 2016-5-9 11:06:58

zabbix-服务器端( zabbix-1.8.22-1.el6.x86_64)

安装前准备:

1.1 安装依赖包:
yum -y install wget net-snmp-devel OpenIPMI-devel httpd openssl-devel java lrzsz fping-devel libcurl-devel perl-DBI pcre-devel libxml2 libxml2-devel mysql-devel gcc php php-bcmath php-gd php-xml php-mbstring php-ldap php-mysql.x86_64 php-pear php-xmlrpc

1.2 关闭防火墙:
#chkconfig iptables off
#/etc/init.d/iptables stop
#chkconfig ip6tables off
#/etc/init.d/ip6tables stop

需要关闭 selinux,一定要关闭这个,开启selinux会引起一连串问题,甚至zabbix的discovery功能也不能正常使用
# sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
确认是否修改成功
# grep SELINUX /etc/selinux/config
然后重启系统即可
# reboot


# wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-6.repo
yum install -y epel-release
安装扩展YUM源
# yum install -yhttpd mysql mysql-libs php php-mysql mysql-server php-bcmath php-gd php-mbstring
安装rpm包的lamp环境
# yum install -yzabbix20 zabbix20-agent zabbix20-serverzabbix20-server-mysql zabbix20-web zabbix20-web-mysql net-snmp-devel
安装zabbix服务端
# /etc/init.d/zabbix-server start
Starting Zabbix server:                                    [确定]
#/etc/init.d/zabbix-agent start
Starting Zabbix agent:                                     [确定]
启动服务
# netstat -lnp(tuln)
tcp      0      0 0.0.0.0:10050   0.0.0.0:*                   LISTEN      1817/zabbix_agentd
tcp      0      0 :::10050                  :::*                        LISTEN      1817/zabbix_agentd
# less /var/log/zabbix/zabbix_server.log
1804:20160422:033154.767 connection to database 'zabbix' failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
1804:20160422:033154.768 Database is down. Reconnecting in 10 seconds.
zabbix-server没有启动起来,因为MySQL没有启动
# /etc/init.d/mysqld start
# yum install -y vim-enhanced
# vim /etc/my.cnf
character_set_server = utf8
添加
# mysql -uroot-e"create database zabbix"
创建数据库zabbix
# mysql -uroot--default-character-set=utf8 zabbix < /usr/share/zabbix-mysql/schema.sql
# mysql -uroot--default-character-set=utf8 zabbix < /usr/share/zabbix-mysql/images.sql
# mysql -uroot--default-character-set=utf8zabbix < /usr/share/zabbix-mysql/data.sql
把数据导入数据库zabbix
# mysql -uroot-e "grant all on *.* to 'zabbix'@'localhost' identified by 'zabbix';"
数据库创建zabbix用户
# vim /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
# /etc/init.d/zabbix-server start                                                                Starting Zabbix server:                                    [确定]
# netstat -lnp |grep zabbix
tcp      0      0 0.0.0.0:10050               0.0.0.0:*                   LISTEN      1457/zabbix_agentd
tcp      0      0 0.0.0.0:10051               0.0.0.0:*                   LISTEN      1738/zabbix_server
tcp      0      0 :::10050                  :::*                        LISTEN      1457/zabbix_agentd
tcp      0      0 :::10051                  :::*                        LISTEN      1738/zabbix_server
# /etc/init.d/httpd restart         

2.网页安装zabbix
这时会遇到“zabbix server is not running”这样的错误,需要编辑一下 /etc/zabbix/zabbix_server.conf ,配置DBUser, DBPassword                     

http://IP/zabbix/访问安装,默认会有“It is not safe to rely on the system‘s timezone settings ”这样的警告信息(时区问题),需要vim /etc/php.ini
# vim /etc/php.ini
946 date.timezone ='Asia/Chongqing'
# /etc/init.d/httpd restart
点“next”
解决相关的报错信息,(vim /etc/php.ini)
# vim /etc/php.ini
修改:
post_max_size = 8M
为:
post_max_size = 16M
修改
max_execution_time = 30

max_execution_time = 300
修改
max_input_time = 60

max_input_time = 300
# /etc/init.d/httpd restart
点“retry”
输入mysql相关信息, user"zabbix"password " zabbix"其他默认测试ok
点击“ next”
以下全部默认“next”最后点finish
默认管理员账号为 admin:zabbix


页: [1]
查看完整版本: zabbix-服务器端( zabbix-1.8.22-1.el6.x86_64)