请选择 进入手机版 | 继续访问电脑版

IT运维管理,ITIL,ITSS,ITSM,ISO20000-ITIL先锋论坛

 找回密码
 微信、QQ、手机号一键注册

扫描二维码登录本站

QQ登录

只需一步,快速开始

艾拓先锋
搜索
查看: 508|回复: 0

[Zabbix专区] 怎样在CentOS 6下安装Zabbix 3.0

[复制链接]
来自- 湖南娄底

参加活动:0

组织活动:12

发表于 2017-9-3 10:55:19 | 显示全部楼层 |阅读模式 来自- 湖南娄底
概述
对于3.0官方只提供CentOS7的RPM包、Ubuntu的DEB包。对于CentOS6默认不提供RPM包,为了方便CentOS6包安装可采用以下两个项目中打好的RPM包。
环境要求
PHP >= 5.4  (CentOS6默认为5.3.3,需要更新)
curl >= 7.20 (如需支持SMTP认证,需更新)
为了支持CentOS6,特建立如下项目
https://github.com/zabbixcn/zabbix3.0-rpm.git
https://github.com/zabbixcn/curl-rpm
安装MySQL
MySQL建议使用5.6版本,CentOS6默认为5.1,不建议使用,性能偏低。
安装rpm -ivh http://dev.mysql.com/get/mysql-c ... el6-5.noarch.rpmyum install mysql-server -y  #此过程会因为网路问题偏慢,请耐心等待配置vim /etc/my.cnf  [mysqld]innodb_file_per_table启动service mysqld start设置ROOT密码mysql_secure_installation   Enter 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]创建zabbix数据库mysql -uroot -pmysql> CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;mysql> GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY 'zabbix';mysql> show databases;   +--------------------+     | Database           |     +--------------------+     | information_schema |     | mysql              |     | performance_schema |     | zabbix             |     +--------------------+安装WEB
Zabbix 3.0对PHP的要求最低为5.4,而CentOS6默认为5.3.3,完全不满足要求,故需要利用第三方源将PHP升级到5.4以上。(注意:不支持PHP7)
ssh登录您的CentOS6 x64系统,使用root用户运行以下命令
迁出RPM安装包git clone https://github.com/zabbixcn/zabbix3.0-rpm.gitcd  zabbix3.0-rpm/RPMSyum install zabbix-web-mysql-3.0.0-1.el6.noarch.rpm zabbix-web-3.0.0-1.el6.noarch.rpm升级PHP为5.6版本
安装软件源
rpm -ivh http://repo.webtatic.com/yum/el6/latest.rpm
如已安装PHP 5.3,先卸载
yum erase php php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mcrypt php-mbstring php-devel php-pecl-memcached php-pecl-memcache  php-common php-pdo php-cli php-fpm libmemcached
安装PHP 5.6
yum install httpd php56w php56w-mysql php56w-gd php56w-imap php56w-ldap php56w-odbc php56w-pear php56w-xml php56w-xmlrpc php56w-mcrypt php56w-mbstring php56w-devel php56w-pecl-memcached  php56w-common php56w-pdo php56w-cli php56w-pecl-memcache php56w-bcmath php56w-fpm
修改时区
sed -i "s@# php_value date.timezone Europe/Riga@php_value date.timezone Asia/Shanghai@g" /etc/httpd/conf.d/zabbix.conf升级CURL
安装
git clone https://github.com/zabbixcn/curl-rpmcd curl-rpm/RPMS yum install curl-7.29.0-25.el6.x86_64.rpm  libcurl-7.29.0-25.el6.x86_64.rpm  libcurl-devel-7.29.0-25.el6.x86_64.rpm
验证
curl -V          curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.16.1 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz安装Zabbix-Server安装yum  localinstall  zabbix-server-mysql-3.0.0-1.el6.x86_64.rpm初始化Zabbix数据库cd /usr/share/zabbix-server-mysql-3.0.0zcat create.sql.gz | mysql -uzabbix -pzabbix zabbix配置数据库连接信息vi /etc/zabbix/zabbix_server.confDBHost=localhostDBName=zabbixDBUser=zabbixDBPassword=zabbix启动Zabbix-Server/etc/init.d/zabbix-server restart
如果一切正常,日志会如下:
tail -n 100 /var/log/zabbix/zabbix_server.log 28554:20160217:112307.419 Starting Zabbix Server. Zabbix 3.0.0 (revision 58460). 28554:20160217:112307.419 ****** Enabled features ****** 28554:20160217:112307.419 SNMP monitoring:           YES 28554:20160217:112307.419 IPMI monitoring:           YES 28554:20160217:112307.419 Web monitoring:            YES 28554:20160217:112307.419 VMware monitoring:         YES 28554:20160217:112307.419 SMTP authentication:       YES 28554:20160217:112307.419 Jabber notifications:      YES 28554:20160217:112307.419 Ez Texting notifications:  YES 28554:20160217:112307.419 ODBC:                      YES 28554:20160217:112307.419 SSH2 support:              YES 28554:20160217:112307.419 IPv6 support:              YES 28554:20160217:112307.419 TLS support:               YES 28554:20160217:112307.419 ****************************** 28554:20160217:112307.419 using configuration file: /etc/zabbix/zabbix_server.conf 28554:20160217:112307.428 current database version (mandatory/optional): 03000000/03000000 28554:20160217:112307.428 required mandatory version: 03000000 28554:20160217:112307.436 server #0 started [main process] 28556:20160217:112307.436 server #1 started [configuration syncer #1]配置WEB启动Apache/etc/init.d/httpd start访问zabbix web
浏览器访问http://${IP}/zabbix,进行配置即可,此处不再详解!
默认用户名/密码:Admin/zabbix(区分大小写)
1.png
安装客户端yum install zabbix-agent-3.0.0-1.el6.x86_64.rpm zabbix-sender-3.0.0-1.el6.x86_64.rpm zabbix-get-3.0.0-1.el6.x86_64.rpm其它
如果您是CentOS7或Ubuntu,请参考官方文档直接安装
https://www.zabbix.com/documentation/3.0/manual/installation/install_from_packages
参考
http://itnihao.blog.51cto.com/1741976/1742701
原创:Mike




本版积分规则

选择云运维时代的王牌讲师-长河老师,助你轻松入门ITIL Foundation培训课程

QQ|小黑屋|手机版|Archiver|艾拓先锋网 ( 粤ICP备11099876号-1|网站地图

Baidu

GMT+8, 2018-10-16 14:35 , Processed in 0.270680 second(s), 31 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表