Firewall

如何使用防火牆為 zabbix 代理和伺服器配置埠訪問限制?

  • December 7, 2016

我的代理/伺服器配置正確,我知道這是因為它工作正常。我剛剛對代理端的防火牆進行了更改,限制了埠 10050 的訪問,但允許伺服器訪問,如下所示:

$ firewall-cmd --new-zone=zabbix
$ firewall-cmd --reload
$ firewall-cmd --get-zones
$ firewall-cmd --permanent --zone=zabbix --add-rich-rule='
 rule family="ipv4"
 source address="<<server_ip>>"
 port protocol="tcp" port="10050" accept'
$ firewall-cmd --reload
$ firewall-cmd --zone=zmonitor --list-all

現在有一個溝通問題。代理日誌報告以下內容:

no active checks on server [<<server_ip>>:10051]: host [<<hostname>>.local] not found

伺服器報告以下內容:

cannot send list of active checks to "<<agent_ip>>": host [<<hostname>>.local] not found

Zabbix Web Server 報告以下問題:

Get value from agent failed: cannot connect to [[<<Agent_IP>>]:10050]: [113] No route to host

有什麼問題--add-rich-rule

前兩個錯誤無關。他們告訴您主機名配置錯誤以進行主動檢查(並且從代理到伺服器的連接有效)。

最後一個錯誤似乎與防火牆無關,至少從錯誤消息來看 - “沒有到主機的路由”。這更有可能是路由/網路配置問題。

要驗證這一點,您可以嘗試暫時關閉代理盒上的防火牆並從伺服器遠端登錄到埠 10050 上的代理。

引用自:https://serverfault.com/questions/819026