真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

Zabbix3.2監(jiān)控部署

一、準(zhǔn)備工作

靈丘網(wǎng)站建設(shè)公司成都創(chuàng)新互聯(lián),靈丘網(wǎng)站設(shè)計(jì)制作,有大型網(wǎng)站制作公司豐富經(jīng)驗(yàn)。已為靈丘數(shù)千家提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\成都外貿(mào)網(wǎng)站建設(shè)要多少錢,請找那個(gè)售后服務(wù)好的靈丘做網(wǎng)站的公司定做!

1.系統(tǒng)環(huán)境

系統(tǒng):CentOS 6.8 X86_64

MySQL:5.7.12

Apache:2.4.20

PHP:7.1.4

Zabbix:3.2.6

2.安裝所需環(huán)境

[root@Kry133 ~]# rpm -ivh http://www.lishiming.net/data/p_w_upload/forum/epel-release-6-8_64.noarch.rpm

[root@Kry133 ~]# yum -y install gcc ?gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel ?libmcrypt-devel net-snmp-devel OpenIPMI-devel

二、安裝LAMP環(huán)境

1.mysql安裝

[root@Kry133 src]# tar zxvf mysql-5.7.12-linux-glibc2.5-x86_64.tar.gz

[root@Kry133 src]# mv mysql-5.7.12-linux-glibc2.5-x86_64 /usr/local/mysql

[root@Kry133 src]# useradd mysql -s /sbin/nologin -M

[root@Kry133 src]# chown -R mysql.mysql /usr/local/mysql/

[root@Kry133 src]# cd ?/usr/local/mysql/

[root@Kry133 mysql]# cp support-files/my-default.cnf ?/etc/my.cnf

[root@Kry133 mysql]# vim /etc/my.cnf

[mysqld]
?basedir = /usr/local/mysql
?datadir = /data/mysql
?port = 3306
?socket = /tmp/mysql.sock
?pid-file = /data/mysql/mysqld.pid
?log-error=/var/log/mysqld.err.log

[root@Kry133 mysql]# mkdir /data ?#/data/mysql目錄在初始時(shí)自動(dòng)創(chuàng)建

[root@Kry133 mysql]# ./bin/mysqld --initialize --user=mysql --datadir=/data/mysql #初始化

[root@Kry133 mysql]# cp support-files/mysql.server /etc/init.d/mysqld

[root@Kry133 mysql]# chkconfig --add mysqld

[root@Kry133 mysql]# chkconfig --level 35 mysqld on

[root@Kry133 mysql]# service mysqld start

[root@Kry133 mysql]# ?vim /etc/profile.d/mysql.sh

#!/bin/bash
export PATH=$PATH:/usr/local/mysql/bin:/usr/local/mysql/lib

[root@Kry133 mysql]# source /etc/profile.d/mysql.sh

[root@Kry133 mysql]# mysql -uroot -p'4qS5&qd%z=Qy'

mysql> set password = password('123123'); ?#修改密碼

2.安裝httpd

[root@Kry133 src]# wget?http://mirror.bit.edu.cn/apache/apr/apr-util-1.5.4.tar.bz2

[root@Kry133 src]#?wget?http://mirror.bit.edu.cn/apache/apr/apr-1.5.2.tar.bz2

[root@Kry133 src]# tar jxvf apr-1.5.2.tar.bz2 && tar jxvf apr-util-1.5.4.tar.bz2

[root@Kry133 src]# tar jxvf httpd-2.4.20.tar.bz2

[root@Kry133 src]# mv apr-1.5.2 ./httpd-2.4.20/srclib/apr

[root@Kry133 src]# mv apr-util-1.5.4 ./httpd-2.4.20/srclib/apr-util

[root@Kry133 src]# tar jxvf pcre-8.35.tar.bz2

[root@Kry133 src]# cd pcre-8.35

[root@Kry133 pcre-8.35]# ./configure && make && make install

[root@Kry133 src]# cd ?httpd-2.4.20

[root@Kry133 src]# mkdir /usr/local/apache2.4

[root@Kry133 httpd-2.4.20]# ./configure --prefix=/usr/local/apache2.4 --with-included-apr --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared

[root@Kry133 httpd-2.4.20]# make && make install

[root@Kry133 httpd-2.4.20]# cd ?/usr/local/apache2.4/

