您好,登錄后才能下訂單哦!
編寫shell腳本
#!/bin/bash
A=`cat -n /etc/zabbix/zabbix_proxy.conf | grep StartPollers= | awk '{print $1}'`
B=`cat -n /etc/zabbix/zabbix_proxy.conf | grep StartTrappers= | awk '{print $1}'`
C=`cat -n /etc/zabbix/zabbix_proxy.conf | grep StartDBSyncers= | awk '{print $1}'`
D=`cat -n /etc/zabbix/zabbix_proxy.conf | grep StartPingers= | awk '{print $1}'`
E=`cat -n /etc/zabbix/zabbix_proxy.conf | grep StartPollersUnreachable= | awk '{print $1}'`
F=`cat -n /etc/zabbix/zabbix_proxy.conf | grep StartDiscoverers= | awk '{print $1}'`
H=`cat -n /etc/zabbix/zabbix_proxy.conf | grep HistoryCacheSize= | awk '{print $1}'`
sed -i ''"$A"'c StartPollers=500' /etc/zabbix/zabbix_proxy.conf
sed -i ''"$B"'c StartTrappers=200' /etc/zabbix/zabbix_proxy.conf
sed -i ''"$C"'c StartDBSyncers=50 ' /etc/zabbix/zabbix_proxy.conf
sed -i ''"$D"'c StartPingers=500' /etc/zabbix/zabbix_proxy.conf
sed -i ''"$E"'c StartPollersUnreachable=500' /etc/zabbix/zabbix_proxy.conf
sed -i ''"$F"'c StartDiscoverers=120' /etc/zabbix/zabbix_proxy.conf
sed -i ''"$H"'c HistoryCacheSize=512M' /etc/zabbix/zabbix_proxy.conf
配置文件參數優化
Server=192.168.X.X ? ? ?#zabbix-server的ip
ServerPort=10051
Hostname=zabbix_proxy_192.168.X.X ? # 一定要和web界面的主機名一致
LogFile=/var/log/zabbix/zabbix_proxy.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_proxy.pid
SocketDir=/var/run/zabbix
DBName=zabbix_proxy
DBUser=zabbix
DBPassword=XXXXXX
ProxyLocalBuffer=720
ProxyOfflineBuffer=1
ConfigFrequency=60
DataSenderFrequency=1
StartPollers=1000
StartPollersUnreachable=500
StartTrappers=200
StartPingers=500
StartDiscoverers=120
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
CacheSize=3G
StartDBSyncers=100
HistoryCacheSize=1G
Timeout=30
ExternalScripts=/usr/lib/zabbix/externalscripts
LogSlowQueries=3000
Zabbix_Proxy.conf配置文件參數詳解:
ProxyMode //Proxy工作模式,默認為主動模式,主動發送數據至Server;
Server //指定Server端地址;
ServerPort //Server端PORT;
Hostname //Proxy端主機名;
ListenPort //Proxy端監聽端口;
LogFile //Proxy代理端日志路徑;
PidFile //PID文件的路徑;
DBHost //Proxy端數據庫主機名;
DBName //Proxy端數據庫名稱;
DBUser //Proxy端數據庫用戶;
DBPassword //Proxy端數據庫密碼;
DBSocket //Proxy數據庫SOCKET路徑;
DBPort //Proxy數據庫端口號;
ConfigFrequency=60 #zabbix proxy從zabbix server取得配置數據的頻率
DataSenderFrequency //Proxy向Server發送數據的時間間隔;
StartPollers //Proxy程池數量;
StartDiscoverers //Proxy端自動發現主機的線程數量;
CacheSize //內存緩存配置;
StartDBSyncers //同步數據線程數;
HistoryCacheSize //歷史數據緩存大小;
LogSlowQueries //慢查詢日志記錄,單位為毫秒;
Timeout //超時時間;
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。