ИнтеграцииСеть и межсетевые экраны
Мониторинг pfSense в DumbMonit
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
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.pkgSystem → REST API → Settings: tick both BasicAuth and Key among the authentication methods.
System → User Manager → Users → Add: create the user dumbmonit with a long random password.
Edit the user and, under Assigned Privileges, add the privileges listed below.
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/keyIn 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.