zabbix部署安装总结_第1页
zabbix部署安装总结_第2页
zabbix部署安装总结_第3页
zabbix部署安装总结_第4页
zabbix部署安装总结_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

-.z.Zabbi*部署部署环境(LAPM)CENTOS6.8+MYSQL+apache+php(1)CENTOS6.8+MYSQL部署安装略过;(2)Linu*下安装配置启动apache安装Apache前准备:1、检查该环境中是否已经存在httpd服务的配置文件,默认存储路径:/etc/httpd/httpd.conf(""centos"""Apache"""ent"","""""""""""Apache)"""""""/etc/httpd/httpd.conf,""""""""centos"""""web"","""":chkconfig

httpdoff,""""centos"""httpd"""80"""""""","""""""""Apache"""""""""""""""""linu*"""""httpd"":1"servicehttpdstop2"ps-ef|grephttpd3"kill-9pid"("""")4"rpm-qa|grephttpd5"rpm-ehttpd"""[rootlocalhost

bin]*

find

/

-name

httpd.conf

[rootlocalhost

bin]*

rm-rfhttpd.conf下载Apache安装包(),下载地址:*tar-z*vfhttpd-2.2.34.tar.gz./configure

--prefi*=/home/apache2

(指定"""")

make

make

install

启动apache服务•启动Apache:/home/apache2/bin/apachectlstart

•停止Apache:/home/apache2/bin/apachectlstop

•重启Apache:/home/apache2/bin/apachectlrestart配置放在/home/apache2/htdocs目录下如果的inde*后缀是PHP格式的,则要修改httpd.conf配置文件(/home/apache2/conf),在DirectoryInde*增加inde*.php。*

*

DirectoryInde*:

sets

the

file

that

Apache

will

serve

if

a

directory

*

is

requested.

*

<IfModule

dir_module>

DirectoryInde*

inde*.html

inde*.php

</IfModule>在LoadModule中添加:LoadModulephp5_modulemodules/libphp5.so找到AddTypeapplication/*-gzip.gz.tgz在其下添加如下容AddTypeapplication/*-httpd-php.php(.前面有空格)AddTypeapplication/*-httpd-php-source.phps(.前面有空格)在httpd.conf文件最后一行添加PHPIniDir/home/php/lib/php.ini(PHP配置文件路径)(如果没有php.ini.dist则把php.ini-developmentphp.ini-production中的任何一个重命名为即可。)(php安装后配置)5、测试重启apache*./apachectlrestart在IE过localhost:80,如果看到页面中显示“Itworks!”字样,则代表Apache验证通过。php安装部署安装PHP前准备:检查php是否已经安装,使用php-v,是否能够看到版本号;或者使用rpm-qa|grepphp查看是否安装过。下载PHP安装包,下载地址:./downloads.php用php-5.6.31.tar.bz2选择以tar.bz2结尾的包(否则*些模块编译了也不可用)。""lib*ml2tarz*vflib*ml2-2.6.32.tar.gzcdlib*ml2-2.6.32./configure--prefi*=/home/lib*ml2makemakeinstall"""""""","/home/lib*ml2/""""""bin"include"lib"man"share""""""""""PHP5"""""""",""""configure"""""""""--with-lib*ml-dir=/usr/local/lib*ml2""",""""""lib*ml2"""""""PHP""JPEG""freetype"GD""""""JPEG""""JPEGcd/usr/local/srccdjpeg-9a./configure--prefi*=/home/jpeg--enable-sharedmakemakeinstall"""""""""/home/jpeg/lib"freetype库安装同上;""php5*tarj*vfphp-5.6.31.tar.bz2**./configure--prefi*=/home/php--with-mysql=/home/mysql_data/mysql/--with-ap*s2=/home/apache2/bin/ap*s--with-lib*ml-dir=/home/lib*ml2--enable-fpm--with-mysqli--enable-bcmath--enable-mbstring--enable-sockets--with-jpeg-dir=/home/jpeg--with-freetype-dir=/home/freetype--with-gd--with-gette*t*make*makeinstall配置:home/php/lib/php.inivim/home/php/lib/php.inidate.timezone=Asia/Shanghaipost_ma*_size=32Mma*_e*ecution_time=300ma*_input_time=300always_populate_raw_post_data=-1注:""""""","""php"phpize"""""gette*t""""e*t""""""""""gette*t""*cde*t/gette*t""""""*/home/php/bin/phpize*/home/php/bin/phpize"php"""""""""""""""./configure--with-php-config=/home/php/bin/php-configmake&&makeinstall""写一个php测试页info.php,放到apache2/htdocs中*viinfo.php<"phpphpinfo();">重启apache在浏览器中输入:服务器地址/info.php如果能正常显示出php的信息,则说明Apche+Mysql+PHP安装成功!zabbi*安装部署服务端1、创建用户groupadd

zabbi*useradd

-g

zabbi*

zabbi*2、"mysql"""zabbi*""""""""mysql-uroot-p

mysql>CREATEDATABASEzabbi*CHARACTERSETutf8COLLATEutf8_bin;

mysql>GRANTALLPRIVILEGESONzabbi*.*TOzabbi*localhostIDENTIFIEDBY'rootroot';mysql>GRANTUSAGEON*.*tozabbi*'%'IDENTIFIEDBY'rootroot';mysql>GRANTALLPRIVILEGESon*.*tozabbi*'%';

mysql>flushprivileges;

mysql>showdatabases;

+--------------------+

|Database

|

+--------------------+

|information_schema|

|mysql

|

|performance_schema|

|zabbi*

|

+--------------------+3、安装zabbi*./configure--prefi*=/home/zabbi*--sysconfdir=/etc/zabbi*/--enable-server--enable-agent--with-net-snmp--with-libcurl--with-mysql=/home/mysql_data/mysql/bin/mysql_config--with-lib*ml2--enable-javamake&&makeinstall4、""zabbi*"cd

/home/zabbi*-3.0.3/database/mysql

mysql-uzabbi*-pzabbi*zabbi*<database/mysql/schema.sql

mysql-uzabbi*-pzabbi*zabbi*<database/mysql/images.sql

mysql-uzabbi*-pzabbi*zabbi*<database/mysql/data.sql5、配置zabbi*_servervim/etc/zabbi*/zabbi*_server.confDBHost=localhost数据库ip地址DBName=zabbi*DBUser=zabbi*DBPassword=rootrootListenIP=30zabbi*serverip地址StartIPMIPollers=10StartPollersUnreachable=10StartTrappers=10StartPingers=10StartDiscoverers=10CacheSize=256MStartDBSyncers=40HistoryCacheSize=128MTrendCacheSize=128MHistoryTe*tCacheSize=128MValueCacheSize=128MTimeout=30AlertScriptsPath=/etc/zabbi*/alertscripts//修改E*ternalScripts=/etc/zabbi*/e*ternalscripts//修改LogSlowQueries=10000StartPro*yPollers=506、创建zabbi*所需要的脚本目录mkdir/etc/zabbi*/alertscriptsmkdir/etc/zabbi*/e*ternalscriptsln-s/home/zabbi*/sbin/*/usr/sbin/cp/home/software/zabbi*-3.0.3/misc/init.d/fedora/core/zabbi*_*/etc/init.d/*复制服务启动脚本chmod+*/etc/init.d/zabbi*_*sed-i"sBASEDIR=/usr/localBASEDIR=/home/zabbi*g"/etc/init.d/zabbi*_server*将zabbi*_server中的BASEDIR=/usr/local替换为BASEDIR=/home/zabbi*sed-i"sBASEDIR=/usr/localBASEDIR=/home/zabbi*g"/etc/init.d/zabbi*_agentd7、配置webvim/home/apache2/conf/httpd.confServerName30:80DocumentRoot"/home/apache2/htdocs"cp-r/home/software/zabbi*-3.0.3/frontends/php/*/home/apache2/htdocs/zabbi*/chown-Rapache.apache/home/apache2/htdocs/zabbi*/chkconfigzabbi*_serveronchkconfighttpdonchkconfigmysqldon/etc/init.d/zabbi*_serverstartservicehttpdrestartchkconfighttpdon注:zabbi*server启动报错[rootlocalhostlib]*/etc/init.d/zabbi*_serverstartStartingzabbi*_server:/usr/local/zabbi*/sbin/zabbi*_server:errorwhileloadingsharedlibraries:libmysqlclient.so.18:cannotopensharedobjectfile:Nosuchfileordirectory[FAILED]解决方法[rootlocalhost~]*ldconfig启动后查看/tmp/zabbi*_server.log报错:[Z3001]connectiontodatabase'zabbi*'failed:[1045]Accessdeniedforuser'zabbi*''webuser'(usingpassword:YES解决:root用户登录mysql授权zabbi*>grantallonzabbi*.*to'zabbi*'30identifiedby'rootroot'withgrantoption;"web""""zabbi*server""""""/zabbi*/setup.php

若部分模块显示*些php库不支持,可参考php安装部分,""php"phpize""""。Ne*tstep:报错Unabletocreatetheconfigurationfile解决:设置web服务器用户在zabbi*网页的conf/目录具有写权限*cd/home/apache2/htdocs/zabbi*/*chmod777-Rconf/登陆"""Admin""zabbi*启动服务端客户端修改客户端配置:vi/etc/zabbi*/zabbi*_agentd.confHostname=webuser启动客户端:*/etc/init.d/zabbi*_agentdstartZb*变成绿色说明OK了非服务端客户端1)

创建用户groupadd

zabbi*useradd

-g

zabbi*

zabbi*zabbi*软件包下载,安装tarz*vfzabbi*-3.0.3.tar.gz

*解压./configure--prefi*=/home/zabbi*--enable-agentmake&&makeinstall3)添加服务端口和修改启动脚本vi/etc/services

*编辑,在最后添加以下代码*Zabbi*zabbi*-agent10050/tcp*Zabbi*Agentzabbi*-agent10050/udp*Zabbi*Agentzabbi*-trapper10051/tcp*Zabbi*Trapperzabbi*-trapper10051/udp*Zabbi*Trappercp/home/software/zabbi*-3.0.3/misc/init.d/fedora/core/zabbi*_agentd/etc/rc.d/init.d/chmod+*/etc/rc.d/init.d/zabbi*_agentd

*添加脚本执行权限vi/etc/rc.d/init.d/zabbi*_agentd

*编辑客户端配置文件修改BASEDIR=/home/zabbi*/

*zabbi*安装目录chkconfigzabbi*_agentdon

*添加开机启动修改zabbi*_agent配置文件vim/home/zabbi*/etc/zabbi*_agentd.conf

Server=30*服务器端的IPHostname=webuser01*agent主机名Include=/home/zabbi*/etc/zabbi*_agentd.conf.d/

*扩展配置目录,存放新加监控模板脚本5)启动

