亚洲视频二区_亚洲欧洲日本天天堂在线观看_日韩一区二区在线观看_中文字幕不卡一区

公告:魔扣目錄網(wǎng)為廣大站長提供免費(fèi)收錄網(wǎng)站服務(wù),提交前請(qǐng)做好本站友鏈:【 網(wǎng)站目錄:http://www.430618.com 】, 免友鏈快審服務(wù)(50元/站),

點(diǎn)擊這里在線咨詢客服
新站提交
  • 網(wǎng)站:51998
  • 待審:31
  • 小程序:12
  • 文章:1030137
  • 會(huì)員:747

目錄
  • 問題
  • 排查
  • 解決

今天跟大家分享一個(gè)關(guān)于 zabbix Timeout 值設(shè)置不當(dāng)導(dǎo)致的問題,這個(gè)問題不知道大家有沒有碰到過

問題

事情經(jīng)過是這樣的:

把某一臺(tái) zabbix agent 的模板由原來的 Template OS Windows by Zabbix agent 換成了 Template OS Windows by Zabbix agent active

Zabbix?Timeout?設(shè)置不當(dāng)導(dǎo)致的問題及解決方案

Template OS Windows by Zabbix agent active 使用 主動(dòng)模式 主動(dòng)獲取數(shù)據(jù)

Template OS Windows by Zabbix agent 使用 被動(dòng)模式 等待 Server 請(qǐng)求數(shù)據(jù)

也就是說在主動(dòng)模式下,Zabbix Agent 主動(dòng)連接到 Zabbix Server 并發(fā)送監(jiān)控?cái)?shù)據(jù),Zabbix Server 只需監(jiān)聽指定的端口,接收 Agent 發(fā)送過來的數(shù)據(jù)

結(jié)果發(fā)現(xiàn) zabbix server 接收不到數(shù)據(jù)

排查

查看 agent 日志(/var/log/zabbix/zabbix_agentd.log),發(fā)現(xiàn) ZBX_TCP_READ() timed out

8452:20230620:134942.947 active check configuration update from [192.168.149.129:10051] started to fail (ZBX_TCP_READ() timed out) 8452:20230620:135044.072 active check configuration update from [192.168.149.129:10051] is working again 8452:20230620:140049.959 active check configuration update from [192.168.149.129:10051] started to fail (ZBX_TCP_READ() timed out) 8452:20230620:140149.093 active check configuration update from [192.168.149.129:10051] is working again

而且經(jīng)過進(jìn)一步排查,發(fā)現(xiàn):

  • server 節(jié)點(diǎn)運(yùn)行正常,agent 節(jié)點(diǎn)正常運(yùn)行
  • server 節(jié)點(diǎn)和 agent 節(jié)點(diǎn)之間可以 ping 通,而且 Telnet 端口可用

綜合上面的現(xiàn)象,懷疑是網(wǎng)絡(luò)原因?qū)е?TCP 建立連接時(shí)間超時(shí),agent 向 server 發(fā)送數(shù)據(jù)失敗

既然是網(wǎng)絡(luò)原因,那為什么我在修改模板(即被動(dòng)模式)之前,server 是能夠向 agent 獲取數(shù)據(jù)的

怎么被動(dòng)模式就沒超時(shí),主動(dòng)模式就超時(shí)了呢?

解決

在 Zabbix 中,timeout(超時(shí))是指在進(jìn)行監(jiān)控?cái)?shù)據(jù)獲取或傳輸時(shí),等待響應(yīng)的時(shí)間限制

在配置文件中如下所示,默認(rèn)值是 3 s

### Option: Timeout
#       Spend no more than Timeout seconds on processing
# Timeout=3

我們分別來看下 server 和 agent 關(guān)于超時(shí)時(shí)間的配置

#server 端
Timeout=30

#agent 端
Timeout=3

可以看到,sever 端設(shè)置的超時(shí)時(shí)間是 30 s,agent 端設(shè)置的超時(shí)時(shí)間是 3s,這兩個(gè)時(shí)間相差太大了吧

