首页 后端开发 php教程 deploy zabbix 2210 on ubuntu 1404 64bit

deploy zabbix 2210 on ubuntu 1404 64bit

Jul 30, 2016 pm 01:29 PM
php server the with zabbix

Architecture:
Nginx
php5
mysql


Install depends

<code><span>#apt</span><span>-get</span> install <span>-y</span> nginx php5<span>-fpm</span> php5<span>-gd</span> mysql<span>-server</span> php5<span>-mysql</span> libmysqld<span>-dev</span> libxml2<span>-dev</span> libsnmp<span>-dev</span> libcurl4<span>-openssl</span><span>-dev</span></code>
登录后复制

Config php5-fpm

<code><span>#/etc/php5/fpm/pool.d/www.conf</span><span>...</span>
> <span>33</span> ;listen = /var/run/php5-fpm.sock
> <span>34</span> listen = <span>9000</span><span>#service php5-fpm restart</span></code>
登录后复制

Config nginx

<code><span>#cp /etc/nginx/sites-available/default{,.bak}</span><span>#vim /etc/nginx/sites-enabled/default</span><span>...</span><span>24</span><span>##      root /usr/share/nginx/html;</span><span>25</span>         root /var/www/html/zabbix;
 <span>26</span>         index index.php index.html index.htm;

<span>...</span><span>54</span>         location ~ \.php$ {
 <span>55</span>                 fastcgi_split_path_info ^(.+\.php)(/.+)$;
 <span>56</span><span>#       # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini</span><span>57</span><span>#</span><span>58</span><span>#       # With php5-cgi alone:</span><span>59</span>                 fastcgi_pass <span>127.0</span><span>.0</span><span>.1</span>:<span>9000</span>;
 <span>60</span><span>#       # With php5-fpm:</span><span>61</span><span>#       fastcgi_pass unix:/var/run/php5-fpm.sock;</span><span>62</span>                 fastcgi_index index.php;
 <span>63</span>                 include fastcgi_params;
 <span>64</span>         }

<span>...</span><span>#nginx -t</span>
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

<span>#service nginx reload</span></code>
登录后复制

Installing Zabbix daemons

download and untar pkg

<code><span>#wget http://7mnldi.com1.z0.glb.clouddn.com/zabbix-2.2.10.tar.gz</span><span>#tar -xf zabbix-2.2.10.tar.gz</span></code>
登录后复制

Create user account

<code><span>#groupadd zabbix</span><span>#useradd -g zabbix zabbix</span></code>
登录后复制

Create Zabbix database

For Zabbix server and proxy daemons, as well as Zabbix frontend, a database is required. It is not needed to run Zabbix agent.
SQL scripts are provided for creating database schema and inserting the dataset. Zabbix proxy database needs only the
schema while Zabbix server database requires also the dataset on top of the schema.

For example: config mysql

<code>shell> mysql -u<span>username</span>> -p<span>password</span>>
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> quit;
shell> mysql -u<span>username</span>> -p<span>password</span>> zabbix <span>database</span>/<span>mysql</span>/<span>schema.sql</span>
# <span>stop</span><span>here</span><span>if</span><span>you</span><span>are</span><span>creating</span><span>database</span><span>for</span><span>Zabbix</span><span>proxy</span><span>shell</span>> mysql -u<span>username</span>> -p<span>password</span>> zabbix <span>database</span>/<span>mysql</span>/<span>images.sql</span><span>shell</span>> mysql -u<span>username</span>> -p<span>password</span>> zabbix <span>database</span>/<span>mysql</span>/<span>data.sql</span></code>
登录后复制

Having created a Zabbix database, proceed to the following steps of compiling Zabbix.

Configure the sources

When configuring the sources for a Zabbix server or proxy, you must specify the database type to be used. Only one database type can be compiled with a server or proxy process at a time.

To see all of the supported configuration options, inside the extracted Zabbix source directory run:

<code><span>#./configure --help</span></code>
登录后复制

To configure the sources for a Zabbix server and agent, you may run something like:

<code><span>#</span><span>.</span><span>/configure</span><span>-</span><span>-</span><span>enable</span><span>-</span><span>server</span><span>-</span><span>-</span><span>enable</span><span>-</span><span>agent</span><span>-</span><span>-</span><span>with</span><span>-</span><span>mysql</span><span>-</span><span>-</span><span>enable</span><span>-</span><span>ipv6</span><span>-</span><span>-</span><span>with</span><span>-</span><span>net</span><span>-</span><span>snmp</span><span>-</span><span>-</span><span>with</span><span>-</span><span>libcurl</span><span>-</span><span>-</span><span>with</span><span>-</span><span>libxml2</span></code>
登录后复制

note: –with-libxml2 configuration option is required for virtual machine monitoring, supported since Zabbix 2.2.0.

