環(huán)境:
創(chuàng)新互聯(lián)專注于網(wǎng)站建設|成都網(wǎng)站維護公司|優(yōu)化|托管以及網(wǎng)絡推廣,積累了大量的網(wǎng)站設計與制作經(jīng)驗,為許多企業(yè)提供了網(wǎng)站定制設計服務,案例作品覆蓋成都柔性防護網(wǎng)等行業(yè)。能根據(jù)企業(yè)所處的行業(yè)與銷售的產(chǎn)品,結(jié)合品牌形象的塑造,量身開發(fā)品質(zhì)網(wǎng)站。
zabbix-server:192.168.216.8
zabbix-proxy:192.168.216.7
zabbix-agent:192.168.216.2
一、zabbix-server:參照zabbix3.0安裝
配置proxy:
1、
2、
3
4
二、zabbix-proxy
1、數(shù)據(jù)庫安裝配置
[root@zabbix-server zabbix]# yum isntall mariadb-server -y [root@zabbix-server zabbix]# systemctl start mariadb.service MariaDB [(none)]> CREATE DATABASE proxy;#創(chuàng)建proxy庫 MariaDB [(none)]> GRANT ALL PRIVILEGES ON proxy.* TO proxy@'127.0.0.1' IDENTIFIED BY 'proxypass';#授權proxy MariaDB [(none)]> FLUSH PRIVILEGES;#刷新 [root@zabbix-server zabbix]# gizp -d /usr/share/doc/zabbix-proxy-MySQL-3.0.5/schema.sql.gz#解壓schema.sql.gz [root@zabbix-server zabbix]# mysql -u proxy -p -h227.0.0.1 proxy < /usr/share/doc/zabbix-proxy-mysql-3.0.5/schema.sql#把schema.sql導入到數(shù)據(jù)庫proxy中
2、配置zabbix-proxy并安裝
[root@zabbix-server zabbix]# yum isntall zabbix-get zaabix-sender zabbix-proxy-mysql [root@zabbix-server zabbix]# grep -v "^#" zabbix_proxy.conf Server=192.168.216.8 #zabbix-service Hostname=p1.xiaosheng.com#定義全局唯一標示與proxies的hostname一致 LogFile=/var/log/zabbix/zabbix_proxy.log LogFileSize=0 PidFile=/var/run/zabbix/zabbix_proxy.pid DBHost=127.0.0.1#定義數(shù)據(jù)庫地址 DBName=proxy#定義數(shù)據(jù)庫庫 DBUser=proxy#定義數(shù)據(jù)庫用戶名 DBPassword=proxypass#定義數(shù)據(jù)庫密碼 DBSocket=/var/lib/mysql/mysql.sock#定義數(shù)據(jù)庫sock ProxyOfflineBuffer=2#離線緩存時長,默認2個小時 ConfigFrequency=10#拉取zabbix-server時長,默認秒 SNMPTrapperFile=/var/log/snmptrap/snmptrap.log Timeout=4 ExternalScripts=/usr/lib/zabbix/externalscripts LogSlowQueries=3000
三、配置zabbix-agent并配置
[root@ansible-zproxy zabbix]# yum install zabbix-agent zabbix-get zabbix-sender [root@ansible-zproxy zabbix]# grep -v "^#" zabbix_agentd.conf PidFile=/var/run/zabbix/zabbix_agentd.pid LogFile=/var/log/zabbix/zabbix_agentd.log LogFileSize=512 EnableRemoteCommands=1 LogRemoteCommands=1 Server=127.0.0.1, 192.168.216.7#定義被動允許get的主機 ServerActive=127.0.0.1, 192.168.216.7#定義主動sender的主機 Hostname=Zabbix server Include=/etc/zabbix/zabbix_agentd.d/