Zabbix安装指南

1、建立数据库并导入脚本

create database zabbix character set utf8;

grant all on zabbix.* to zabbix@localhost identified by 'zabbix';

mysql -uroot -p zabbix < database/mysql/mysql.sql

mysql -uroot -p zabbix < database/mysql/data.sql

mysql -uroot -p zabbix < database/mysql/images_mysql.sql


2、安装net-snmp

tar xzvf net-snmp-5.7.1.tar.gz

cd net-snmp-5.7.1

./configure

make

make install


3、安装Zabbix

tar xzvf zabbix-2.0.2.tar.gz

cd zabbix-2.0.2

./configure --enable-server --enable-proxy --enable-agent --with-mysql=/usr/local/mysql/bin/mysql_config --with-net-snmp --with-libcurl

make && make install


vi /etc/services

zabbix-agent 10050/tcp Zabbix Agent

zabbix-agent 10050/udp Zabbix Agent

zabbix-trapper 10051/tcp Zabbix Trapper

zabbix-trapper 10051/udp Zabbix Trapper


vi /usr/local/etc/zabbix_server.conf

DBUser=zabbix

DBPassword=zabbix


vi /usr/local/etc/zabbix_proxy.conf

DBUser=zabbix

DBPassword=zabbix


echo /usr/local/mysql/lib/mysql/ >> /etc/ld.so.conf

echo /usr/local/lib/ >> /etc/ld.so.conf

ldconfig


zabbix_server

zabbix_agentd

zabbix_proxy


4、安装apr

tar xzvf apr-1.4.6.tar.gz

cd apr-1.4.6

./configure

make & make install


5、安装apr-util

tar xzvf apr-util-1.4.1.tar.gz

cd apr-util-1.4.1

./configure --with-apr=/usr/local/apr/

make & make install


6、安装 pcre

tar xzvf pcre-8.21.tar.gz

cd pcre-8.21

./configure

make & make install


7、安装apache

tar xzvf httpd-2.4.3.tar.gz

cd httpd-2.4.3

./configure --enable-module=so --enable-mods-shared=most

make & make install


8、安装freetype

tar xzvf freetype-2.4.10.tar.gz

cd freetype-2.4.10

./configure

make & make install


9、安装jpeg

tar xzvf jpegsrc.v8d.tar.gz

cd jpeg-8d

./configure --enable-shared

make

make test

make install


10、安装gd

tar xzvf pierrejoye-gd-libgd-733361a31aab.tar.gz

cd pierrejoye-gd-libgd-733361a31aab

./configure --with-png --with-freetype --with-jpeg

make install


11、安装PHP

tar xzvf php-5.4.6.tar.gz

cd php-5.4.6

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-fpm --enable-sockets --enable-pdo --with-pdo-mysql=/usr/local/mysql --with-gd --with-gettext --enable-bcmath --enable-xml --enable-mbstring --with-apxs2=/usr/local/apache2/bin/apxs --with-freetype-dir=/usr/include/freetype2/freetype --with-jpeg-dir=/usr/local/include

make

make install


12、安装zabbix管理端

mkdir /usr/local/apache2/htdocs/zabbix

cd frontends/php

cp -a . /usr/local/apache2/htdocs/zabbix


13、启动apache

/usr/local/apache2/bin/apachectl stop

/usr/local/apache2/bin/apachectl start


14、登录管理端

http://10.10.10.18/zabbix/

用户名:Admin 密码:zabbix


15、安装客户端agent

cd /usr/local

tar xzvf zabbix_agents_2.0.0.linux2_6.i386.tar.gz

vi /etc/services

zabbix_agent    10050/tcp

zabbix_trap     10051/tcp


mkdir /etc/zabbix

把服务器下的/etc/zabbix/zabbix_agentd.conf传到agentd客户端的/etc/zabbix下


vi /etc/zabbix/zabbix_agentd.conf

LogFile=/tmp/zabbix_agentd.log

Server=10.10.10.18

Hostname=Zabbix 18.120


/usr/local/sbin/zabbix_agentd

netstat -ntpl |grep zab


你可能感兴趣的:(监控,zabbix)