To configure the sources for a Zabbix server (with PostgreSQL etc.), you may run:

<code><span>#</span><span>.</span><span>/configure</span><span>-</span><span>-</span><span>enable</span><span>-</span><span>server</span><span>-</span><span>-</span><span>with</span><span>-</span><span>postgresql</span><span>-</span><span>-</span><span>with</span><span>-</span><span>net</span><span>-</span><span>snmp</span></code>
登录后复制

To configure the sources for a Zabbix proxy (with SQLite etc.), you may run:

<code><span>#</span><span>.</span><span>/configure</span><span>-</span><span>-</span><span>prefix=/usr</span><span>-</span><span>-</span><span>enable</span><span>-</span><span>proxy</span><span>-</span><span>-</span><span>with</span><span>-</span><span>net</span><span>-</span><span>snmp</span><span>-</span><span>-</span><span>with</span><span>-</span><span>sqlite3</span><span>-</span><span>-</span><span>with</span><span>-</span><span>ssh2</span></code>
登录后复制

To configure the sources for a Zabbix agent, you may run:

<code><span>#./configure --enable-agent</span></code>
登录后复制

Make and install everything

<code><span>#make install</span></code>
登录后复制

This step should be run as a user with sufficient permissions (commonly ‘root’, or by using sudo).

Running make install will by default install the daemon binaries (zabbix_server, zabbix_agentd, zabbix_proxy) in /usr/local/sbin and the client binaries (zabbix_get, zabbix_sender) in /usr/local/bin.

To specify a different location than /usr/local, use a --prefix key in the previous step of configuring sources, 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.

Review and edit configuration files

  • edit the Zabbix agent configuration file /usr/local/etc/zabbix_agentd.conf
    You need to configure this file for every host with zabbix_agentd installed.

You must specify the Zabbix server IP address in the file. Connections from other hosts will be denied.

  • edit the Zabbix server configuration file /usr/local/etc/zabbix_server.conf
    You must specify the database name, user and password (if using any).

With SQLite the full path to database file must be specified; DB user and password are not required.

The rest of the parameters will suit you with their defaults if you have a small installation (up to ten monitored hosts). You should change the default parameters if you want to maximize the performance of Zabbix server (or proxy) though. See the performance tuning section for more details.

  • if you have installed a Zabbix proxy, edit the proxy configuration file /usr/local/etc/zabbix_proxy.conf

You must specify the server IP address and proxy hostname (must be known to the server), as well as the database name, user and password (if using any)

With SQLite the full path to database file must be specified; DB user and password are not required.

Start up the daemons

Run zabbix_server on the server side.

<code><span>#zabbix_server</span></code>
登录后复制

Make sure that your system allows allocation of 36MB (or a bit more) of shared memory, otherwise the server may not start and you will see “Cannot allocate shared memory for .” in the server log file. This may happen on FreeBSD, Solaris 8.
See the “See also” section at the bottom of this page to find out how to configure shared memory.

Run zabbix_agentd on all the monitored machines.

<code><span>#zabbix_agentd</span></code>
登录后复制

Make sure that your system allows allocation of 2MB of shared memory, otherwise the agent may not start and you will see “Cannot allocate shared memory for collector.” in the agent log file. This may happen on Solaris 8.

If you have installed Zabbix proxy, run zabbix_proxy.

<code><span>#zabbix_proxy</span></code>
登录后复制

Installing Zabbix web interface

Copying PHP files
Zabbix frontend is written in PHP, so to run it a PHP supported webserver is needed. Installation is done by simply copying the PHP files from frontends/php to the webserver HTML documents directory.

<code><span>#mkdir /var/www/html/zabbix</span><span>#cd frontends/php</span><span># cp -a . /var/www/html/zabbix</span></code>
登录后复制

Installing frontend

Step 1
In your browser, open Zabbix URL: http://<server_ip_or_name></server_ip_or_name>
You should see the first screen of the frontend installation wizard.

Step 2
Make sure that all software prerequisites are met.

<code>
    Current <span>value</span>   Required
