1、安装zabbix官方epel包
rpm -ivh
2、安装zabbix
yum install zabbix-server-mysql zabbix-web-mysql -y
3、安装MySQL并启动服务
yum install mysql mysql-devel mysql-server -y
service mysqld restart
4、安装zabbix agent
yum install zabbix-agent -y
5、创建zabbix mysql数据库
mysql -uroot -p
mysql> create database zabbix;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
mysql> flush privileges;
6、导入数据库和表
cd /usr/share/doc/zabbix-server-mysql-2.2.12/create
mysql -uroot zabbix < schema.sql //创建表结构
mysql -uroot zabbix < images.sql //导入相关图片
mysql -uroot zabbix < data.sql // 基础的初始化数据
7、编辑zabbix数据配置
vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
8、开启zabbix-server进程
/etc/zabbix/zabbix_server start //开启zabbix-server服务
9、修改php配置文件
vi /etc/httpd/conf.d/zabbix.conf
<IfModule mod_php5.c>
php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value date.timezone Asia/Shanghai //去掉注释,修改时间
</IfModule>
#########这里的date.timezone时间必须是正确的#########
10、重启http服务
/etc/init.d/httpd restart
11、关闭Selinux开启防火墙端口
setenforce 0 //临时关闭
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
iptables -I INPUT -p tco --dport 3306 -j ACCEPT
iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
iptables -I INPUT -p tcp --dport 10050:10051 -j ACCEPT
service iptables save
查看iptables
[root@localhost create]# iptables -L -n --line
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpts:10050:10051
### //zabbix端口为10050/10051 可以通过netstat -antp | grep zabbix 查看 ###
2 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:3306
3 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
4 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
5 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0
6 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
7 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
8 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain FORWARD (policy ACCEPT)
num target prot opt source destination
1 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
12、打开浏览器完成安装zabbix
//ip+zabbix
#########zabbix安装完成后默认User:admin Password:zabbix#########
13、修改配置文件,汉化zabbix
vi /usr/share/zabbix/include/locales.inc.php
function getLocales() {
return array(
'en_GB' => array('name' => _('English (en_GB)'), 'display' => true),
'en_US' => array('name' => _('English (en_US)'), 'display' => true),
'bg_BG' => array('name' => _('Bulgarian (bg_BG)'), 'display' => false),
'zh_CN' => array('name' => _('Chinese (zh_CN)'), 'display' => true), //只需将这里false改为true即可
'zh_TW' => array('name' => _('Chinese (zh_TW)'), 'display' => false),
14、到Web界面更改语言
##########zabbix的简单安装就到这里了,Yum的还是比较方便的###########