安装的方式有两种,一种是使用yum install 安装,另外一种是使用源码安装。推荐基础环境依赖包用yum安装,zabbix用源码安装。具体安装的内容看博客:http://blog.cactifans.com/。
安装基本的依赖关系及依赖包:
yum install httpd php mysql mysql-server mysql-devel php-gd gcc php-mysql php-xml libcurl-devel curl-* net-snmp* libxml2-* php-bcmath php-mbstring -y
安装包详解:
php-mysql:让php和mysql相连接
libcurl-devel curl-*:web监控
libxml2:支持虚拟机web监控
Libcurl:支持真实主机web监控
Zabbix源码安装用wget命令去官网找直接下载地址。
下载之后的是压缩包,需要先解压到相关文件夹,注意观察解压缩后的database等文件,解压命令:tar zxvf 压缩包。
解压缩完之后进入文件目录,形成配置文件,编译命令如下
装server和agent:
./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2 --with-php-gd --with-mbstring
只装代理:
./configure --prefix=/usr/local/zabbix --enable-proxy --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2
只装客户端agent:
./configure --prefix=/usr/local/zabbix --enable-agent
编译完之后,执行安装命令make进行编译,最后安装make install
接下来配置数据库,一mysql为例:
启动mysql服务: /etc/init.d/mysqld start
初始化数据库: mysql_secure_installation