PHP <span>version</span><span>5.5</span><span>.9</span>-<span>1</span>ubuntu4<span>.12</span><span>5.3</span><span>.0</span>   OK
PHP option memory_limit <span>128</span>M    <span>128</span>M    OK
PHP option post_max_size        <span>8</span>M  <span>16</span>M Fail
PHP option upload_max_filesize  <span>2</span>M  <span>2</span>M  OK
PHP option max_execution_time   <span>30</span><span>300</span> Fail
PHP option max_input_time       <span>60</span><span>300</span> Fail
PHP <span>time</span> zone                   unknown     Fail
PHP databases support           MySQL   OK
PHP bcmath                      <span><span>on</span><span>OK</span></span>
PHP mbstring                    <span><span>on</span><span>OK</span></span>
PHP sockets                     <span><span>on</span><span>OK</span></span>
PHP gd                          <span>2.1</span><span>.1</span><span>2.0</span> OK
PHP gd PNG support              <span><span>on</span><span>OK</span></span>
PHP gd JPEG support             <span><span>on</span><span>OK</span></span>
PHP gd FreeType support         <span><span>on</span><span>OK</span></span>
PHP libxml                      <span>2.9</span><span>.1</span><span>2.6</span><span>.15</span>  OK
PHP xmlwriter                   <span><span>on</span><span>OK</span></span>
PHP xmlreader                   <span><span>on</span><span>OK</span></span>
PHP ctype                       <span><span>on</span><span>OK</span></span>
PHP session                     <span><span>on</span><span>OK</span></span>
PHP session auto start          off off OK
PHP gettext                     <span><span>on</span><span>OK</span></span></code>
登录后复制

Resolve:

<code><span>#vim /etc/php5/fpm/php.ini</span><span>...</span><span>385</span><span>#max_execution_time = 30</span><span>386</span> max_execution_time = <span>300</span><span>396</span><span>#max_input_time = 60</span><span>397</span> max_input_time = <span>300</span><span>675</span><span>#post_max_size = 8M</span><span>676</span> post_max_size = 32M

 <span>883</span> date.timezone =<span>'Asia/Shanghai'</span></code>
登录后复制

make sure like this:

<code>
    Current <span>value</span>   Required
PHP <span>version</span><span>5.5</span><span>.9</span>-<span>1</span>ubuntu4<span>.12</span><span>5.3</span><span>.0</span>   OK
PHP option memory_limit <span>128</span>M    <span>128</span>M    OK
PHP option post_max_size        <span>32</span>M <span>16</span>M OK
PHP option upload_max_filesize  <span>2</span>M  <span>2</span>M  OK
PHP option max_execution_time   <span>300</span><span>300</span> OK
PHP option max_input_time       <span>300</span><span>300</span> OK
PHP <span>time</span> zone                   Asia/Shanghai   OK
PHP databases support           MySQL   OK
PHP bcmath                      <span><span>on</span><span>OK</span></span>
PHP mbstring                    <span><span>on</span><span>OK</span></span>
PHP sockets                     <span><span>on</span><span>OK</span></span>
PHP gd                          <span>2.1</span><span>.1</span><span>2.0</span> OK
PHP gd PNG support              <span><span>on</span><span>OK</span></span>
PHP gd JPEG support             <span><span>on</span><span>OK</span></span>
PHP gd FreeType support         <span><span>on</span><span>OK</span></span>
PHP libxml                      <span>2.9</span><span>.1</span><span>2.6</span><span>.15</span>  OK
PHP xmlwriter                   <span><span>on</span><span>OK</span></span>
PHP xmlreader                   <span><span>on</span><span>OK</span></span>
PHP ctype                       <span><span>on</span><span>OK</span></span>
PHP session                     <span><span>on</span><span>OK</span></span>
PHP session auto start          off off OK
PHP gettext                     <span><span>on</span><span>OK</span></span></code>
登录后复制

Step 3
Enter details for connecting to the database. Zabbix database must already be created.

Step 4
Enter Zabbix server details.

Step 5
Review a summary of settings.

Step 6
Download the configuration file and place it under conf/.

Step 7
Finish the installation.

Step 8
Zabbix frontend is ready! The default user name is Admin, password zabbix.

ISSUES

missing libmysqld-dev

<code><span>#./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2</span><span>...</span>checking <span>for</span> mysql_config... no
configure: error: MySQL <span>library</span> not found</code>
登录后复制

Resolve:

<code><span>#apt</span><span>-get</span> install <span>-y</span> libmysqld<span>-dev</span></code>
登录后复制

missing libxml2-dev

<code><span>#./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2</span><span>...</span>checking <span>for</span> xml2-config... no
configure: error: LIBXML2 <span>library</span> not found</code>
登录后复制

Resolve:

<code><span>#apt</span><span>-get</span> install <span>-y</span> libxml2<span>-dev</span></code>
登录后复制

missing libsnmp-dev

<code><span>#./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2</span><span>...</span>
checking <span>for</span> net-snmp-config... no
configure: error: Invalid Net-SNMP directory - unable to find net-snmp-config</code>
登录后复制

Resolve:

<code><span>#apt</span><span>-get</span> install libsnmp<span>-dev</span></code>
登录后复制

missing libcurl4-openssl-dev

<code><span>#./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2</span><span>...</span>checking <span>for</span> curl-config... no
configure: error: Curl <span>library</span> not found
</code>
登录后复制

Resolve:

<code><span>#apt</span><span>-get</span> install <span>-y</span> libcurl4<span>-openssl</span><span>-dev</span></code>
登录后复制

