Zabbix 2.2.20 installation details (Centos6.9)

Environmental description###

[ root@centos ~]# cat /etc/redhat-release 
CentOS release 6.9(Final)[root@centos ~]# uname -a
Linux lb02 2.6.32-696.el6.x86_64 #1 SMP Tue Mar 2119:29:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Server configuration

The first milestone: deploy LNP architecture on m01

cd /server/scripts
sh nginx_install.sh
sh php_install.sh
#! /bin/bash

# base setting
mkdir -p /server/tools

## install nginx
killall nginx
yum install -y pcre-devel openssl-devel
useradd -M -s /sbin/nologin www -u 501
cd /server/tools/
\ rm  -rf /application/nginx-1.10.2
wget http://nginx.org/download/nginx-1.10.2.tar.gz
tar xf nginx-1.10.2.tar.gz
cd /server/tools/nginx-1.10.2./configure --prefix=/application/nginx-1.10.2--user=www --group=www --with-http_stub_status_module --with-http_ssl_module
make
make install
ln -sf  /application/nginx-1.10.2/application/nginx
cd /application/nginx/conf/
egrep -v "#|^$" nginx.conf.default>nginx.conf

/application/nginx/sbin/nginx
#! /bin/bash

killall php-fpm
killall php-fpm

# devel anzhuang

yum install zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-devel freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel -y
yum install -y zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-devel freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel

# libiconv INSTALL

cd /server/tools

http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
tar zxf libiconv-1.14.tar.gz
cd libiconv-1.14./configure --prefix=/usr/local/libiconv
make
make install

# by epel yum
yum -y install libmcrypt-devel mhash mcrypt
\ rm -rf /application/php-5.5.32

##### install php
cd /server/tools/

# wget http://10.0.0.250/tools/php-5.5.32.tar.gz  
tar xf php-5.5.32.tar.gz
cd  /server/tools/php-5.5.32

# set php config ##########################
. /configure \
- - prefix=/application/php-5.5.32 \
- - with-mysql=mysqlnd \
- - with-mysqli=mysqlnd \
- - with-pdo-mysql=mysqlnd \
- - with-iconv-dir=/usr/local/libiconv \
- - with-freetype-dir \
- - with-jpeg-dir \
- - with-png-dir \
- - with-zlib \
- - with-libxml-dir=/usr \
- - enable-xml \
- - disable-rpath \
- - enable-bcmath \
- - enable-shmop \
- - enable-sysvsem \
- - enable-inline-optimization \
- - with-curl \
- - enable-mbregex \
- - enable-fpm \
- - enable-mbstring \
- - with-mcrypt \
- - with-gd \
- - enable-gd-native-ttf \
- - with-openssl \
- - with-mhash \
- - enable-pcntl \
- - enable-sockets \
- - with-xmlrpc \
- - enable-soap \
- - enable-short-tags \
- - enable-static \
- - with-xsl \
- - with-fpm-user=www \
- - with-fpm-group=www \
- - enable-ftp \
- - enable-opcache=no \
- - with-gettext

# fangchuo
# ln -s /application/mysql/lib/libmysqlclient.so.18/usr/lib64/
touch ext/phar/phar.phar
make && make install

ln -sf /application/php-5.5.32/application/php

cd /server/tools/php-5.5.32
\ cp php.ini-production /application/php/lib/php.ini
cd /application/php/etc/
\ cp php-fpm.conf.default php-fpm.conf

/application/php/sbin/php-fpm

The second milestone: Create the users needed to run zabbix

useradd zabbix -M -s /sbin/nologin  -u 1010

The third milestone: Create the required database and authorized users

mysql> create database zabbix character set utf8;
mysql> grant all on zabbix.* to zabbix@'172.16.1.0/255.255.255.0'  identified by  'oldboy123';
mysql> flush privileges;

The fourth milestone: download zabbix source code package, compile and install

Install dependencies

yum install libdbi-dbd-mysql  mysql-devel net-snmp-devel -y 

Install zabbix

wget https://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.20/zabbix-2.2.20.tar.gz
tar zxf zabbix-2.2.20.tar.gz
cd zabbix-2.2.20./configure --prefix=/application/zabbix-2.2.20--enable-server --enable-agent --with-net-snmp --with-libcurl --with-mysqli=mysqlnd --with-mysql=mysqlnd

make && make install

The fifth milestone: creating soft connections

ln -sf /application/zabbix-2.2.20/application/zabbix

The sixth milestone: Import the imported data into the database

