建议先看看官网安装
https://www.zabbix.com/documentation/2.4/manual/installation/install
1.下载并解压
tar -zxvf zabbix-2.4.0.tar.gz
2.创建zabbix用户
groupadd zabbix useradd -g zabbix zabbix
3.编译安装
./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 --with-openipmi --with-unixodbc --prefix=/app/zabbix
configure: error: Not found mysqlclient library #yum -y install mysql-devel
configure: error: LIBXML2 library not found #yum -y install libxml2-devel
configure: error: unixODBC library not found # yum -y install unixODBC-devel
configure: error: Invalid Net-SNMP directory - unable to find net-snmp-config #yum -y install net-snmp-devel
configure: error: Invalid OPENIPMI directory - unable to find ipmiif.h #yum -y install OpenIPMI-devel
configure: error: Curl library not found #yum -y install curl-devel
4.安装web前端
lamp环境搭建我就不多说了
cp zabbix-2.4.4/frontends/* /var/www/html ###放在其他目录的别忘了selinux,及连接时的iptables
做域名解析目录配置<---着我就来个略了
通过IP访问,此处我是做个解析,通过域名做测试的
此时一般是会报错.跟其他网站差不多,缺啥补啥.
vim /etc/php.ini 根据需求改参数
date.timezone = Asia/Shanghai #time zone
post_max_size = 16M
max_execution_time = 300
max_input_time = 300
--------------------------------------------
yum -y install php-bcmath php-mbstring php-gd php-xml
5.创建zabbix数据库
mysql
shell>mysql -uroot -pxxxxx
mysql>create database zabbix character set utf8 collate utf8_bin;
mysql>grant all on zabbix.* to zabbix@localhost identified by ‘zabbix‘;
shell>cd zabbix/data/
shell>mysql -uroot zabbix<schema.sql
shell>mysql -uroot zabbix<images.sql
shell>mysql -uroot zabbix<data.sql
oralce
sqlplus>@database/oracle/schema.sql
sqlplus>@database/oracle/images.sql
sqlplus>@database/oracle/data.sql
6.继续web前端next.注意zabbix/conf/zabbix.conf.php若有报错,手动建一个,记得把一些参数改下
<?php
// Zabbix GUI configuration file.
global $DB;
$DB[‘TYPE‘] = ‘MYSQL‘;
$DB[‘SERVER‘] = ‘localhost‘;
$DB[‘PORT‘] = ‘0‘;
$DB[‘DATABASE‘] = ‘zabbix‘;
$DB[‘USER‘] = ‘zabbix‘;
$DB[‘PASSWORD‘] = ‘zabbix‘;
// Schema name. Used for IBM DB2 and PostgreSQL.
$DB[‘SCHEMA‘] = ‘‘;
$ZBX_SERVER = ‘localhost‘;
$ZBX_SERVER_PORT = ‘10051‘;
$ZBX_SERVER_NAME = ‘zabbixtest‘;
$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
?>
7.完成登录
默认登录账号:Admin
密码:zabbix
至此完成主机端,监控端得安装agent,还有监控添加,实在感觉上图麻烦,可能不会往下写了
本文出自 “君子不器” 博客,请务必保留此出处http://cesar.blog.51cto.com/4356026/1631313
原文地址:http://cesar.blog.51cto.com/4356026/1631313