安装所需要的包

sudo apt-get install apache2 mysql-server libapache2-mod-php5 php5-gd php5-mysql php5-common zabbix-server-mysql zabbix-frontend-php
期间会问你MySQL的密码,填上即可

配置数据库连接

sudo vim /etc/zabbix/zabbix_server.conf

1
2
3
4
5
6
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
#非必需,但推荐
StartDiscoverers=5

创建MySQL的zabbix用户

1
2
3
4
5
6
mysql -u root -p
create user 'zabbix'@'localhost' identified by 'zabbix';
create database zabbix;
grant all privileges on zabbix.* to 'zabbix'@'localhost';
flush privileges;
exit

导入所需的表

1
2
3
4
5
cd /usr/share/zabbix-server-mysql/
sudo gunzip *.gz
mysql -u zabbix -p zabbix < schema.sql
mysql -u zabbix -p zabbix < images.sql
mysql -u zabbix -p zabbix < data.sql

修改php.ini参数

sudo vim /etc/php5/apache2/php.ini

1
2
3
4
post_max_size = 16M
max_execution_time = 300
max_input_time = 300
date.timezone = "Asia/Shanghai"

配置前端php文件

先复制一份
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

1
2
3
$DB['DATABASE'] = 'zabbix';
$DB['USER'] = 'zabbix';
$DB['PASSWORD'] = 'zabbix'

配置apache

1
2
3
4
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 service apache2 restart

启动Zabbix Server

sudo vim /etc/default/zabbix-server
修改项:
START=yes
启动:
sudo service zabbix-server start

安装Agent并启动

1
2
sudo apt-get install zabbix-agent
sudo service zabbix-agent restart

访问
http://ip/zabbix
缺省的账户:
Username = admin
Password = zabbix

如果你是CGI控制PHP

1
2
3
4
5
php_value[memory_limit] = 96M
php_value[max_execution_time] = 120
php_value[max_input_time] = 300
php_value[php_post_max_size] = 25M
php_value[upload_max_filesize] = 25M

zabbix2.png
zabbix3.PNG
ZABBIX .png
参考
http://wiki.ubuntu.org.cn/Zabbix