如果 agent 的 timeout 設(shè)置得太短,可能會(huì)導(dǎo)致一些請(qǐng)求無法完成;而如果 server 的 timeout 設(shè)置得太短,可能會(huì)導(dǎo)致 agent 的請(qǐng)求被錯(cuò)誤地判定為超時(shí)

結(jié)合上面的情況,可以得知:

  • 主動(dòng)模式下,agent 向 server 發(fā)送數(shù)據(jù)的時(shí)候,agent 端設(shè)置的超時(shí)時(shí)間是 3s,有可能會(huì)出現(xiàn)網(wǎng)絡(luò)原因?qū)е?TCP 建立連接時(shí)間超時(shí),server 端獲取不到數(shù)據(jù),就會(huì)出現(xiàn)上面的問題
  • 被動(dòng)模式下,server 向 agent 獲取數(shù)據(jù),但是 server 端設(shè)置的超時(shí)時(shí)間是 30s,這個(gè)超時(shí)時(shí)間可以說是非常大了

我們把 agent 端的超時(shí)時(shí)間改一下,跟 server 端一致

#agent 端

Timeout=30

重啟 agent 后發(fā)現(xiàn)日志沒有報(bào) started to fail (ZBX_TCP_READ() timed out) 錯(cuò),zabbix server 端也能夠獲取數(shù)據(jù)了

Zabbix?Timeout?設(shè)置不當(dāng)導(dǎo)致的問題及解決方案

總結(jié)一下:

  • 在 Zabbix 中,timeout 是指在進(jìn)行監(jiān)控?cái)?shù)據(jù)獲取或傳輸時(shí),等待響應(yīng)時(shí)間的限制
  • Agent 和 Server 之間的超時(shí)時(shí)間設(shè)置應(yīng)該相互協(xié)調(diào),并根據(jù)實(shí)際網(wǎng)絡(luò)狀況和環(huán)境來進(jìn)行調(diào)整。如果 Agent 的 timeout 設(shè)置得太短,可能會(huì)導(dǎo)致一些請(qǐng)求無法完成;而如果 Server 的 timeout 設(shè)置得太短,可能會(huì)導(dǎo)致 Agent 的請(qǐng)求被錯(cuò)誤地判定為超時(shí)
  • 主動(dòng)模式下 agent 的 timeout 值最好高于 server 配的 timeout 值,被動(dòng)模式下 server 配的 timeout 值最好高于 agent 的 timeout

If used with the passive agent, Timeout value in server configuration may need to be higher than Timeout in the agent configuration file. Otherwise the item may not get any value because the server request to agent timed out first.

分享到:
標(biāo)簽:不當(dāng) 導(dǎo)致 服務(wù)器 解決方案 設(shè)置
用戶無頭像

網(wǎng)友整理

注冊(cè)時(shí)間:

網(wǎng)站:5 個(gè)   小程序:0 個(gè)  文章:12 篇

  • 51998

    網(wǎng)站

  • 12

    小程序

  • 1030137

    文章

  • 747

    會(huì)員

趕快注冊(cè)賬號(hào),推廣您的網(wǎng)站吧!
最新入駐小程序

數(shù)獨(dú)大挑戰(zhàn)2018-06-03

數(shù)獨(dú)一種數(shù)學(xué)游戲,玩家需要根據(jù)9

答題星2018-06-03

您可以通過答題星輕松地創(chuàng)建試卷

全階人生考試2018-06-03

各種考試題,題庫,初中,高中,大學(xué)四六

運(yùn)動(dòng)步數(shù)有氧達(dá)人2018-06-03

記錄運(yùn)動(dòng)步數(shù),積累氧氣值。還可偷

每日養(yǎng)生app2018-06-03

每日養(yǎng)生,天天健康

體育訓(xùn)練成績?cè)u(píng)定2018-06-03

通用課目體育訓(xùn)練成績?cè)u(píng)定