Zabbix部署(一)
1、zabbix构成部分备注:本文参考zabbix教程从入门到精通教程部署,在centos6.5版本下安装。
zabbix可运行在Linux,Solaris,HP-UX,AIX,FreeBSD,Open BSD,OS X等平台上。
(1)zabbix server
通过SNMP,zabbix agent,ping,端口监视等方法提供对远程服务器/网络状态的监视,数据收集等功能。
zabbixserver可以单独监视远程服务器的服务状态;同时也可以与zabbix agent配合,可以轮询zabbix agent主动接收监视数据(agent方式),同时还可被动接收zabbix agent发送的数据(trapping方式)。
(2)zabbix client
(3)zabbix进程结构
zabbix_agentd:客户端守护进程,负责收集客户端数据,如CPU、MEM、DISK等。
zabbix_get:命令工具,在server端或者proxy端执行获取远程客户端数据。
zabbix_proxy:代理守护进程,server代理中转站。
zabbix_sender:用于发送 数据给server或者proxy,常用于耗时比较长的检查。
zabbix_server:服务端守护进程,zabbix_agentd、zabbix_agentd、zabbix_get、zabbix_proxy、zabbix_sender、zabbix_java_gateway最终都是会将数据提交给server。
zabbix_java_gateway:java网关,类似agentd,只可用于java方面监控,并且只能够主动去获取数据。
(4)zabbix数据空间计算
历史数据:天数*(监控总数/刷新频率)*24小时*3600秒*50字节。
趋势数据:天数*(监控总数/3600)*24小时*3600秒*128字节。
事件数据:天数*事件个数(大概值)*24小时*3600秒*130字节。
2、安装zabbix-2.4.7
(1)安装mysql-server、apache、php
#为方便执行使用yum方式来安装lamp环境
yum-y install mysql mysql-devel mysql-server httpd httpd-develphp php-mysql php-common php-gd php-mbrstringphp-mcrypt php-devel php-xml
#配置mysql服务器,修改root密码为love,设置为开机启动
servicemysqld start
mysqladmin-uroot -p password love
chkconfig--add mysqld
ln-s /var/lib/mysql/mysql.sock /tmp/mysql.sock
#配置/etc/php.ini
#PHPbcmath extension missing (PHP configuration parameter --enable-bcmath)
#PHPmbstring extension missing (PHP configuration parameter --enable-mbstring)
max_execution_time= 300
max_input_time= 300
memory_limit= 128M
post_max_size= 16M
date.timezone= Asia/Chongqing
upload_max_filesize= 2M
bcmath.scale= 1
#配置httpd,并设置为开机启动
#修改/etc/httpd/conf/httpd.conf
ServerNamezabbix.carl.com:80
#在/var/www/html添加index.html和index.php
#index.php
#index.html
ZabbixServer
HelloZabbix Server
#重启httpd服务器,使用浏览器打开http://192.168.20.2/index.html和http://192.168.20.2验证
(2)安装zabbix-2.2.11
#创建用户
useraddzabbix -M -s /sbin/nologin
#configure:error: Curl library not found
#configure:error: Invalid Net-SNMP directory - unable to find net-snmp-config
#configure:error: SSH2 library not found
#configure:error: Unable to find "javac" executable in path
#configure:error: LIBXML2 library not found
yum-y install libcurl-devel net-snmp-devel libssh2-devel libxml2-devel php-bcmathphp-mbstring
./configure--prefix=/usr/local/zabbix-2.2.11 \
--enable-server\
--enable-agent\
--enable-proxy\
--with-mysql\
--with-libcurl\
--with-libxml2\
--with-net-snmp\
--with-ssh2
make&& make install
#创建数据和授权用户
mysql-u root -p -e "create database zabbix default charset utf8"
mysql-u root -p -e "grant all privileges on zabbix.* to zabbix@localhostidentified by 'zabbix'"
mysql-u root -p zabbix
页:
[1]