zabbix3.2安装

黑色月牙 黑色月牙     2022-09-01     396

关键词:

 

硬件需求

Examples of hardware configuration
The table provides several examples of hardware configurations:
Name   Platform CPU/Memory  DatabaseMonitored hosts
Small  CentOS  Virtual Appliance  MySQL InnoDB  100 
Medium  CentOS  2 CPU cores/2GB  MySQL InnoDB  500 
Large  RedHat Enterprise Linux  4 CPU cores/8GB  RAID10 MySQL InnoDB or PostgreSQL  >1000 
Very large  RedHat Enterprise Linux  8 CPU cores/16GB  Fast RAID10 MySQL InnoDB or PostgreSQL  >10000 








部署环境(硬件)需求
主机数量:50台、网络设备数量:20台。总计监控点位70个。
根据官方提供的硬件设备需求表,提出以下硬件需求
CPU:1核。
内存:2G
磁盘容量:45G
磁盘容量计算方式:
linux操作系统+软件部署:6G
服务器:50个点,每一分钟读取一次数据,每秒数据量为50*30/60=25个/秒。
网络设备:20个点,每20秒读取一次数据,每秒数据量为20*30/20=30个/秒。
zabbix每秒处理的数据量:55个/秒
一条记录大小:5字节
保存记录的值(一个月):24*30*3600(一个月的秒)*55*5=712800000字节(约为6.6G)
趋势数据(5年):2100个*24小时*356天*128字节(一条趋势数据大小)*5=11G
事件记录保存(一年):1年*365天*24小时*3600秒*130字节(一条事件记录的大小)=4.1G
按照保存记录的值3个月,趋势数据5年,时间保存记录的值2年进行计算:
所需磁盘容量为:6G+6.6G*3+11+4.1G*2=45G


数据库需求

Database management system
  Software   Version   Comments 
MySQL  5.0.3 or later  Required if MySQL is used as Zabbix backend database. InnoDB engine is required. 
Oracle  10g or later  Required if Oracle is used as Zabbix backend database. 
PostgreSQL  8.1 or later  Required if PostgreSQL is used as Zabbix backend database.
It is suggested to use at least PostgreSQL 8.3, which introduced much better VACUUM performance
SQLite  3.3.5 or later  Required if SQLite is used as Zabbix backend database. 
IBM DB2  9.7 or later  Required if IBM DB2 is used as Zabbix backend database. 


前端需求

Frontend

The following software is required to run Zabbix frontend:

Software VersionComments
Apache  1.3.12 or later   
PHP  5.4.0 or later   
  PHP extensions: 
