ubuntu16.04下安装部署zabbix3.0

前端之家收集整理的这篇文章主要介绍了ubuntu16.04下安装部署zabbix3.0前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

查看系统版本:lab_release -a

一、 配置zabbix软件下载源

# wgethttp://repo.zabbix.com/zabbix/3.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.0-1+trusty_all.deb

# dpkg-izabbix-release_3.0-1+trusty_all.deb

# apt-getupdate

二、 安装Server端

需要安装如下组件:

apache2PHP5PHP5-gdlibapache2-mod-PHP5zabbix-server-MysqLPHP5-MysqLzabbix-frontend-PHP

注意:在ubuntu16.04中的apt-get源不能正常下载安装zabbix-server-MysqLPHP5等等,所以要更换源问的内容

1、首先到/etc/apt/目录对原来的source.list进行备份

# cpsource.listsource.list_16.04

2、然后把15.10的source.list的内容

deb http://us.archive.ubuntu.com/ubuntu/ wily main restricted deb-src http://us.archive.ubuntu.com/ubuntu/ wily main restricted deb http://us.archive.ubuntu.com/ubuntu/ wily-updates main restricted deb-src http://us.archive.ubuntu.com/ubuntu/ wily-updates main restricted deb http://us.archive.ubuntu.com/ubuntu/ wily universe deb-src http://us.archive.ubuntu.com/ubuntu/ wily universe deb http://us.archive.ubuntu.com/ubuntu/ wily-updates universe deb-src http://us.archive.ubuntu.com/ubuntu/ wily-updates universe deb http://us.archive.ubuntu.com/ubuntu/ wily multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ wily multiverse deb http://us.archive.ubuntu.com/ubuntu/ wily-updates multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ wily-updates multiverse deb http://us.archive.ubuntu.com/ubuntu/ wily-backports main restricted universe multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ wily-backports main restricted universe multiverse deb http://security.ubuntu.com/ubuntu wily-security main restricted deb-src http://security.ubuntu.com/ubuntu wily-security main restricted deb http://security.ubuntu.com/ubuntu wily-security universe deb-src http://security.ubuntu.com/ubuntu wily-security universe deb http://security.ubuntu.com/ubuntu wily-security multiverse deb-src http://security.ubuntu.com/ubuntu wily-security multiverse

覆盖原来的source.list的内容

3、清理一下apt缓存信息

# apt-get clean

# apt-get upgrade

# apt-get update

4、apt-get install apache2 PHP5 PHP5-gd libapache2-mod-PHP5 zabbix-server-MysqL PHP5-MysqL zabbix-frontend-PHP

如果zabbix-frontend-PHP无法下载的话可以切换16.04source.list进行下载安装


三、 配置Server

# vim /etc/zabbix/zabbix_server.conf

DBHost=localhost

DBName=zabbix

DBUser=zabbix

DBPassword=zabbix

StartTrappers=200

CacheSize=512M

四、设置MysqL

# MysqL -u root -p

(安装MysqL时我把root账号的密码设置为zabbix)

Enter passworld:zabbix

MysqL>create database zabbix character set utf8 collate utf8_bin;

MysqL>grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';

MysqL>flush privileges;

MysqL>set GLOBAL max_connections=1000;

MysqL>show variables like '%max_connections%';

MysqL> quit;

#cd /usr/share/doc/zabbix-server-MysqL

#zcat create.sql.gz | MysqL -u root -p zabbix #导入初始模式和数据。系统将提示您输入新创建的密码。

#cp -r /usr/share/zabbix /var/www/html/zabbix

#service zabbix-server restart

五、服务器容器配置

1、PHP

# vim /etc/PHP5/apache2/PHP.ini修改项:

post_max_size = 16M

max_execution_time = 300

max_input_time = 300

date.timezone = "Asia/Shanghai"

extension_dir = "/usr/lib/PHP5/20131226/"(gd.so被apt在到/usr/lib/PHP5/20131226下)

extension=gd.so #最后这两项可以不用修改,则为默认

修改完成后重启apache2

#service apache2 start

2、按照网页指引配置

用浏览器打开http://10.92.21.160/zabbix,通过网站方式对zabbixserver进行配置初始化检查



直接按照网页端配置执行。

用户名密码:Admin/zabbix

六、安装客户端

#apt-get install zabbix-agent

安装客户端后,若不是服务器本机,修改zabbix配置文件/etc/zabbix/zabbix_agentd.conf的数据

# vim /etc/zabbix/zabbix_agentd.conf

修改ServerAcive的IP,地址为服务端地址

ServerActive=10.92.21.160

设置为0 仅为主动模式,如果需要发送数据等 可以不修改此项

StartAgents=0

Hostname修改为网页里面添加的Hostname,需要保持一致

Hostname=Zabbix server

###Server= 被动模式,允许哪台服务器连接agent

###ServerAcitve 主动模式,想哪台服务器传递数据

七、添加host进行监控

Configuration-->Hosts-->选择默认的Zabbixserver,进入详细页面然后fullclone,调整一下配置信息

如果出现时间不对应的情况下需要设置下服务器的时区

#dpkg-reconfigure tzdata

选择Asia -> 再选择Shanghai -> OK

#date -s "02 OCT 2016 17:07:00"

原文链接:https://www.f2er.com/ubuntu/354678.html

猜你在找的Ubuntu相关文章