zabbix安装官方文档中文版.docx
- 文档编号:2174064
- 上传时间:2023-05-02
- 格式:DOCX
- 页数:20
- 大小:425.22KB
zabbix安装官方文档中文版.docx
《zabbix安装官方文档中文版.docx》由会员分享,可在线阅读,更多相关《zabbix安装官方文档中文版.docx(20页珍藏版)》请在冰点文库上搜索。
zabbix安装官方文档中文版
InstallationfromSource
源代码安装
4.1软件要求
BuildingofZabbixserveroragentsfromsourcesrequiresadditionalsoftware.
用源代码建立Zabbix服务器或者代理需要的软件。
ThefollowingsoftwareisrequiredtocompileZabbix(requiredversions):
下列软件是编译Zabbix所需(所需的版本):
Oneofthefollowingdatabaseengines:
下列的一种数据库引擎:
∙IBMDB2HeadersandLibraries-CLIheadersandlibrariesarerequired.
∙IBMDB2头文件和库文件-CLI的头文件和库是必需的。
∙MySQLHeadersandLibraries.
∙MySQL头文件和库。
∙OracleHeadersandLibraries-OCIheadersandlibrariesarerequired.
∙Oracle头文件和库-OCI头文件和库是必需的。
∙PostgreSQLHeadersandLibraries.
∙PostgreSQL头文件和库。
∙SQLiteHeadersandLibraries.
∙SQLite头文件和库。
Usuallyprovidedaspartofmysql-dev,postgresql-dev,sqlite3-devpackages.
通常能够提供mysql-dev,postgresql-dev,sqlite3-dev包的一部分。
NET-SNMP(orUCD-SNMP)libraryandheaderfiles.RequiredforSNMPsupport.Optional.
Iksemellibraryandheaderfiles.RequiredtoenableJabbermessaging.Optional.
Libcurllibraryandheaderfiles.RequiredforWEBmonitoringmodule.Optional.
CCompiler.GNUCcompileristhebestchoiceforopenplatforms.Other(HP,IBM)Ccompilersmaybeusedaswell.
GNUMake.GNUMakeisrequiredtoprocessZabbixMakefiles.
4.2StructureofZabbixdistribution
Zabbix分布结构的
∙src
ThedirectorycontainssourcesforallZabbixprocessesexceptfrontends.
∙src/zabbix_server
ThedirectorycontainsMakefileandsourcesforzabbix_server.
∙src/zabbix_agent
ThedirectorycontainsMakefileandsourcesforzabbix_agentandzabbix_agentd.
∙src/zabbix_get
ThedirectorycontainsMakefileandsourcesforzabbix_get.
∙src/zabbix_sender
ThedirectorycontainsMakefileandsourcesforzabbix_sender.
∙include
ThedirectorycontainsZabbixincludefiles.
∙misc
omisc/init.d
Thedirectorycontainsstart-upscriptsfordifferentplatforms.
∙frontends
ofrontends/php
ThedirectorycontainsfilesofPHPfrontend.
∙create
ThedirectorycontainsSQLscriptforinitialdatabasecreation.
∙create/schema
Databasecreationschemas.
∙create/data
Dataforinitialdatabasecreation.
∙upgrades
ThedirectorycontainsupgradeproceduresfordifferentversionsofZabbix.
4.3ZabbixServer
Serverside
Step1
CreatetheZabbixsuperuseraccount
Thisistheusertheserverwillrunas.Forproductionuseyoushouldcreateadedicatedunprivilegedaccount('zabbix'iscommonlyused).RunningZabbixas'root','bin',oranyotheraccountwithspecialrightsisasecurityrisk.Donotdoit!
Zabbixserverprocess(zabbix_server)isprotectedfrombeingrununderrootaccount.
IfZabbixserverandagentarerunonthesamemachineitisrecommendedtouseadifferentuserforrunningtheserverthanforrunningtheagent.Otherwise,ifbotharerunasthesameuser,theagentcanaccesstheserverconfigurationfileandanyAdminleveluserinZabbixcanquiteeasilyretrieve,forexample,thedatabasepassword.
Step2
ExtractZabbixsources
shell>tar-zxfzabbix-1.8.tar.gz
Step3
CreatetheZabbixdatabase
ZabbixcomeswithSQLscriptsusedtocreatetherequireddatabaseschemaandalsotoinsertadefaultconfiguration.ThereareseparatescriptsforIBMDB2,MySQL,Oracle,PostgreSQLandSQLite.
ForMySQL:
shell>mysql-u
mysql>createdatabasezabbixcharactersetutf8;
mysql>quit;
shell>cdcreate/schema
shell>catmysql.sql|mysql-u
shell>cd../data
shell>catdata.sql|mysql-u
shell>catimages_mysql.sql|mysql-u
Step4
Configureandcompilethesourcecodeforyoursystem
Thesourcesmustbecompiledforboththeserver(monitoringmachine)aswellastheclients(monitoredmachines).Toconfigurethesourcefortheserver,youmustspecifywhichdatabasewillbeused.
shell>./configure--enable-server--with-mysql--with-net-snmp--with-jabber--with-libcurl#forMySQL+Jabber+WEBmonitoring
However,ifyouwanttocompileclientbinariesalongwithserverbinaries,run:
shell>./configure--enable-server--enable-agent--with-mysql--with-net-snmp--with-jabber--with-libcurl
Useflag--enable-statictostaticallylinklibraries.Ifyouplantodistributecompiledbinariesamongdifferentservers,youmustusethisflagtomakethesebinariesworkwithoutrequiredlibraries.Notethat--enable-staticdoesnotworkunderSolaris.
Step5
Makeandinstalleverything
shell>makeinstall
Bydefault,makeinstallwillinstallallthefilesin/usr/local/sbin,/usr/local/libetc.Makesurethatyouhaveenoughpermissions.
Youcanspecifyaninstallationprefixotherthan/usr/localusing--prefix,forexample--prefix=/home/zabbix.Inthiscasedaemonbinarieswillbeinstalledunder
Step6
Configure/etc/services
Thestepisoptional.However,itisrecommended.Ontheclient(monitored)machines,addthefollowinglinesto/etc/services:
zabbix-agent10050/tcpZabbixAgent
zabbix-agent10050/udpZabbixAgent
zabbix-trapper10051/tcpZabbixTrapper
zabbix-trapper10051/udpZabbixTrapper
NotethattheportnumbersareofficialZabbixportsregisteredinIANA.
Step7
Configure/etc/inetd.conf
Ifyouplantousezabbix_agentinsteadoftherecommendedzabbix_agentd,thefollowinglinemustbeadded:
zabbix_agentstreamtcpnowait.3600zabbix/opt/zabbix/bin/zabbix_agent
Restartinetd
shell>killall-HUPinetd
Modifydefaultsettingsinconfigurationfiles
Step8
Createalocationtoholdconfigurationfiles:
mkdir/etc/zabbix
Step9
Configure/etc/zabbix/zabbix_agentd.conf
Youneedtoconfigurethisfileforeveryhostwithzabbix_agentdinstalled.ThefileshouldcontaintheIPaddressoftheZabbixserver.Connectionsfromotherhostswillbedenied.Youmaytakemisc/conf/zabbix_agentd.confasexample.
Step10
Configure/etc/zabbix/zabbix_server.conf
Forsmallinstallations(uptotenmonitoredhosts),defaultparametersaresufficient.However,youshouldchangedefaultparameterstomaximizeperformanceofZabbix.Seesection[Performancetuning]formoredetails.Youmaytakemisc/conf/zabbix_server.confasexample.
Step11
Runserverprocesses
Runzabbix_serveronserverside.
shell>cdsbin
shell>./zabbix_server
Step12
Runagents
Runzabbix_agentdwherenecessary.
shell>cdsbin
shell>./zabbix_agentd
4.4ZabbixProxy
ZabbixProxyisaspecialprocess.ItisnotrequiredtorunZabbix.
Step1
CreatetheZabbixsuperuseraccount
ThisistheusertheProxywillrunas.Forproductionuseyoushouldcreateadedicatedunprivilegedaccount('zabbix'iscommonlyused).RunningZabbixProxyas'root','bin',oranyotheraccountwithspecialrightsisasecurityrisk.Donotdoit!
ZabbixProxyprocess(zabbix_proxy)isprotectedfrombeingrununderrootaccount.
Step2
ExtractZabbixsources
shell>tar-zxfzabbix-1.8.tar.gz
Step3
CreatetheZabbixdatabase.Optional.
ZabbixProxyprocesswillcreatedatabaseautomaticallyonthefirstrunifitdoesnotexist.Itwilluseexistingdatabaseotherwise.Databaseauto-creationissupportedforSQLiteonly.
ZabbixcomeswithSQLscriptsusedtocreatetherequireddatabaseschema.ThereareseparatescriptsforIBMDB2,MySQL,Oracle,PostgreSQLandSQLite.
ForIBMDB2:
shell>db2"createdatabasezabbixusingcodesetutf-8territoryuspagesize32768"
shell>cdcreate/schema
shell>db2batch-dzabbix-fibm_db2.sql
ForMySQL:
shell>mysql-u
mysql>createdatabasezabbixcharactersetutf8;
mysql>quit;
shell>cdcreate/schema
shell>catmysql.sql|mysql-u
ForOracle(weassumethatuser'zabbix'withpassword'password'existsandhaspermissionstocreatedatabaseobjects):
shell>cdcreate/schema
shell>catoracle.sql|sqlpluszabbix/password>out.log
Checkfileout.logforanyerrormessages.ZabbixrequiresUTF8databasecharacterset.IfdatabaseisnotUTF8itcanbeconvertedbyrunning:
ALTERDATABASENATIONALCHARACTERSETUTF8;
ForPostgreSQL:
shell>psql-U
psql>createdatabasezabbix;
psql>\q
shell>cdcreate/schema
shell>catpostgresql.sql|psql-U
ForSQLite:
shell>cdcreate/schema
shell>catsqlite.sql|sqlite3/var/lib/sqlite/zabbix.db
Thedatabasewillbeautomaticallycreatedifitdoesnotexist.
Step4
Configureandcompilethesourcecodeforyoursystem
ThesourcesmustbecompiledtoenablecompilationofZabbixProxyprocess.ToconfigurethesourcefortheProxy,youmustspecifywhichdatabasewillbeused.
shell>./configure--enable-proxy--with-ibm-db2--with-net-snmp#forIBMDB2+SNMPmonitoring
or
shell>./configure--enable-proxy--with-mysql--with-net-snmp#forMySQL+SNMPmonitoring
or
shell>./configure--enable-proxy--with-oracle--with-net-snmp#forOracle+SNMPmonitoring
or
shell>./configure--enable-proxy--with-pgsql--with-net-snmp#forPostgreSQL+SNMPmonitoring
or
shell>./configure--enable-proxy--with-sqlite3--with-net-snmp#forSQLite3+SNMPmonitoring
Useflag--with-ibm-db2tospecifylocationoftheCLIAPI.
Useflag--with-oracletospecifylocationoftheOCIAPI.
Useflag--enable-statictostaticallylinklibraries.Ifyouplantodistributecompiledbinariesamongdifferenthosts,youmustusethisflagtomakethesebinariesworkwithoutrequiredlibraries.--enable-staticdoesnotworkunderSolaris.Flag--with-ucd-snmpcanbeusedinsteadof--with-net-snmp.IfnoSNMPsupportrequired,both--with-net-snmpand--with-ucd-snmpmaybeskipped.
However,ifyouwanttocompileclientbinariesalongwithproxybinaries,run:
shell>./configure--enable-proxy--enable-agent--with-mysql--with-net-snmp
Parameter--enable-staticmaybeusedtoforcestaticlinkage.
Step5
Makeandinstallevery
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- zabbix 安装 官方 文档 中文版