cd /server/tools/zabbix-2.0.6/database/mysql/
mysql -uzabbix -poldboy123 zabbix -h 10.0.0.51< schema.sql
mysql -uzabbix -poldboy123 zabbix -h 10.0.0.51< images.sql
mysql -uzabbix -poldboy123 zabbix -h 10.0.0.51< data.sql

Seventh Milestone: Define Service Port

vim /etc/services        ##Add the following at the end

zabbix-agent    10050/tcp               # Zabbix Agent
zabbix-agent    10050/udp               # Zabbix Agent
zabbix-trapper  10051/udp               # Zabbix Trapper
zabbix-trapper  10051/tcp               # Zabbix Trapper

Eighth milestone: Modify the configuration file

# vim /application/zabbix/etc/zabbix_server.conf
# egrep -v "#|^$"/application/zabbix/etc/zabbix_server.conf

LogFile=/tmp/zabbix_server.log
PidFile=/tmp/zabbix_server.pid
DBHost=172.16.1.51
DBName=zabbix
DBUser=zabbix
DBPassword=oldboy123

The ninth milestone: Copy the startup script

cd /server/tools/zabbix-2.2.20
cp -a misc/init.d/fedora/core/zabbix_server /etc/init.d/zabbix

The tenth milestone: modify the startup script

vim /etc/init.d/zabbix_server
 BASEDIR=/application/zabbix     //zabbix installation location
CONFILE=$BASEDIR/etc/zabbix_server.conf //Define the zabbix configuration file location

## Search for the item start and modify the startup options

# functions
start(){if[ $RUNNING -eq 1]
    then
    echo "$0 $ARG: $BINARY_NAME (pid $PID) already running"else
    action $"Starting $BINARY_NAME: " $FULLPATH -c $CONFILE      //Add this line-c $CONFILE
    touch /var/lock/subsys/$BINARY_NAME
 fi
}

# Write the service to boot automatically

echo "/etc/init.d/zabbix start">>/etc/rc.local

The eleventh milestone: copy the web code to the site directory

rsync -az /server/tools/zabbix-2.2.20/frontends/php//application/nginx/html/zabbix/

Pay attention to modify the belonging group of the site directory, otherwise there will be problems during installation

chown  -R www.www /application/nginx/html/

Twelfth Milestone: Start the service

[ root@m01 init.d]# /etc/init.d/zabbix start
Starting zabbix_server:[  OK  ]

The thirteenth milestone: modify the php configuration file

cd /application/php/lib/
sed -i '/^;default_charset/a\default_charset = "UTF-8"'  php.ini
sed -i '/^expose_php/cexpose_php = Off'/etc/php.ini
sed -i '/^max_execution_time/cmax_execution_time = 300'  php.ini
sed -i '/^max_input_time/cmax_input_time = 300'  php.ini
sed -i '/^memory_limit/cmemory_limit = 256M'   php.ini
sed -i '/^post_max_size/cpost_max_size = 32M'  php.ini
sed -i '/^upload_max_filesize/cupload_max_filesize = 300M'  php.ini
sed -i '/^max_file_uploads/cmax_file_uploads = 30'  php.ini
sed -i '/^;date.timezone/cdate.timezone = "PRC"'  php.ini

After modifying the network php configuration file, restart the php service.

Fourteenth milestone: software configuration configuration

  1. Use a browser to access the configured web site

  1. Check whether the php related configuration is correct

  1. Enter the relevant information of the database

  1. Set local related information

  1. Confirm relevant information

  1. zabbix server installation is complete

  1. The modification mode is displayed in Chinese.

  1. Just select Chinese

Client configuration

The first milestone: download the client and install it

mkdir -p /application/zabbix_agents  /server/tools
cd /server/tools
wget http://www.zabbix.com/downloads/2.0.6/zabbix_agents_2.0.6.linux2_6.amd64.tar.gz
tar xf zabbix_agents_2.0.6.linux2_6.amd64.tar.gz  -C /application/zabbix_agents/

The second milestone: modify the client configuration file

[ root@web03 conf]# tail -4/application/zabbix_agents/conf/zabbix_agentd.conf
LogFile=/tmp/zabbix_agentd.log
Server=172.16.1.61  #Management host address
ServerActive=172.16.1.61 #Active management host address
Hostname=172.16.1.9   #Client address

The third milestone: Push the startup script to the managed end

[ root@m01 scripts]# rsync -avz  /server/tools/zabbix-2.2.20/misc/init.d/fedora/core/zabbix_agentd  172.16.1.9:/etc/init.d/zabbix_agentd
sending incremental file list
zabbix_agentd