/etc/init.d/zabbi*_agentdstart6)在防火墙上开启相应端口

vi/etc/sysconfig/iptables添加:

-AINPUT-mstate--stateNEW-mtcp-ptcp--dport10050-jACCEPT

-AINPUT-mstate--stateNEW-mtcp-ptcp--dport10051-jACCEPT重启防火墙:

serviceiptablesrestart7)测试下面的命令需要在server端执行,其中是agent的ip*/home/zabbi*/bin/zabbi*_get

-s1-p10050

-k"system.uptime"1031163说明成功啦。

8)监控该服务器访问:是zabbi*server的IP.配置—>主机->创建主机,Z如果是红色的话是不正常的,必须是绿色。附加:添加MYSQL监控:1.在路径下添加模板mysql监控脚本userparameter_mysql.conf2.在/home/zabbi*/etc新建.my.f用于监控mysql的用名密码[rootwebuser01etc]*vi.my.f[client]user=rootpassword=rootroot3.修改userparameter_mysql.conf文件中HOME=/home/zabbi*/etc路径用于指向.my.f文件4.重启客户端:/etc/init.d/zabbi*_agentdrestart5.服务端测试建值是否可用,例*cd/home/zabbi*/bin/

:./zabbi*_get-s31-kmysql.status[_begin]看参数是否可用图形文字乱码,可替换字库:把它拷贝到zabbi*的web端的fonts目录下例如:/home/apache2/htdocs/zabbi*/fonts/修改php页面指定的字体文件:修改define('ZB*_GRAPH_FONT_NAME',

'DejaVuSans');('ZB*_FONT_NAME','DejaVuSans');为define('ZB*_GRAPH_FONT_NAME',

'simheittf');('ZB*_FONT_NAME','simheittf')添加监控磁盘io:1客户端操作编辑vim/etc/zabbi*/zabbi*_agentd.conf添加下面这些:****diskioUserParameter=disk.read.ops[*],cat/proc/diskstats

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论