gd  2.0 or later  PHP GD extension must support PNG images (--with-png-dir), JPEG (--with-jpeg-dir) images and FreeType 2 (--with-freetype-dir). 
bcmath    php-bcmath (--enable-bcmath
ctype    php-ctype (--enable-ctype
libXML  2.6.15 or later  php-xml or php5-dom, if provided as a separate package by the distributor. 
xmlreader    php-xmlreader, if provided as a separate package by the distributor. 
xmlwriter    php-xmlwriter, if provided as a separate package by the distributor. 
session    php-session, if provided as a separate package by the distributor. 
sockets    php-net-socket (--enable-sockets). Required for user script support. 
mbstring    php-mbstring (--enable-mbstring
gettext    php-gettext (--with-gettext). Required for translations to work. 
ldap    php-ldap. Required only if LDAP authentication is used in the frontend. 
ibm_db2    Required if IBM DB2 is used as Zabbix backend database. 
mysqli    Required if MySQL is used as Zabbix backend database. 
oci8    Required if Oracle is used as Zabbix backend database. 
pgsql    Required if PostgreSQL is used as Zabbix backend database.
sqlite3   

Required if SQLite is used as Zabbix backend database. 

 要点:( --with-mysqli=mysqlnd和--with-gettext一定要加上,否则前者不装时安装 zabbix时database type没有选项 默认出来的数据库是SqLite 3,且不能切换  ,后者不装时,会报PHP gettext warning)

 
























 




 
Pre-requisiteMinimum valueDescription
PHP version  5.4.0   
PHP memory_limit option  128MB  In php.ini:
memory_limit = 128M 
PHP post_max_size option  16MB  In php.ini:
post_max_size = 16M 
PHP upload_max_filesize option  2MB  In php.ini:
upload_max_filesize = 2M 
PHP max_execution_time option  300 seconds (values 0 and -1 are allowed) In php.ini:
max_execution_time = 300 
PHP max_input_time option  300 seconds (values 0 and -1 are allowed) In php.ini:
max_input_time = 300 
PHP session.auto_start option  must be disabled  In php.ini:
session.auto_start = 0 
Database support  One of: IBM DB2, MySQL, Oracle, PostgreSQL, SQLite  One of the following modules must be installed:
ibm_db2, mysql, oci8, pgsql, sqlite3 
bcmath    php-bcmath 
mbstring    php-mbstring 
PHP mbstring.func_overload option  must be disabled  In php.ini:
mbstring.func_overload = 0 
PHP always_populate_raw_post_data option  must be disabled  Required only for PHP versions 5.6.0 or newer.
In php.ini:
always_populate_raw_post_data = -1
sockets    php-net-socket. Required for user script support.  
gd  2.0 or higher  php-gd. PHP GD extension must support PNG images (--with-png-dir), JPEG (--with-jpeg-dir) images and FreeType 2 (--with-freetype-dir).
libxml  2.6.15  php-xml or php5-dom 
xmlwriter    php-xmlwriter 
xmlreader    php-xmlreader 
ctype    php-ctype 
session    php-session 
gettext    php-gettext
Since Zabbix 2.2.1, the PHP gettext extension is not a mandatory requirement for installing Zabbix. If gettext is not installed, the frontend will work as usual, however, the translations will not be available. 


其他扩展需求

 
RequirementDescription
OpenIPMI  Required for IPMI support. yum install OpenIPMI-devel OpenIPMI
libssh2  Required for SSH support. Version 1.0 or higher.yum install libssh2 libssh2-devel
fping  Required for ICMP ping items.yum install fping
libcurl  Required for web monitoring, VMware monitoring and SMTP authentication. For SMTP authentication, version 7.20.0 or higher is required.yum install libcurl libcurl-devel
libiksemel  Required for Jabber support.
libxml2  Required for VMware monitoring. yum install libxml2 libxml2-devel
net-snmp  Required for SNMP support. yum install net-snmp net-snmp-devel

 
yum install OpenIPMI-devel OpenIPMI libssh2 libssh2-devel fping libxml2 libxml2-devel net-snmp net-snmp-devel -y

 

环境及相关软件

系统: CentOS release 6.7 (Final)

软件包:/home/tools
  mysql-5.5.49.tar.gz
  libiconv-1.14.tar.gz
  nginx-1.8.1.tar.gz
  php-5.6.22.tar.gz
  zabbix-3.2.6.tar.gz
  


数据库安装

yum install cmake  ncurses-devel openssl-devel -y
useradd mysql -s /bin/nologin -M
mkdir /data
chown -R mysql.mysql /data 

cd /home/tools/
tar -xf mysql-5.5.49.tar.gz 
cd mysql-5.5.49
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql5.5.49 -DMYSQL_DATADIR=/data -DSYSCONFDIR=/etc -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DWITH_READLINE=1 -DWITH_SSL=system -DWITH_ZLIB=system -DWITH_LIBWRAP=0 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DMYSQL_TCP_PORT=3306 -DENABLED_LOCAL_INFILE=1 -DWITH_EMBEDDED_SERVER=1 -DENABLED_PROFILING=1 -DWITH_DEBUG=0 

make
make install

ln -s /usr/local/mysql5.5.49  /usr/local/mysql
/bin/cp /home/tools/mysql-5.5.49/support-files/my-large.cnf /etc/my.cnf
chown -R mysql.mysql /usr/local/mysql

#vi /etc/my.cnf
#增加
#datadir = /data
#innodb_file_per_table = 1

/bin/cp /home/tools/mysql-5.5.49/support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
chkconfig --add mysqld

echo ‘export PATH=/usr/local/mysql/bin:$PATH‘ >>/etc/profile
source /etc/profile

cd  /usr/local/mysql/scripts
./mysql_install_db --basedir=/usr/local/mysql --datadir=/data/ --user=mysql
/etc/init.d/mysqld start

 

nginx安装

yum  install  pcre  pcre-devel -y
yum  install  openssl-devel   openssl -y
useradd  nginx  -s  /sbin/nologin  -M

cd /home/tools tar -zxvf nginx-1.8.1.tar.gz cd nginx-1.8.1 ./configure --prefix=/usr/local/nginx-1.8.1 --user=nginx --group=nginx --with-http_stub_status_module --with-http_ssl_module make make install ln -s /usr/local/nginx-1.8.1/ /usr/local/nginx cd /usr/local/nginx egrep -v "#|^$" conf/nginx.conf.default >conf/
nginx.conf 在nginx.conf中的server内添加: #vi conf/nginx.conf location ~.*.(php|php5)$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; } /usr/local/nginx/sbin/nginx


php安装

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

cd /home/tools tar zxf libiconv-1.14.tar.gz cd libiconv-1.14 ./configure --prefix=/usr/local/libiconv make make install
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo yum -y install libmcrypt libmcrypt-devel mhash mhash-devel mcrypt -y
cd /home/tools tar xf php-5.6.22.tar.gz cd php-5.6.22 ./configure --prefix=/usr/local/php5.6.22 --with-mysql=/usr/local/mysql --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 --with-gettext --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=nginx --with-fpm-group=nginx --enable-ftp --enable-opcache --enable-ctype make make install ln -s /usr/local/php5.6.22/ /usr/local/php
============================================== #vi /etc/ld.so.conf.d/local.conf /usr/local/lib64 #ldconfig configure: error: Dont know how to define struct flock on this system, set --enable-opcache=no
如果无法解决,尝试如下
echo /usr/local/mysql/lib >> /etc/ld.so.conf
ldconfig


============================================= cp /home/tools/php-5.6.22/php.ini-production /usr/local/php/lib/php.ini cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf /usr/local/php/sbin/php-fpm #check whether fastcgi can connect php vi /usr/local/nginx/html/phpinfo.php <?php phpinfo() ?> 在浏览器中访问http://zabbix服务器IP/phpinfo.php

 

安装zabbix

mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to [email protected] identified by ‘zabbix‘;
mysql> quit;

cd /home/tools
tar -xf zabbix-3.2.6.tar.gz
cd /home/tools/zabbix-3.2.6/database/mysql
mysql -uzabbix -pzabbix zabbix < schema.sql
mysql -uzabbix -pzabbix zabbix < images.sql
mysql -uzabbix -pzabbix zabbix < data.sql



cd /home/tools/zabbix-3.2.6
./configure --prefix=/usr/local/zabbix  --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 --with-openipmi --with-ssh2
make install
cp -a  /home/tools/zabbix-3.2.6/frontends/php/* /usr/local/nginx/html/
chown -R nginx.nginx /usr/local/nginx/html/


vi /usr/local/zabbix/etc/zabbix_server.conf
LogFile=/tmp/zabbix_server.log
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix


useradd zabbix  -s /sbin/nologin  -M


cd  /usr/local/php/lib/
sed -i "s#post_max_size = 8M#post_max_size = 16M#g" php.ini
sed -i "s#max_execution_time = 30#max_execution_time = 300#g" php.ini
sed -i "s#max_input_time = 60#max_input_time = 300#g" php.ini
sed -i "s#;date.timezone =#date.timezone = Asia/Shanghai#g" php.ini
sed -i "s#;always_populate_raw_post_data = -1#always_populate_raw_post_data = -1#g" php.ini


killall php-fpm
/usr/local/php/sbin/php-fpm


浏览器,按照提示完成
http://zabbix ip/setup.php

配置开机启动
cd /home/tools/zabbix-3.2.6/misc/init.d/fedora/core/
cp zabbix_* /etc/init.d/
chmod +x /etc/init.d/zabbix_server
chmod +x /etc/init.d/zabbix_agentd
chkconfig zabbix_server on
chkconfig zabbix_agentd on

修改zabbix开机启动脚本中的zabbix安装目录
vi /etc/rc.d/init.d/zabbix_server #编辑服务端配置文件
BASEDIR=/usr/local/zabbix/ #zabbix安装目录
vi /etc/rc.d/init.d/zabbix_agentd #编辑客户端配置文件
BASEDIR=/usr/local/zabbix/ #zabbix安装目录
 

 

 

1.安装zabbix3.2

1.关闭防火墙、selinuxgetenforcesystemctl stop    firewalld.servicesystemctl disable firewalld.service 查看详情

zabbix3.2.7(源码包)安装部署

 Zabbix3.2.7+CentOS7安装环境准备:操作系统CentOSLinuxrelease7.2.1511(Core)zabbixserver10.30.94.60zabbixagent10.25.198.179 一、zabbixserver端安装部署1、快速部署lamp环境:     yum -y  查看详情

zabbix3.2.7编译安装

b修改/usr/local/apache/修改php.ini文件[[email protected]zabbix-3.2.7]#groupaddzabbix[[email protected]zabbix-3.2.7]#useradd-gzabbixzabbixyum安装net-snmp,net-snmp-devel,mysql(mariadb),mysql-devel(mar 查看详情

zabbix3.2.3安装部署

安装nginx[[email protected]~]#yuminstall-ygccgcc-c++autoconfautomakezlibzlib-developensslopenssl-develpcre-devel  //zlib:给Nginx提供gzip模块,需要的支持;OPenssl提供SSL功能;PCRE,地址重写[[email protecte 查看详情

lnmp+zabbix3.2的编译安装

yuminstallpcre*gccgcc-c++autoconfautomakezliblibxmllibjpegfreetypelibpnggdcurlzlib-devellibxml2-devellibjpeg-develfreetype-devellibpng-develgd-develcurl-developensslopenssl-develbzip2-devel----------- 查看详情

centos7.2lnmp安装部署zabbix3.2

...境CentOS7.2_x64 yum安装数据库:mariadb5.5  yum安装zabbix3.2.8编译安装nginx1.2.1(最新稳定版)    编译安装php5.6.31最新稳定版关闭selinux防火墙添加好规则,tcp/10051(进出)tcp/10050(出)或为了便于测试直接关闭二... 查看详情

zabbix3.2.5编译安装部署

 LNMP基础环境安装下载mysql,为了更加快的部署采用的二进制安装包[[email protected]~]#wgethttp://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz 安装需要的依赖包[[email protected]~]#yum-yins 查看详情

6.6安装编译安装zabbix3.2

添加yum源get-O/etc/yum.repos.d/CentOS-Base.repohttp://mirrors.aliyun.com/repo/Centos-6.repo#安装阿里云yum源wget-P/etc/yum.repos.d/http://mirrors.aliyun.com/repo/epel-6.repo一、安装MySQL安装MySQLrpm-ivhhttp://dev.mys 查看详情

centos6.5编译安装zabbix3.2

centos6.5编译安装zabbix3.2 注意zabbix需要mysql、http、PHP为基础环境1.安装mysql5.7.17 1).解压:  tarxvfmysql-5.7.17-1.el6.x86_64.rpm-bundle.tar 2).移除已经安装的早期版本 如果不移除的话,会提示有冲突,版本可能有所不同&n... 查看详情

zabbix3.2安装graphtree3.0.4

...进行绘图二、安装及配置1、环境安装要求Zabbix软件版本:zabbix3.2.6操作系统:CentOS release 6.8&nb 查看详情

zabbix3.2安装graphtree3.0.4

...进行绘图二、安装及配置1、环境安装要求Zabbix软件版本:zabbix3.2.6操作系统:CentOS release 6.8&nb 查看详情

centos7.2安装zabbix3.2

一、安装 CentOS 7关闭selinux   #setenforce 0 临时关闭需要关闭 selinux,一定要关闭这个,开启selinux会引起一连串问题,甚至zabbix的discovery功能也不能正常使用# sed -i "s/SELINUX=enforcing/SELINU 查看详情

zabbix3.2.6安装过程

以3.2.6版本的Zabbix为例展开说明1、准备Lnmp环境。    本次准备的环境:        Linux:2.6.32-642.el6.x86_64        Nginx:1.12.0& 查看详情

zabbix3.2.6安装过程

以3.2.6版本的Zabbix为例展开说明1、准备Lnmp环境。    本次准备的环境:        Linux:2.6.32-642.el6.x86_64        Nginx:1.12.0& 查看详情

zabbix3.2生产环境安装部署

Zabbix3.2InstallationOnOEL6.51.安装PHP模块#rpm-Uvhhttp://mirror.webtatic.com/yum/el6/latest.rpm#yuminstallphp55wphp55w-bcmathphp55w-cliphp55w-commonphp55w-develphp55w-fpmphp55w-gdphp55w-imapphp55w-ldapphp 查看详情

zabbix3.2.1安装graphtrees插件

...在网上找了很多zatree插件的资料,但是好像没有找到支持zabbix3.2.1版本的插件。 查看详情

一键编译安装zabbix3.2.5server

公司计划使用zabbix监控所有产品服务器,现需要对zabbix进行测试!系统采用最小化安装,选包如下:BaseCompatibility librariesDebugging ToolsDevelopment tools系统信息如下:# cat /etc/redhat-release CentOS release 6 查看详情

centos7.3yum安装zabbix3.2

1、环境准备系统版本CentOSLinuxrelease7.3.1611(Core)IP192.168.10.602、zabbix安装2.1安装阿里云yum配置文件rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm2.2安装 查看详情