sent 1139 bytes  received 31 bytes  780.00 bytes/sec
total size is 2170  speedup is 1.85
  # Zabbix-Directory

  BASEDIR=/application/zabbix_agents

  CONFILE=$BASEDIR/conf/zabbix_agentd.conf

## Search for the item start and modify the startup options

# functions
start(){if[ $RUNNING -eq 1]
    then
    echo "$0 $ARG: $BINARY_NAME (pid $PID) already running"else
    action $"Starting $BINARY_NAME: " $FULLPATH -c $CONFILE      //Add this line-c $CONFILE
    touch /var/lock/subsys/$BINARY_NAME
 fi
}

Fourth milestone: start service

Before starting the service, you need to create a zabbix user, otherwise you will be prompted that it cannot be started without a zabbix user

useradd zabbix -M -s /sbin/nologin  -u 1010
/etc/init.d/zabbix_agentd start
echo '/etc/init.d/zabbix_agentd start'>>/etc/rc.local

This concludes the client configuration.

web management configuration

The first milestone: adding a host

**The second milestone: fully clone the host template and quickly add new hosts. **

For more configuration of the web interface, please refer to the official website. https://www.zabbix.com/documentation/3.4/zh/start

? problem:

After changing to the Chinese interface, I found the Chinese in the image

Solution:

  1. Find and extract a total of Chinese font set in windwos

Enter C:\Windows\Fonts in the address bar of the Windows Explorer

  1. Choose a Chinese font you like and copy it. Save it, and upload it to the fonts directory under the zabbix site directory of the server.
[ root@m01 ~]# cd  /application/nginx/html/zabbix/fonts/[root@m01 fonts]# ls
DejaVuSans.ttf

3 ) Rename the uploaded font file to DejaVuSans.ttf (note the original file backup)

[ root@m01 fonts]# mv   xxx.ttf  DejaVuSans.ttf
  1. Then refresh the browser.

Recommended Posts

Zabbix 2.2.20 installation details (Centos6.9)
Centos7 docker installation details
CentOS 6.8 virtual machine installation details
2019-07-09 CentOS7 installation
centos7_1708 installation
CentOs7 installation and deployment Zabbix3.4 original
Centos5 installation guide
CentOS 7.4 install Zabbix 3.4
ubuntu 1804 installation details
Python - centos6 installation
CentOS 7.3 install Zabbix3
Docker installation (CentOS7 installation)
CentOS7 docker installation
centos 6.5 install zabbix 4.4
Zabbix installation and deployment and localization under CentOS
CentOS7 installation zabbix 4.0 tutorial (graphics and text)
CentOS7.3 64 bit, build Zabbix3.4
CentOS online installation RabbitMQ3.7
CentOS 8 install ZABBIX4.4 guide
Centos source installation Python3
lamp (centos7) installation lamp environment
Explore Zabbix 5.0 LTS - CentOS 8 (1)
Centos7 mqtt cluster installation
Graphical installation of CentOS8
Mysql8.0.15 installation configuration (centos7)
Linux notes (1): CentOS-7 installation
Redis3 installation under Centos7
CentOS online installation RabbitMQ3.7
Docker CentOS installation method
Linux CentOS 7 installation tutorial
Centos 7 install Zabbix 3.4 original
Discourse CentOS 8 new installation manual
Centos 7 mini installation process record
Build zabbix monitoring zabbix4.2 in CentOS7.6
Centos mysql installation and configuration
Glusterfs cluster installation on Centos7
Redis cluster installation under CentOS
Centos7 installation and configuration prometheus
Build zabbix monitoring zabbix4.2 in CentOS7.6
CentOS 7 Galera Cluster installation guide
CentOS 7 installation and configuration PPTP
CentOS 6.x installation mysql5.7 record
CentOS installation and configuration cmake
Graphical centos installation detailed process
Centos7.5 installation and configuration MongoDB4.0.4
Redis cluster installation under CentOS
CentOS 7 installation and configuration PPTP
Hyper-V + CentOS7 installation video tutorial
centos7 kvm installation and use
Centos7 silent installation of Oracle11g
CentOS7 postgresql installation and use
CentOS environment installation of Docker
Install Zabbix 3.4 based on CentOS 7
Centos7 installation tomcat process introduction
Centos7.4 environment installation lamp-php7.0 tutorial
Docker EE installation on centos7
CentOS 8.0.1905 install ZABBIX4.4 version (verified)
Discourse CentOS 8 new installation manual
CentOS8 Linux 8.0.1905 installation process (illustration)
Centos7 elk7.1.1 installation and use
Analysis of Hyper-V installation CentOS 8 problem