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 DB2Headers and Libraries-CLI headers and libraries are required.
mysql文档手机版∙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.2Structure of Zabbix distribution
Zabbix分布结构的
∙src
The directory contains sources for all Zabbix processes except frontends.
∙src/zabbix_server
The directory contains Makefile and sources for zabbix_server.
∙src/zabbix_agent
The directory contains Makefile and sources for zabbix_agent and zabbix_agentd.
∙src/zabbix_get
The directory contains Makefile and sources for zabbix_get.
∙src/zabbix_sender
The directory contains Makefile and sources for zabbix_sender.
∙include
The directory contains Zabbix include files.
∙misc
o misc/init.d
The directory contains start-up scripts for different platforms.
∙frontends
o frontends/php
The directory contains files of PHP frontend.
∙create
The directory contains SQL script for initial database creation.
∙create/schema
Database creation schemas.
∙create/data
Data for initial database creation.
∙upgrades
The directory contains upgrade procedures for different versions of Zabbix.
4.3Zabbix Server
Server side
Step1
Create the Zabbix superuser account
This 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.
Extract Zabbix sources
shell>tar-zxf zabbix-1.
Step3
Create the Zabbix database
Zabbix 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<username>-p<password>
mysql>create database zabbix character set utf8;
mysql>quit;
shell>cd create/schema
shell>cat mysql.sql|mysql-u<username>-p<password>zabbix
shell>cd../data
shell>cat data.sql|mysql-u<username>-p<password>zabbix
shell>cat images_mysql.sql|mysql-u<username>-p<password>zabbix Step4
Configure and compile the source code for your system
The 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 monitoring
However,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-libcurl
Use 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.
Make and install everything
shell>make install
By 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<prefix>/sbin,while utilities under<prefix>/bin. Man pages will be installed under<prefix>/share.
Step6
Configure/etc/services
The step is optional.However,it is recommended.On the client(monitored) machines,add the following lines to/etc/services:
zabbix-agent10050/tcp Zabbix Agent
zabbix-agent10050/udp Zabbix Agent
zabbix-trapper10051/tcp Zabbix Trapper
zabbix-trapper10051/udp Zabbix Trapper
Note that the port numbers are official Zabbix ports registered in IANA.
Step7
Configure/f
If you plan to use zabbix_agent instead of the recommended zabbix_agentd, the following line must be added:
zabbix_agent stream tcp nowait.3600zabbix/opt/zabbix/bin/zabbix_agent
Restart inetd
shell>killall-HUP inetd
Modify default settings in configuration files
Step8
Create a location to hold configuration files:
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论