zabbix3.4 for centos7安裝

zabbix安裝部分

安裝zabbix 源
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm

zabbix服務器端安裝
yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-java-gateway zabbix-web

zabbix客戶端安裝
yum -y install zabbix-agent

導入 zabbix 所需信息
cd /usr/share/doc/zabbix-server-mysql-3.4.3

配置 zabbix 參數

主要是以下幾個選項參數需要設置(8GB 內存爲例):
DBPassword 配置爲第 12 步第 3 行中設置的自定義密碼

CacheSize=512M

(CacheSize在371行)

HistoryCacheSize=128M

(HistoryCacheSize在397行)

HistoryIndexCacheSize=128M

(HistoryIndexCacheSize在405行)

TrendCacheSize=128M

(TrendCacheSize在414行)

ValueCacheSize=256M

(ValueCacheSize在425行)

Timeout=30

(Timeout在432

其它參數保持默認值即可
如果需要監控VMware虛擬機,則還需要設置以下選項參數:
StartVMwareCollectors=2

(StartVMwareCollectors在272行

VMwareCacheSize=256M

(VMwareCacheSize 在298行)

VMwareTimeout=300

(VMwareTimeout在306行)

17、配置 Apache 中的 PHP 參數(8GB 內存爲例)
sudo vim /etc/httpd/conf.d/zabbix.conf

php_value max_execution_time 600

php_value memory_limit 256M

php_value post_max_size 32M

php_value upload_max_filesize 32M

php_value max_input_time 600

php_value always_populate_raw_post_data -1

date.timezone 去掉註釋符號#,並將值修改爲 Asia/Shanghai

18、重啓系統
systemctl stop mysqld && reboot

19、啓動 zbx
sudo systemctl start httpd && systemctl start zabbix-server

20、在瀏覽器中輸入 http://zbx監控服務器的IP地址/zabbix,進行 zabbix 的頁面初始化配置

這個頁面PHP設置要求全部OK

如果密碼輸錯,是跳轉不到下一步的。密碼是前面設置的 Qingdao@2017

注:第4步的”Zabbix server detail”頁面中,”Name”處可填寫對此監控系統的描述性文字,支持中文,有點像網站的名稱。

21、第一次登錄zbx監控系統,默認用戶名 admin,默認密碼 zabbix,確認可正常登錄系統。

22、登錄進入系統後,確認 Zabbix server is running 的值是 Yes。
然後選擇 Administrator –> Users –> Admin

23、回到”監測中” –> “儀表板”,就可以看到監控系統已設置爲中文界面了。

zabbix_agentd.exe命令說明
-c 制定配置文件所在位置
-i 安裝客戶端
-s 啓動客戶端
-x 停止客戶端
-d 卸載客戶端

zabbix_agent 監控 TCP/UDP協議

UserParameter=sockstat.sockets, netstat -ano | find /V "hola" /C
UserParameter=sockstat.tcp.inuse, netstat -ano | findstr ESTABLISHED
UserParameter=sockstat.tcp.inuse.count, netstat -ano | find /C "ESTABLISHED"
UserParameter=sockstat.tcp.orphan, netstat -ano | findstr CLOSE_WAIT
UserParameter=sockstat.tcp.orphan.count, netstat -ano | find /C "CLOSE_WAIT"
UserParameter=sockstat.tcp.timewait, netstat -ano | findstr TIME_WAIT
UserParameter=sockstat.tcp.timewait.count, netstat -ano | find /C "TIME_WAIT"
UserParameter=sockstat.tcp.allocated, netstat -ano | findstr LISTENING
UserParameter=sockstat.tcp.allocated.count, netstat -ano | find /C "LISTENING"
UserParameter=sockstat.udp.inuse, netstat -ano | findstr UDP
UserParameter=sockstat.udp.inuse.count, netstat -ano | find /C "UDP"

數據庫mysql參數配置
innodb_file_per_table = 1
innodb_status_file = 1
innodb_buffer_pool_size = 6G
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 16M
innodb_log_file_size = 64M
innodb_support_xa = 0
default-storage-engine = innodb
bulk_insert_buffer_size = 8M
join_buffer_size = 16M
max_heap_table_size = 32M
tmp_table_size = 32M
max_tmp_tables = 48
read_buffer_size = 32M
read_rnd_buffer_size = 16M
key_buffer_size = 32M
thread_cache_size = 32
innodb_thread_concurrency = 8
innodb_flush_method = O_DIRECT
innodb_rollback_on_timeout = 1
query_cache_size = 16M
query_cache_limit = 16M
collation_server = utf8_bin
character_set_server = utf8

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章