日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

zabbix3.2学习笔记(二):服务端安装

發布時間:2023/12/19 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 zabbix3.2学习笔记(二):服务端安装 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

2019獨角獸企業重金招聘Python工程師標準>>>

一般小公司大多將zabbix web端和zabbix server部署在同一臺主機上,其實二者是可以分開的,web GUI配置連接到對應的數據庫就行,讓zabbix server和MySQL數據庫在同一臺主機上便于數據快速處理。

這里在centos 7.2 x86_64上依賴LNMP源碼編譯安裝zabbix3.2.7

1安裝php7.1

yum install -y epel-release
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

yum install -y php71w php71w-bcmath php71w-common php71w-cli php71w-mysql php71w-pdo php71w-gd php71w-fpm php71w-intl php71w-mbstring php71w-mcrypt php71w-xml php71w-xmlrpc php71w-opcache php71w-ldap php71w-pear

?

sed -i 's/post_max_size = 8M/post_max_size = 16M/g' /etc/php.ini
sed -i 's/max_input_time = 60/max_input_time = 300/g' /etc/php.ini
sed -i 's/max_execution_time = 30/max_execution_time = 300/g' /etc/php.ini
sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' /etc/php.ini
sed -i 's/;date.timezone =/date.timezone = PRC/g' /etc/php.ini

?

systemctl enable php-fpm
systemctl start php-fpm
systemctl status php-fpm

2,安裝nginx1.12.1

rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
yum install -y nginx

?

3,安裝mysql5.7.19

rpm -Uvh http://repo.mysql.com//mysql57-community-release-el7-7.noarch.rpm

yum install -y mysql-community-server mysql-community-devel

?

mysql的基礎配置(根據系統硬件配置)my.cnf

[client]
port = 3306
default-character-set=utf8

[mysqld]
port = 3306
skip-name-resolve
character-set-server=utf8
skip-external-locking
max_connections=1000
max_connect_errors=10
default-storage-engine=INNODB
innodb_buffer_pool_size = 512M
innodb_log_file_size = 128M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 2
innodb_lock_wait_timeout = 50
innodb_flush_method=O_DIRECT

default-time-zone = '+8:00'
event_scheduler=ON
open_files_limit=51200

systemctl enable mysqld
systemctl start mysqld
systemctl status mysqld

grep 'temporary password' /var/log/mysqld.log ?獲得臨時密碼
mysql -u root -p輸入密碼
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Uiop
@789'; ?修改為自己的root密碼

4,nginx和php的融合

mkdir -p /var/www/html/zabbix
chown -R nginx:nginx /var/www/html

vi /etc/nginx/conf.d/default.conf

#location / {
root /var/www/html;
index index.php index.html index.htm;
#}

location ~ \.php$ {
# root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcig_read_timeout 120;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

systemctl enable nginx
systemctl start nginx

echo '<?php phpinfo(); ?>' > /var/www/html/index.php

http://IP檢驗lnmp是否安裝成功

?

5,安裝zabbix server

zabbix只會以普通用戶運行,如果root環境下運行,zabbix會主動嘗試以zabbix身份運行,若系統沒有zabbix用戶需建立

groupadd zabbix
useradd -g zabbix zabbix

yum install -y net-snmp-devel curl curl-devel libxml2-devel
wget http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/3.2.7/zabbix-3.2.7.tar.gz
tar zxvf zabbix-3.2.7.tar.gz
cd zabbix-3.2.7
./configure --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2
make install

導入數據結構:
mysql -u root -p
mysql>create database zabbix character set utf8 collate utf8_bin;
mysql>use zabbix;
mysql>source /root/zabbix-3.2.7/database/mysql/schema.sql
mysql>source /root/zabbix-3.2.7/database/mysql/images.sql
mysql>source /root/zabbix-3.2.7/database/mysql/data.sql
mysql>grant all privileges on zabbix.* to 'zabbix'@'%' identified by 'Uiop!789';
mysql>flush privileges;
mysql>exit

修改zabbix server配置文件

vi /usr/local/etc/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=Uiop!789
DBSocket=/var/lib/mysql/mysql.sock


啟動zabbix_server

cp /root/zabbix-3.2.7/misc/init.d/fedora/core5/zabbix_server /etc/init.d/

chkconfig --add zabbix_server
chkconfig --list zabbix_server
chkconfig --level 35 zabbix_server on
service zabbix_server start/stop/restart

?

配置客戶端(監控sever本身)

vi /usr/local/etc/zabbix_agentd.conf
Server=127.0.0.1
ServerActive=127.0.0.1
Hostname=Zabbix server

啟動zabbix agent

cp /root/zabbix-3.2.7/misc/init.d/fedora/core5/zabbix_agentd /etc/init.d/
chkconfig --add zabbix_agentd
chkconfig --list zabbix_agentd
chkconfig --level 35 zabbix_agentd on
service zbbbix_agentd start/stop/restart

啟動客戶端(客戶端和服務端時間同步,設置crontab:0 0 * * * /usr/sbin/ntpdate -U 210.72.145.44)

?

客戶端獨立安裝zabbix_agentd(一般都是rpm包安裝)

wget http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/3.2.6/zabbix-3.2.6.tar.gz
tar zxvf zabbix-3.2.6.tar.gz
cd zabbix-3.2.6
./configure --enable-agent
make && make install

簡單安裝
rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-agent-3.2.7-1.el7.x86_64.rpm
rpm -ivh?http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-sender-3.2.7-1.el7.x86_64.rpm

?

這樣主機端安裝部署就成功了,隨后是zabbix web端的事情了。

在zabbix server主機拷貝前端文件

cd /root/zabbix-3.2.7
cp -rp frontends/php/* /var/www/html/zabbix/
chown nginx.nginx -R /var/www/html/zabbix/

根據以上設置直接http://IP/zabbix,即可看到前端配置提示,若自定義vhost后須重啟nginx

?

轉載于:https://my.oschina.net/u/2404183/blog/1511447

總結

以上是生活随笔為你收集整理的zabbix3.2学习笔记(二):服务端安装的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。