#系统版本
Ubuntu 14.04.1
#添加zabbix源
~$ cat /etc/apt/sources.list
# Zabbix Application PPA
deb http://ppa.launchpad.net/tbfr/zabbix/ubuntu precise main
deb-src http://ppa.launchpad.net/tbfr/zabbix/ubuntu precise main
#导入秘钥
~$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C407E17D5F76A32B
#更新源并安装包
~$ sudo apt-get update
~$ sudo apt-get install zabbix-server-mysql php5-mysql zabbix-frontend-php
#数据库操作
mysql> create user 'zabbix'@'localhost' identified by 'pwd';
mysql> create database zabbix;
mysql> grant all privileges on zabbix.* to 'zabbix'@'localhost';
mysql> flush privileges;
#导入数据库文件
$ cd /usr/share/zabbix-server-mysql/
$ sudo gunzip *.gz
$ mysql -uzabbix -ppwd zabbix < schema.sql
$ mysql -uzabbix -ppwd zabbix < p_w_picpaths.sql
$ mysql -uzabbix -ppwd zabbix < data.sql
#编辑zabbix配置文件
~$ sudo vim /etc/zabbix/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=pwd
#编辑php配置文件
$ sudo vim /etc/php5/apache2/php.ini
post_max_size = 16M
max_execution_time = 300
max_input_time = 300
date.timezone = "Asia/Shanghai"
#拷贝配置文件模板
$ sudo cp /usr/share/doc/zabbix-frontend-php/examples/zabbix.conf.php.example /etc/zabbix/zabbix.conf.php
$ sudo vim /etc/zabbix/zabbix.conf.php
$DB["DATABASE"] = 'zabbix';
$DB["USER"] = 'zabbix';
$DB["PASSWORD"] = 'pwd';
$ sudo cp /usr/share/doc/zabbix-frontend-php/examples/apache.conf /etc/apache2/conf-available/zabbix.conf
$ sudo a2enconf zabbix.conf
$ sudo a2enmod alias
$ sudo /etc/init.d/apache2 restart
$ sudo vim /etc/default/zabbix-server
START=yes
#启动服务
$ sudo /etc/init.d/zabbix-server start
#安装zabbix agent
$ sudo apt-get install zabbix-agent
#修改agent配置
$ sudo vim /etc/zabbix/zabbix_agentd.conf
Server=127.0.0.1 #zabbix server的IP
#启动agent
$ sudo /etc/init.d/zabbix-agent restart
#用浏览器访问http://zabbix-server-ip/zabbix
用户名: admin
密 码: zabbix
登陆后就可以开始使用了:D
转载于:https://blog.51cto.com/cheney1228/1617981