DumbMonit

集成网络和防火墙

用 DumbMonit 监控 pfSense

A pfSense firewall through its REST API package: gateways down or losing packets, interfaces without link, stopped services, CPU, memory and disk.

文档官方网站:pfSense

产品说明为英文,与产品内一致。页面标签使用您的语言。

DumbMonit 监控的内容

A pfSense firewall through the community REST API package (pfSense-pkg-RESTAPI, version 2): gateways that are down, lose packets or answer slowly, enabled interfaces without link, enabled services that stopped, and CPU, memory, disk and temperature. DumbMonit sends an API key in the X-API-Key header. A key carries exactly the privileges of the pfSense user it belongs to: the dumbmonit user below holds only the GET privileges of the five pages DumbMonit reads, so the key can read those pages and change nothing. Every minute DumbMonit reads, in parallel, /api/v2/status/system, /api/v2/status/gateways, /api/v2/status/interfaces, /api/v2/status/services and /api/v2/system/version, and, if the…

典型用途. Firewall: gateways down or lossy, interfaces without link, stopped services

示例

  • pfSense CE
  • pfSense Plus
  • Netgate appliance

连接方式

您需要准备

  • REST API keyThe key created for the dumbmonit user: it carries only that user's read privileges.

需要开放的网络端口

  • 443/TCPAPI (HTTPS, default)
  • 80/TCPOnly with the HTTP protocol option
设置步骤: Create a read-only REST API key for DumbMonit
  1. Install the pfSense-pkg-RESTAPI package (version 2) from Diagnostics → Command Prompt, with the file matching your pfSense version (2.7.2 below).

    pkg-static add https://github.com/pfrest/pfSense-pkg-RESTAPI/releases/latest/download/pfSense-2.7.2-pkg-RESTAPI.pkg
  2. System → REST API → Settings: tick both BasicAuth and Key among the authentication methods.

  3. System → User Manager → Users → Add: create the user dumbmonit with a long random password.

  4. Edit the user and, under Assigned Privileges, add the privileges listed below.

  5. Create the key as dumbmonit, copy the key value of the answer, then remove the POST privilege again.

    curl -k -u dumbmonit -X POST -H 'Content-Type: application/json' -d '{"descr":"DumbMonit"}' https://pfsense.lan/api/v2/auth/key
  6. In DumbMonit, enter the pfSense address (pfsense.lan) and paste the key as API key.

注意. The REST API package is a community project, not part of pfSense: reinstall it after each pfSense upgrade. pfSense ships a self-signed certificate: tick "Accept an unverifiable certificate" unless you replaced it.