




已阅读5页,还剩16页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Installation from Source源代码安装4.1 软件要求Building of Zabbix server or agents from sources requires additional software.用源代码建立Zabbix 服务器或者代理需要的软件。The following software is required to compile Zabbix (required versions):下列软件是编译Zabbix所需(所需的版本):One of the following database engines:下列的一种数据库引擎: IBM DB2 Headers and Libraries - CLI headers and libraries are required. IBM DB2头文件和库文件-CLI的头文件和库是必需的。 MySQL Headers and Libraries. MySQL头文件和库。 Oracle Headers and Libraries - OCI headers and libraries are required. Oracle头文件和库- OCI头文件和库是必需的。 PostgreSQL Headers and Libraries. PostgreSQL头文件和库。 SQLite Headers and Libraries. SQLite头文件和库。Usually provided as part of mysql-dev, postgresql-dev, sqlite3-dev packages.通常能够提供mysql-dev,postgresql-dev,sqlite3-dev包的一部分。NET-SNMP (or UCD-SNMP) library and header files. Required for SNMP support. Optional.Iksemel library and header files. Required to enable Jabber messaging. Optional.Libcurl library and header files. Required for WEB monitoring module. Optional.C Compiler. GNU C compiler is the best choice for open platforms. Other (HP, IBM) C compilers may be used as well.GNU Make. GNU Make is required to process Zabbix Makefiles.4.2 Structure of Zabbix distributionZabbix分布结构的 srcThe directory contains sources for all Zabbix processes except frontends. src/zabbix_serverThe directory contains Makefile and sources for zabbix_server. src/zabbix_agentThe directory contains Makefile and sources for zabbix_agent and zabbix_agentd. src/zabbix_getThe directory contains Makefile and sources for zabbix_get. src/zabbix_senderThe directory contains Makefile and sources for zabbix_sender. includeThe directory contains Zabbix include files. misco misc/init.dThe directory contains start-up scripts for different platforms. frontendso frontends/phpThe directory contains files of PHP frontend. createThe directory contains SQL script for initial database creation. create/schemaDatabase creation schemas. create/dataData for initial database creation. upgradesThe directory contains upgrade procedures for different versions of Zabbix.4.3 Zabbix ServerServer sideStep 1Create the Zabbix superuser accountThis is the user the server will run as. For production use you should create a dedicated unprivileged account (zabbix is commonly used). Running Zabbix as root,bin, or any other account with special rights is a security risk. Do not do it!Zabbix server process (zabbix_server) is protected from being run under root account.If Zabbix server and agent are run on the same machine it is recommended to use a different user for running the server than for running the agent. Otherwise, if both are run as the same user, the agent can access the server configuration file and any Admin level user in Zabbix can quite easily retrieve, for example, the database password.Step 2Extract Zabbix sourcesshell tar -zxf zabbix-1.8.tar.gzStep 3Create the Zabbix databaseZabbix comes with SQL scripts used to create the required database schema and also to insert a default configuration. There are separate scripts for IBM DB2, MySQL, Oracle, PostgreSQL and SQLite.For MySQL:shell mysql -u -pmysql create database zabbix character set utf8;mysql quit;shell cd create/schemashell cat mysql.sql | mysql -u -p zabbixshell cd ./datashell cat data.sql | mysql -u -p zabbixshell cat images_mysql.sql | mysql -u -p zabbixStep 4Configure and compile the source code for your systemThe sources must be compiled for both the server (monitoring machine) as well as the clients (monitored machines). To configure the source for the server, you must specify which database will be used.shell ./configure -enable-server -with-mysql -with-net-snmp -with-jabber -with-libcurl # for MySQL + Jabber + WEB monitoringHowever, if you want to compile client binaries along with server binaries, run:shell ./configure -enable-server -enable-agent -with-mysql -with-net-snmp -with-jabber -with-libcurlUse flag -enable-static to statically link libraries. If you plan to distribute compiled binaries among different servers, you must use this flag to make these binaries work without required libraries. Note that -enable-static does not work under Solaris.Step 5Make and install everythingshell make installBy default, make install will install all the files in /usr/local/sbin, /usr/local/lib etc. Make sure that you have enough permissions.You can specify an installation prefix other than /usr/local using -prefix, for example -prefix=/home/zabbix. In this case daemon binaries will be installed under /sbin, while utilities under /bin. Man pages will be installed under /share.Step 6Configure /etc/servicesThe step is optional. However, it is recommended. On the client (monitored) machines, add the following lines to /etc/services:zabbix-agent 10050/tcp Zabbix Agentzabbix-agent 10050/udp Zabbix Agentzabbix-trapper 10051/tcp Zabbix Trapperzabbix-trapper 10051/udp Zabbix Trapper Note that the port numbers are official Zabbix ports registered in IANA.Step 7Configure /etc/inetd.confIf you plan to use zabbix_agent instead of the recommended zabbix_agentd, the following line must be added:zabbix_agent stream tcp nowait.3600 zabbix /opt/zabbix/bin/zabbix_agentRestart inetdshell killall -HUP inetdModify default settings in configuration filesStep 8Create a location to hold configuration files:mkdir /etc/zabbixStep 9Configure /etc/zabbix/zabbix_agentd.confYou need to configure this file for every host with zabbix_agentd installed. The file should contain the IP address of the Zabbix server. Connections from other hosts will be denied. You may take misc/conf/zabbix_agentd.conf as example.Step 10Configure /etc/zabbix/zabbix_server.confFor small installations (up to ten monitored hosts), default parameters are sufficient. However, you should change default parameters to maximize performance of Zabbix. See section Performance tuning for more details. You may take misc/conf/zabbix_server.conf as example.Step 11Run server processesRun zabbix_server on server side.shell cd sbinshell ./zabbix_serverStep 12Run agentsRun zabbix_agentd where necessary.shell cd sbinshell ./zabbix_agentd4.4 Zabbix ProxyZabbix Proxy is a special process. It is not required to run Zabbix.Step 1Create the Zabbix superuser accountThis is the user the Proxy will run as. For production use you should create a dedicated unprivileged account (zabbix is commonly used). Running Zabbix Proxy as root, bin, or any other account with special rights is a security risk. Do not do it!Zabbix Proxy process (zabbix_proxy) is protected from being run under root account.Step 2Extract Zabbix sourcesshell tar -zxf zabbix-1.8.tar.gzStep 3Create the Zabbix database. Optional.Zabbix Proxy process will create database automatically on the first run if it does not exist. It will use existing database otherwise. Database auto-creation is supported for SQLite only.Zabbix comes with SQL scripts used to create the required database schema. There are separate scripts for IBM DB2, MySQL, Oracle, PostgreSQL and SQLite.For IBM DB2:shell db2 create database zabbix using codeset utf-8 territory us pagesize 32768shell cd create/schemashell db2batch -d zabbix -f ibm_db2.sqlFor MySQL:shell mysql -u -pmysql create database zabbix character set utf8; mysql quit; shell cd create/schemashell cat mysql.sql | mysql -u -p zabbixFor Oracle (we assume that user zabbix with password password exists and has permissions to create database objects):shell cd create/schema shell cat oracle.sql | sqlplus zabbix/password out.logCheck file out.log for any error messages. Zabbix requires UTF8 database character set. If database is not UTF8 it can be converted by running: ALTER DATABASE NATIONAL CHARACTER SET UTF8;For PostgreSQL:shell psql -U psql create database zabbix; psql q shell cd create/schema shell cat postgresql.sql | psql -U zabbix For SQLite:shell cd create/schemashell cat sqlite.sql | sqlite3 /var/lib/sqlite/zabbix.db The database will be automatically created if it does not exist.Step 4Configure and compile the source code for your systemThe sources must be compiled to enable compilation of Zabbix Proxy process. To configure the source for the Proxy, you must specify which database will be used.shell ./configure -enable-proxy -with-ibm-db2 -with-net-snmp # for IBM DB2 + SNMP monitoringorshell ./configure -enable-proxy -with-mysql -with-net-snmp # for MySQL + SNMP monitoringorshell ./configure -enable-proxy -with-oracle -with-net-snmp # for Oracle + SNMP monitoringorshell ./configure -enable-proxy -with-pgsql -with-net-snmp # for PostgreSQL + SNMP monitoringorshell ./configure -enable-proxy -with-sqlite3 -with-net-snmp # for SQLite3 + SNMP monitoringUse flag -with-ibm-db2 to specify location of the CLI API.Use flag -with-oracle to specify location of the OCI API. Use flag -enable-static to statically link libraries. If you plan to distribute compiled binaries among different hosts, you must use this flag to make these binaries work without required libraries. -enable-static does not work under Solaris. Flag -with-ucd-snmp can be used instead of -with-net-snmp. If no SNMP support required, both -with-net-snmp and -with-ucd-snmp may be skipped.However, if you want to compile client binaries along with proxy binaries, run:shell ./configure -enable-proxy -enable-agent -with-mysql -with-net-snmpParameter -enable-static may be used to force static linkage.Step 5Make and install everythingshell make installBy default, make install will install all the files in /usr/local/sbin, /usr/local/lib etc. You can specify an installation prefix other than /usr/local using -prefixStep 6Configure /etc/servicesThe step is optional. However, it is recommended. On the client (monitored) machines, add the following lines to /etc/services:zabbix_agent 10050/tcpzabbix_trap 10051/tcpStep 7Configure /etc/inetd.confIf you plan to use zabbix_agent instead of the recommended zabbix_agentd, the following line must be added:zabbix_agent stream tcp nowait.3600 zabbix /opt/zabbix/bin/zabbix_agentRestart inetdshell killall -HUP inetdStep 8Create a location to hold configuration files:mkdir /etc/zabbixConfigure /etc/zabbix/zabbix_proxy.confFor small installations (up to ten monitored hosts), default parameters are sufficient. However, you should change default parameters to maximize performance of Zabbix Proxy. Make sure you have correct Hostname and Server parameters set. You may take misc/conf/zabbix_proxy.conf as example.Step 9Run Proxy processesRun zabbix_proxy:shell cd sbinshell ./zabbix_proxy4.5 Zabbix AgentClient sideStep 1Create the Zabbix accountThis is the user the agent will run as. For production use you should create a dedicated unprivileged account (“zabbix” is commonly used). Zabbix agents have protection against running under root account.Step 2Extract Zabbix sourcesshell tar -zxf zabbix-1.8.tar.gzStep 3Configure and compile the source code for your systemThe sources must be compiled for the client only.To configure the source for the client:shell ./configure -enable-agentUse flag -enable-static to statically link libraries. If you plan to distribute compiled binaries among different hosts, you must use this flag to make these binaries work without required libraries.Step 4Build agentshell makeCopy created binaries from bin/ to /opt/zabbix/bin or any other directory. Other common directories are /usr/local/bin or /usr/local/zabbix/bin.Step 5Configure /etc/servicesThe step is not real requirement. However, it is recommended.On the client (monitored) machines, add the following lines to /etc/services:zabbix_agent 10050/tcp zabbix_trap 10051/tcp Step 6Configure /etc/inetd.confIf you plan to use zabbix_agent instead of the recommended zabbix_agentd, the following line must be added:zabbix_agent stream tcp nowait.3600 zabbix /opt/zabbix/bin/zabbix_agentRestart inetdshell killall -HUP inetdStep 7Create a location to hold configuration files:mkdir /etc/zabbixStep 8Configure /etc/zabbix/zabbix_agentd.confYou need to configure this file for every host with zabbix_agentd installed. The file should contain IP address of Zabbix server. Connections from other hosts will be denied. You may take misc/conf/zabbix_agentd.conf as example.Step 9Run zabbix_agentd on all monitored machinesshell /opt/zabbix/bin/zabbix_agentdYou should not run zabbix_agentd if you have chosen to use zabbix_agent!Make sure that your system allows allocation of 2MB of shared memory, otherwise the agent may not start and you will see “Cant allocate shared memory for collector.” in agents log file. This may happen on Solaris 8.4.6 Zabbix WEB InterfaceStep 0Zabbix frontend is written in PHP, so to run it a PHP supported webserver is needed. Installation is done by simply copying the PHP files into the webserver HTML documents directory. It is suggested to use a subdirectory instead of HTML root.Common locations of the HTML documents directory for Apache web server include: /usr/local/apache2/htdocs (default directory when installing Apache from source) /srv/www/htdocs (OpenSUSE, SLES) /var/www/html (Fedora, RHEL, CentOS) /var/www (Debian, Ubuntu)To create a subdirectory and copy Zabbix frontend files into it, execute the following commands, replacing with the correct path in your case:mkdir /zabbixcd frontends/phpcp -a . /zabbixWhen upgrading you simply repl
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 柳州工学院《新媒体概论(艺术)》2023-2024学年第二学期期末试卷
- 辽宁现代服务职业技术学院《第四纪地质与地貌学》2023-2024学年第二学期期末试卷
- 益阳医学高等专科学校《暖通空调综合课程设计》2023-2024学年第二学期期末试卷
- 江苏海事职业技术学院《材料制备科学(下)》2023-2024学年第二学期期末试卷
- 南昌职业大学《GS二次开发与应用》2023-2024学年第二学期期末试卷
- 彩泥粽子手工课件
- 2024年贵金属靶材项目资金需求报告代可行性研究报告
- 第17讲 人类遗传病-高考生物一轮复习精讲课件
- 高中化学2023北京通州高三(上)期中化学(教师版)
- 新生儿脐部护理
- 民航行业智能化民航运输与服务方案
- 新版加油站全员安全生产责任制
- 工程机械智能化安全系统
- 【市场营销(实践)调查报告:蜜雪冰城XX市场的调查报告(论文)2700字】
- 广东省广州三校2023-2024学年高二下学期期末考试+物理试卷(含答案)
- 猎聘-2024高校毕业生就业数据报告
- 人教版七年级数学下册举一反三专题11.6期末复习之填空压轴题十大题型总结(学生版+解析)(七年级下册)
- 火龙罐综合灸技术
- 驾驶员安全驾驶培训课件
- 员工劳务合同书
- 建筑公司挂靠协议书范文
评论
0/150
提交评论