On the dashboard of zabbix, it’s display:

<code>"Zabbix server <span>is</span><span>not</span> running: the information displayed may <span>not</span><span>be</span> current."</code>
登录后复制

Resolve:

<code><span>#vim /var/www/html/zabbix/conf/zabbix.conf.php</span><span>$ZBX_SERVER</span>      = <span>'localhost'</span>;
> <span>$ZBX_SERVER</span>      = <span>'192.168.22.122'</span>; <span>#your ip address</span><span>#</span></code>
登录后复制

版权声明:本文为博主原创文章,未经博主允许不得转载。

以上就介绍了deploy zabbix 2210 on ubuntu 1404 64bit,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

Video Face Swap

Video Face Swap

使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

适用于 Ubuntu 和 Debian 的 PHP 8.4 安装和升级指南 适用于 Ubuntu 和 Debian 的 PHP 8.4 安装和升级指南 Dec 24, 2024 pm 04:42 PM

PHP 8.4 带来了多项新功能、安全性改进和性能改进,同时弃用和删除了大量功能。 本指南介绍了如何在 Ubuntu、Debian 或其衍生版本上安装 PHP 8.4 或升级到 PHP 8.4

我后悔之前不知道的 7 个 PHP 函数 我后悔之前不知道的 7 个 PHP 函数 Nov 13, 2024 am 09:42 AM

如果您是一位经验丰富的 PHP 开发人员,您可能会感觉您已经在那里并且已经完成了。您已经开发了大量的应用程序,调试了数百万行代码,并调整了一堆脚本来实现操作

如何设置 Visual Studio Code (VS Code) 进行 PHP 开发 如何设置 Visual Studio Code (VS Code) 进行 PHP 开发 Dec 20, 2024 am 11:31 AM

Visual Studio Code,也称为 VS Code,是一个免费的源代码编辑器 - 或集成开发环境 (IDE) - 可用于所有主要操作系统。 VS Code 拥有针对多种编程语言的大量扩展,可以轻松编写

在PHP API中说明JSON Web令牌(JWT)及其用例。 在PHP API中说明JSON Web令牌(JWT)及其用例。 Apr 05, 2025 am 12:04 AM

JWT是一种基于JSON的开放标准,用于在各方之间安全地传输信息,主要用于身份验证和信息交换。1.JWT由Header、Payload和Signature三部分组成。2.JWT的工作原理包括生成JWT、验证JWT和解析Payload三个步骤。3.在PHP中使用JWT进行身份验证时,可以生成和验证JWT,并在高级用法中包含用户角色和权限信息。4.常见错误包括签名验证失败、令牌过期和Payload过大,调试技巧包括使用调试工具和日志记录。5.性能优化和最佳实践包括使用合适的签名算法、合理设置有效期、

您如何在PHP中解析和处理HTML/XML? 您如何在PHP中解析和处理HTML/XML? Feb 07, 2025 am 11:57 AM

本教程演示了如何使用PHP有效地处理XML文档。 XML(可扩展的标记语言)是一种用于人类可读性和机器解析的多功能文本标记语言。它通常用于数据存储

php程序在字符串中计数元音 php程序在字符串中计数元音 Feb 07, 2025 pm 12:12 PM

字符串是由字符组成的序列,包括字母、数字和符号。本教程将学习如何使用不同的方法在PHP中计算给定字符串中元音的数量。英语中的元音是a、e、i、o、u,它们可以是大写或小写。 什么是元音? 元音是代表特定语音的字母字符。英语中共有五个元音,包括大写和小写: a, e, i, o, u 示例 1 输入:字符串 = "Tutorialspoint" 输出:6 解释 字符串 "Tutorialspoint" 中的元音是 u、o、i、a、o、i。总共有 6 个元

解释PHP中的晚期静态绑定(静态::)。 解释PHP中的晚期静态绑定(静态::)。 Apr 03, 2025 am 12:04 AM

静态绑定(static::)在PHP中实现晚期静态绑定(LSB),允许在静态上下文中引用调用类而非定义类。1)解析过程在运行时进行,2)在继承关系中向上查找调用类,3)可能带来性能开销。

什么是PHP魔术方法(__ -construct,__destruct,__call,__get,__ set等)并提供用例? 什么是PHP魔术方法(__ -construct,__destruct,__call,__get,__ set等)并提供用例? Apr 03, 2025 am 12:03 AM

PHP的魔法方法有哪些?PHP的魔法方法包括:1.\_\_construct,用于初始化对象;2.\_\_destruct,用于清理资源;3.\_\_call,处理不存在的方法调用;4.\_\_get,实现动态属性访问;5.\_\_set,实现动态属性设置。这些方法在特定情况下自动调用,提升代码的灵活性和效率。

See all articles