zabbix安装手册 下载本文

目录

操作系统要求 ................................................................................................................... 1 安装apache ...................................................................................................................... 1 安装php ........................................................................................................................... 1 安装mysql数据库软件 ................................................................................................... 2 安装zabbix ....................................................................................................................... 2 配置zabbix前端 .............................................................................................................. 4 Windows服务器安装zabbix agent ............................................................................... 12

操作系统要求

Zabbix server:Centos6.3

Zabbix agent:centos,redhat,windows

安装apache

上传httpd-2.2.22.tar.gz文件到linux服务器 执行tar xvf httpd-2.2.22.tar.gz进行解压 进入httpd-2.2.22目录执行./configure 进入httpd-2.2.22目录执行make

进入httpd-2.2.22目录执行执行make install apache安装在/usr/local/apache2目录下

安装php

1.执行以下命令安装php需要的包

yum -y install wget gcc-c++ ncurses ncurses-devel cmake make perl bison openssl openssl-devel gcc* libxml2 libxml2-devel curl-devel libjpeg* libpng* freetype*;

2.执行以下命令,关联yum包

cp -frp /usr/lib64/libjpeg.* /usr/lib/ ; cp -frp /usr/lib64/libpng* /usr/lib/; cp -frp /usr/lib64/libldap* /usr/lib;

ln -s /usr/lib64/mysql/libmysqlclient.so.16.0.0 /usr/lib/libmysqlclient.so;

3.编译安装php

tar xvf php-5.2.14.tar.gz; cd php-5.2.14;

./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-libxml-dir=/usr/local/lib --with-zlib-dir=/usr/local/lib --with-mysql=/usr/lib64/mysql --with-mysqli=/usr/bin/mysql_config --with-gd --enable-soap --enable-sockets --enable-xml --enable-mbstring --with-png-dir=/usr/local --with-jpeg-dir=/usr/local --with-curl=/usr/lib --with-freetype-dir=/usr/include/freetype2/freetype/ --enable-bcmath --enable-calendar --enable-zip

安装mysql数据库软件

1.直接yum install mysql*安装mysql

2.安装完成以后/etc/init.d/mysqld start 启动mysql

3.show databases 验证mysql的成功

详细出处参考:http://www.jb51.net/LINUXjishu/84221.html

安装zabbix

1.通过yum安装zabbix所需的组件(server)

yum -y install curl curl-devel net-snmp net-snmp-devel perl-DBI

3.创建用户账号(server) groupadd zabbix

useradd -g zabbix zabbix

usermod -s /sbin/nologin zabbix

4.创建zabbix数据库并导入zabbix数据库数据(server) # mysql -u root -p123456

> grant all on zabbix.* to zabbix@localhost identified by '123456'; > create database zabbix; # tar zxvf zabbix-2.0.6.tar.gz # cd zabbix-2.0.6

# mysql -uzabbix -p123456 zabbix < database/mysql/schema.sql # mysql -uzabbix -p123456 zabbix < database/mysql/images.sql # mysql -uzabbix -p123456 zabbix < database/mysql/data.sql

5.编译安装(server)

./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl # make install

6. 编译安装(agent)

tar zxvf zabbix-2.0.6.tar.gz cd zabbix-2.0.6

./configure --enable-agent make install

6.编辑配置文件(server)

Zabbix server端执行以下操作: # vi /usr/local/etc/zabbix_server.conf LogFile=/var/log/zabbix_server.log DBHost=localhost DBName=zabbix DBUser=zabbix

DBPassword=123456

7. 编辑配置文件(agent)

# vi /usr/local/etc/zabbix_agentd.conf,添加以下内容 LogFile=/var/log/zabbix_agentd.log Server=192.168.1.185(zabbix server的IP) UnsafeUserParameters=1

Hostname=192.168.1.153(客户端IP)

8.创建日志文件(server,agent) touch /var/log/zabbix_server.log

chmod 777 /var/log/zabbix_server.log touch /var/log/zabbix_agentd.log

chmod 777 /var/log/zabbix_agentd.log

9.启动zabbix server进程(server) zabbix_server

server启动端口为10051

10.启动客户端进程进程(agent) zabbix_agentd

agentd启动端口为10050