Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Ubuntu16.04 installation and deployment monitoring system Zabbix2.4

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Ubuntu16.04 installation and deployment monitoring system Zabbix2.4

The first part, installation of php+mysql+nginx components

1. System update

Sudo apt-get update & & sudo apt-get upgrade

2. Install php-fpm

Retrieve the PHP version that comes with the system: apt-cache search php-fpm

Install the dependency package: sudo apt-get install make bison gathers + build-essential libncurses5-dev cmake

Install php-fpm: sudo apt-get install php7.0-fpm

Edit and modify configuration file: vim / etc/php/7.0/fpm/php.ini

Post_max_size = 16m

Max_execution_time = 300

Max_input_time = 300

Date.timezone = Asia/Shanghai

Start php-fpm: service php7.0-fpm restart

3. Install mysql

Install mysql: sudo apt-get install mysql-server mysql-client

Install the dependent package for mysql: sudo apt-get install php7.0-gd php7.0-mysql libmysqlclient-dev

Create a database zabbix: mysql-uzabbix-pniutianwen create zabbix

Database authorization: echo "grant all on zabbix.* to zabbix@localhost identified by 'niutianwen';" | mysql-uroot-pniutianwen (this example is local authorization. If zabbix is not installed locally, you should change localhost to the ip address of the machine where zabbix is installed)

Import the database file into the zabbix database:

# cd / usr/local/src/zabbix-3.0.1/database

(tar xf zabbix_2.4.5.orig.tar.gz-C / usr/local/src/ in this case, I unpacked the zabbix source code package to the / usr/local/src/ directory.)

Mysql-D zabbix-uroot-pniutianwen

< schema.sql mysql -D zabbix -uroot -pniutianwen < p_w_picpaths.sql mysql -D zabbix -uroot -pniutianwen < data.sql 4、安装nginx 安装nginx: sudo apt-get install nginx 修改配置文件: cp /etc/nginx/sites-available/default /tmp vim /etc/nginx/sites-available/default server { listen 80 default_server; root /usr/share/nginx/html/zabbix; # server_name (可定义域名访问); index index.php index.html index.htm index.nginx-debian.html; location ~ \.php$ { # include snippets/fastcgi-php.conf; # With php7.0-cgi alone: fastcgi_split_path_info ^(.+\.php)(/.+)$; # fastcgi_pass 127.0.0.1:9000; # With php7.0-fpm: fastcgi_pass unix:/run/php/php7.0-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } 测试配置文件:nginx -t 重启nginx:nginx -s reload 创建网站根目录: mkdir /usr/share/nginx/html/zabbix/ 将zabbix的安装php文件导入到网站根目录: cd /usr/local/src/zabbix-3.0.1/frontends/ sudo cp -r php/* /usr/share/nginx/html/zabbix chmod -R zabbix zabbix /usr/share/nginx/html/zabbix/ 5、安装zabbix2.4 安装编译zabbix时所必需的依赖包: sudo apt-get install snmp libsnmp-dev snmpd libcurl4-openssl-dev fping 获取zabbix2.4版本: wget http://repo.zabbix.com/zabbix/2.4/ubuntu/pool/main/z/zabbix/zabbix_2.4.5.orig.tar.gz 解压包:tar xf zabbix_2.4.5.orig.tar.gz -C /usr/local/src/ 编译安装zabbix2.4: ./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --with-net- snmp --with-libcurl make && make install 修改配置文件vim /usr/local/zabbix/etc/zabbix_server.conf DBHost=localhost(修改为数据库的IP,此例为本机) DBName=zabbix DBUser=zabbix DBPassword=niutianwen 启动zabbix相关进程: cd /usr/local/zabbix/sbin ./zabbix_server ./zabbix_agentd ifconfig | grep inet -------->

172.16.188.165 (local IP address)

172.16.188.165/zabbix under browser access

If you encounter a pit here, you can try to install these packages after retry:

Apt-cache search bcmath

Apt-get install php7.0-bcmath

Apt-cache search mbstring

Apt-get install php7.0-mbstring

Apt-cache search php7.0-xml

Apt-get install php7.0-xml

Because php7.0 has canceled the parameter always_populate_raw_post_data, you need to modify the code in the php installation of zabbix:

Vim / usr/share/nginx/html/zabbix/include/classes/setup/CFrontendSetup.php

/ / check for deprecated PHP 5.6.0 option 'always_populate_raw_post_data'

If (version_compare (PHP_VERSION, '5.6,' > =') & & version_compare (PHP_VERSION, '7.0.0,'

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report