[root@Kry133 apache2.4]# vim ?conf/httpd.conf

ServerName localhost:80

[root@Kry133 apache2.4]# cp bin/apachectl /etc/init.d/httpd

[root@Kry133 apache2.4]# vim /etc/init.d/httpd

#chkconfig: 35 85 15
#description: apache

[root@Kry133 apache2.4]# chkconfig --add httpd

[root@Kry133 apache2.4]# chkconfig --level 35 httpd on

[root@Kry133 apache2.4]# service ?httpd start

3.安裝PHP

[root@Kry133 src]# wget http://cn2.php.net/distributions/php-7.1.4.tar.gz

[root@Kry133 src]# tar zxvf php-7.1.4.tar.gz

[root@Kry133 php-7.1.4]# mkdir /usr/local/php

[root@Kry133 php-7.1.4]# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2.4/bin/apxs --with-config-file-path=/usr/local/php/etc --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-curl --with-gettext --enable-ftp --enable-mbstring --enable-bcmath --with-gd --enable-gd-native-ttf --with-openssl --enable-sockets --enable-soap --with-libxml-dir --with-iconv-dir --with-bz2 --disable-ipv6 --enable-calendar --enable-dom --enable-xml --enable-fpm --with-libdir=lib64

[root@Kry133 php-7.1.4]# make && make install

[root@Kry133 php-7.1.4]# cd ?/usr/local/apache2.4/

[root@Kry133 apache2.4]# vim ?conf/httpd.conf

找到:
AddType application/x-gzip .gz .tgz
在該行下添加:
AddType application/x-httpd-php .php

找到:

? ? DirectoryIndex index.html

將該行改為

? ? DirectoryIndex index.html index.htm index.php

[root@Kry133 apache2.4]# service httpd restart

三、Zabbix 部署

1.安裝zabbix

[root@Kry133 src]# tar zxvf zabbix-3.2.6.tar.gz

[root@Kry133 src]# cd zabbix-3.2.6

[root@Kry133 zabbix-3.2.6]# useradd ?-s /sbin/nologin -M ?zabbix

[root@Kry133 zabbix-3.2.6]# mkdir /usr/local/zabbix

[root@Kry133 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

[root@Kry133 zabbix-3.2.6]# make && make install

[root@Kry133 zabbix-3.2.6]# cp -r frontends/php /usr/local/apache2.4/htdocs/zabbix

[root@Kry133 zabbix-3.2.6]# vim ?/usr/local/zabbix/etc/zabbix_server.conf

DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
ListenIP=0.0.0.0

[root@Kry133 zabbix-3.2.6]# cp misc/init.d/fedora/core/zabbix_server ?/etc/init.d/zabbix

[root@Kry133 zabbix-3.2.6]# chkconfig --add zabbix

[root@Kry133 zabbix-3.2.6]# chkconfig --level 35 zabbix on

[root@Kry133 zabbix-3.2.6]# service zabbix start

2.配置數(shù)據(jù)庫

[root@Kry133 zabbix-3.2.6]# mysql -uroot -p

mysql>create database?zabbix character?set?utf8 collate utf8_bin;

mysql>grant?all on zabbix.*to zabbix@localhost identified by 'zabbix';

mysql>flush privileges;

[root@Kry133 zabbix-3.2.6]# mysql -uzabbix -pzabbix ?zabbix < database/mysql/schema.sql

[root@Kry133 zabbix-3.2.6]# mysql -uzabbix -pzabbix ?zabbix < database/mysql/p_w_picpaths.sql

[root@Kry133 zabbix-3.2.6]# mysql -uzabbix -pzabbix ?zabbix < database/mysql/data.sql

3.配置PHP

[root@Kry133 zabbix-3.2.6]# cd ?../php-7.1.4

[root@Kry133 php-7.1.4]# cp php.ini-production ?/usr/local/php/etc/

[root@Kry133 php-7.1.4]# vim /etc/php.ini

bcmath.scale = 1
max_execution_time = 300
memory_limit = 128M
post_max_size = 16M
upload_max_filesize = 2M
max_input_time = 300
date.timezone = PRC

[root@Kry133 php-7.1.4]# service httpd restart

4.zabbix 網(wǎng)頁配置

瀏覽器訪問 Zabbix Server ip/zabbix

Zabbix 3.2 監(jiān)控部署Zabbix 3.2 監(jiān)控部署Zabbix 3.2 監(jiān)控部署Zabbix 3.2 監(jiān)控部署

Zabbix 3.2 監(jiān)控部署

Zabbix 3.2 監(jiān)控部署

四、擴(kuò)展內(nèi)容

1.PHP 擴(kuò)展:

名稱參數(shù)選擇
bcmath--enable-bcmath必須
mbstring--enable-mbstring必須
sockets--enable-sockets必須
gd--with-gd必須
libxml--with-libxml-dir必須
xmlwriter--with-libxml-dir必須
xmlreader--with-libxml-dir必須
ctype默認(rèn)支持必須
session默認(rèn)支持必須
gettext默認(rèn)支持必須
mysqli--with-mysqli=mysqlnd推薦

2.Zabbix 特殊監(jiān)控選項(xiàng):

名稱描述參數(shù)
OpenIPMIIPMI硬件監(jiān)控--with-openipmi
libssh3SSH支持--with-ssh3
fpingICMP監(jiān)控外部安裝
libcurl監(jiān)控web項(xiàng)--with-libcurl
libiksemel支持jabber告警外部安裝
net-snmpSNMP監(jiān)控支持--with-net-snmp
javajava進(jìn)程監(jiān)控--enable-java

五、FAQ

1.mysql啟動(dòng)時(shí)報(bào)一下錯(cuò)誤;

/usr/libexec/mysqld: Can't find file: './mysql/plugin.frm'

解決辦法:關(guān)閉selinux

2.登錄zabbix web頁面報(bào)以下錯(cuò)誤;

A non well formed numeric value encountered [zabbix.php:21 → require_once() → ZBase->run() → ZBase->proce***equest() → CView->getOutput() → include() → make_status_of_zbx() → CFrontendSetup->checkRequirements() → CFrontendSetup->checkPhpMemoryLimit() → str2mem() in include/func.inc.php:410]

原因:因?yàn)镻HP 7.1.4 類型強(qiáng)化

