2024/07/08

Zabbix 監控 Fortigate Firewall

 

 方式一:使用官方提供的 Template 來監控

 官方說明網址:https://www.zabbix.com/integrations/fortinet

 Template 下載:https://git.zabbix.com/projects/ZBX/repos/zabbix/raw/templates/net/fortinet/fortigate_http/template_net_fortigate_http.yaml?at=refs%2Fheads%2Frelease%2F7.0

  1. On the FortiGate GUI, select System > Admin Profiles > Create New.
  2. Enter a profile name (ex. zabbix_ro) and enable all the Read permissions. Please note the profile name, it will be used a bit later.
  3. Go to System > Administrators > Create New > REST API Admin.
  4. Enter the API-user's name and select the profile name you created in step 2.
  5. The trusted host can be specified to ensure that only Zabbix server can reach the FortiGate.
  6. Click OK and an API token will be generated. Make a note of the API token as it's only shown once and cannot be retrieved.
  7. Put the API token into {$FGATE.API.TOKEN} macro.
  8. Set your FortiGate GUI IP/FQDN as {$FGATE.API.FQDN} macro value.
  9. If FortiGate GUI uses HTTPS, put https value into {$FGATE.SCHEME} macro and 443 into {$FGATE.API.PORT} macro.
  10. If FortiGate GUI port differs from the standard one, specify it in {$FGATE.API.PORT} macro.

方法都提供好了,但是 Template 在 import 的時候出現錯誤,無法匯入


 

方式二:使用 FortiGate by SNMP 

Step 1:在 FortiGate 中啟用 SNMP 並且設定 Community

Step 2:在 Fortigate 的 Interface 中啟用 SNMP (預設是沒開啟)

要在需要開啟的 interface 中,啟用 SNMP 才能使用 snmpget 從 Forti 中取得資料

 

點開要允許 SNMP 通過的 Interface


Step 3:在 Zabbix Server 中新增 Host

正常在 Data Collection 的 Host 中會出現綠色的 SNMP,表示已可以透過SNMP取得資料

若無仍無法正確地取得SNMP資料,請重啟 Fortigate 的 SNMP,也就是下圖的停用再啟用

 

我就是卡在最後這個地方,重啟後才能正確得到 SNMP 資料

~END



沒有留言:

張貼留言

Ubuntu 如何查看及變更時區 TimeZone

使用指令 timedatectl 查看目前 ubuntu 的時區設定 $ timedatectl 列出所有 Asia 的時區 $ timedatectl list-timezones | grep Asia 變更時區為 Asia/Taipei $ sudo timedatectl...