Centos系统下载大全 | Redhat系统下载大全 | Windows2012系统下载大全 | Windows2008系统下载大全| CMS教程 | 网站地图 51运维网-专注Linux/Unix系统安全运维!
当前位置:51运维网 > 监控 > Linux监控 > 正文

zabbix安装配置

时间:2013-10-12 10:13 来源:未知 作者:51ou.com 阅读:

Zabbix安装配置

 

目录

Zabbix安装配置... 1

Lamp环境搭建... 1

Apache. 1

Mysql2

Php. 2

配置apache. 2

Zabbix安装... 3

建用户用户组... 3

配置mysql3

Zabbix. 3

配置php. 4

客户端... 5

验证通信... 5

 

 

Lamp环境搭建

Apache

httpd-2.2.22.tar.gz

./configure--prefix=/home/zabbix/apache --with-apxs2=/usr/local/apache2/bin/apxs--disable-debug --enable-ftp--enable-inline-optimization --enable-magic-quotes --enable-mbstring--enable-mm=shared --enable-safe-mode --enable-track-vars --enable-trans-sid--enable-wddx=shared --enable-xml --with-dom --with-gd --with-gettext--with-mysql=/usr/local/mysql5-1/

Make && makeinstall

Mysql

mysql-5.1.63.tar.gz

./configure--prefix=/home/zabbix/mysql --enable-assembler -with-mysqld-ldflags=-all-static--with-pthread --enable-static --with-big-tables --without-ndb-debug --with-charset=utf8--with-extra-charsets=all --with-innodb--with-unix-socket-path=/tmp/mysql5.sock

make && makeinstall

cd /usr/local/mysql

./bin/mysql_install_db

Cd /usr/local

chown -R root.mysql mysql

cd /usr/local/mysql

chown -R mysql.mysql var/

cpshare/mysql/my-medium.cnf my.cnf

cp share/mysql/mysql.servermysqlctl

修改mysql的root密码什么的,略了

Php

php-5.3.5.tar.gz

./configure--prefix=/home/zabbix/php --with-apxs2=/home/zabbix/apache/bin/apxs--with-mysql=/home/zabbix/mysql/ --with-mysqli=/home/zabbix/mysql/bin/mysql_config--enable-thread-safe-client --enable-mbstring --with-zlib --enable-zip --with-gd --enable-bcmath --enable-xml--enable-sockets --enable-mbstring --with-gettext --with-jpeg-dir--with-freetype-dir

Make && makeinstall

配置apache

Listen 8127

*在DirectoryIndex处添加 index.php

*在AddTypeapplication处添加

AddTypeapplication/x-httpd-php .php .phtml

AddTypeapplicatoin/x-httpd-php-source .phps

写个phpinfo页面

<?php

phpinfo();

?>

http://192.168.1.3:8127/访问下试试

ok,lamp结束

Zabbix安装

zabbix-2.0.2.tar.gz

建用户用户组

[root@jiaofu-02 htdocs]#groupadd zabbix

[root@jiaofu-02 htdocs]#useradd zabbix -g zabbix

配置mysql

./bin/mysql--default-character-set=utf8

mysql> create databasezabbix character set utf8;

mysql> grant all onzabbix.* to zabbix@'%' identified by 'zabbix';

mysql> use zabbix;

mysql> source/home/zabbix/src/zabbix-2.0.2/database/mysql/schema.sql

mysql>source/home/zabbix/src/zabbix-2.0.2/database/mysql/images.sql

mysql> source /home/zabbix/src/zabbix-2.0.2/database/mysql/data.sql

 

use zabbix

select alias,passwdfrom users;这就是登陆的用户名和密码哦

初次登陆用户名密码为:adminzabbix

Zabbix

./configure--prefix=/usr/local/zabbix --enable-server --enable-agent --enable-proxy--with-mysql --enable-ipv6 --with-libcurl --with-net-snmp

Make install

我遇到一个错误configure:error: Invalid NET-SNMP directory - unable to find net-snmp-config

于是:yum installnet-snmp*

听说有人会遇到

checking for the version of libcurl... 7.12.1

checking for libcurl >= version 7.13.1... no

configure: error: Curl library not found

说明你curl的版本太低

配置参数说明:

--enable-server 安装 Zabbix Server --enable-proxy 安装 Zabbix Proxy --enable-agent 安装 Zabbix Agent --with-mysql 使用 mysql 做数据库服务器[mysql配置路径根据自己的情况来修改] --with-net-snmp 支持 SNMP --with-libcurl 支持 curl,用于 web 监控

 

 

cd zabbix-2.0.2

cpmisc/init.d/fedora/core5/zabbix_* /etc/init.d/

vim/etc/init.d/zabbix_server

ZABBIX_BIN="/home/zabbix/zabbix-2.0.2/sbin/zabbix_server"

vim/home/zabbix/zabbix-2.0.2/etc/zabbix_server.conf

LogFile=/tmp/zabbix_server.log

DBHost=localhost

DBName=zabbix

DBUser=zabbix

DBPassword=zabbix

DBSocket=/tmp/mysql5_zabbix.sock

DBPort=3306

cp -a/home/zabbix/src/zabbix-2.0.2/frontends/php/* /home/zabbix/apache/htdocs/zabbix

改属主

chkconfig zabbix_server on

chkconfig zabbix_server --list

配置php

vim/home/zabbix/php/lib/php.ini

找到max_execution_time = 30

改成max_execution_time = 300

找到 ;date.timezone =

改成date.timezone ="Asia/Shanghai"

 

可以启动了

/etc/init.d/zabbix_server start

访问http://192.168.1.3:8127/zabbix/

客户端

groupadd zabbix

useradd zabbix -g zabbix

 

./configure--prefix=/usr/local/zabbix --enable-agent

make install

cpmisc/init.d/fedora/core5/zabbix_agentd /etc/init.d/

vim/etc/init.d/zabbix_agentd

ZABBIX_BIN="/usr/local/zabbix/sbin/zabbix_agentd"

vim/usr/local/zabbix/etc/zabbix_agent.conf

Server=192.168.1.3

Hostname=192.168.1.11

vim/usr/local/zabbix/etc/zabbix_agentd.conf

Server=192.168.1.3

ServerActive=192.168.1.3

/etc/init.d/zabbix_agentd start

chkconfig zabbix_agentd on

chkconfig zabbix_agentd –list

验证通信

/usr/local/zabbix/bin/zabbix_get -s 192.168.1.11 -k"system.cpu.load[all,avg1]"

感谢您对【51运维网 http://www.51ou.com/】的支持,我们为您免费提供《zabbix安装配置》技术文章,《zabbix安装配置》详细使用和说明,有时《zabbix安装配置》可能不完善、敬请谅解!如果《zabbix安装配置》有错误请给我们留言,我们将尽快修复文章错误,如果您觉得本站不错,请分享给周围的朋友!谢谢!

顶一下
(0)
0%
踩一下
(0)
0%
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
验证码:点击我更换图片