解決辦法:

[root@Kry133 sbin]# sed -i '/$last = strtolower(substr($val, -1));/a$val = substr($val,0,-1);' /usr/local/apache2.4/htdocs/zabbix/include/func.inc.php

3.啟動(dòng)zabbix_server 端口沒監(jiān)聽,web頁面顯示服務(wù)沒運(yùn)行,查看日志報(bào)以下錯(cuò)誤;

Is this process already running? Could not lock PID file [/tmp/zabbix_server.pid]: [11] Resource temporarily unavailable

解決辦法:rm -rf /tmp/zabbix_server.pid ?,再執(zhí)行zabbix_server,服務(wù)器啟動(dòng)正常。

4.啟動(dòng)報(bào)錯(cuò)zabbix 服務(wù)報(bào)以下錯(cuò)誤;

error while loading shared libraries: libmysqlclient.so.20: cannot open shared object file: No such file or directory

解決辦法:

[root@Kry133 sbin]# ln -s ?/usr/local/mysql/lib/libmysqlclient.so.20 ?/lib64/libmysqlclient.so.20

[root@Kry133 sbin]# echo "/usr/local/mysql/lib" >> ?/etc/ld.so.conf

5.zabbix 服務(wù)啟動(dòng)正常,日志報(bào)錯(cuò)以下內(nèi)容;

8779:20170512:085715.539 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO)

?8779:20170512:085715.539 database is down: reconnecting in 10 seconds

解決辦法:修改 /usr/local/zabbix/etc/zabbix_server.conf 中 ListenIP=0.0.0.0

6.web頁面出現(xiàn)亂碼

解決辦法:

①.在本地找到C:\Windows\Fonts\simkai.ttf,上傳到zabbix網(wǎng)站目錄fonts目錄下.

②.修改zabbix php配置文件

[root@Kry133 zabbix]# sed -i 's/DejaVuSans/simkai/g' include/defines.inc.php

以上操作未能解決亂碼問題

創(chuàng)建數(shù)據(jù)庫指定字符集

create database zabbix default charset utf8;

或者my.cnf增加

default-character-set = utf8


當(dāng)前題目:Zabbix3.2監(jiān)控部署
網(wǎng)址分享:http://weahome.cn/article/jgjidc.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部