NetPulse is OpenWrt-first. The native agent belongs on an OpenWrt router when that is possible, and the server stays a small self-contained Go binary.
Other router families can integrate without adding their vendor API, authentication, parsers or polling loops to the NetPulse server. The recommended model is a separate Go agent, maintained by somebody who owns and tests the hardware.
Integrations live in the central netpulse-integrations repository, one directory per vendor. The repository owner chooses maintainers by directory through CODEOWNERS. This keeps code, tests, releases and hardware notes discoverable without growing the server or scattering dozens of small repositories.
This document is for contributors building that kind of integration.
Vendor router API
|
| vendor-specific client and parsers
v
<vendor>-pusher, in netpulse-integrations/<vendor>
|
| HTTPS, probe.Payload, Bearer token + HMAC
v
NetPulse POST /api/ingest/agent
|
v
Normal fleet state, history and UI
The external agent usually runs on any always-on host that can reach both the router and NetPulse. It can be a small static binary managed by systemd. The Asuswrt/Merlin pusher runs on the router itself. Docker is optional, never a requirement.
The split of responsibility is deliberate:
| Integration directory | NetPulse core |
|---|---|
| Vendor authentication and sessions | External agent registration and tokens |
| Vendor endpoints, retries and quirks | Signed ingestion and replay protection |
| Fixtures and parser tests | Canonical payload contract |
| Mapping to neutral NetPulse fields | Fleet identity, freshness, history and UI |
| Vendor-specific releases and compatibility | Neutral contract extensions when needed |
| Validation on the real router | Review of core changes and generic behavior |
A vendor integration is not a reason to make the NetPulse server larger for every user. It is also not a reason to build a second monitoring server. The external agent should translate into the existing ingestion contract.
The catalog entry declares one of three modes, and the mode decides who installs and supervises the process (#2272):
| Mode | Who installs it | Who supervises it |
|---|---|---|
local |
NetPulse downloads the release and extracts the binary on the server host | NetPulse, as a managed child process |
ssh |
NetPulse installs it inside the router over SSH | The router's init system |
node |
The operator, on the monitored host | The operator, on the monitored host |
node exists for pushers that must read the machine they describe and cannot live on the NetPulse server: a Kubernetes node that reads its own kubelet and /proc, a Docker host, a storage box. The Integrations page still registers the row, issues the ingest token and shows the environment to set (NETPULSE_SERVER, NETPULSE_TOKEN, NETPULSE_SLUG, NETPULSE_INTERVAL and the TLS pin keys when the URL needs one), but the server never downloads, installs, starts or stops anything there. Start and stop answer not_managed, update only refreshes the published version so the page can point at the download, and the row stays pending until the pusher's first push makes it live.
Open an issue before implementing a core change or proposing a new integration for the documentation. Include:
Follow the hardware evidence rules in CONTRIBUTING.md. A new router family, protocol or vendor API needs real fixtures, explicit gaps and a public validation history. Do not replace missing evidence with simulated success.
Start read-only. A useful first slice normally contains only data that already fits the contract:
data.system.data.wan, with its optional ipv6 for the uplink's global IPv6 address (#2226).data.wireless.data.dhcp.data.fdb.data.arp and data.arpDevs.data.netIf.data.lldp.data.workloads (#2227).data.workloads is a census, not a database: the server keeps at most 256 items and 128 runes per text field, dropping the excess, and it hides the cached census when the pusher has not sent a push for 15 minutes, so a dead pusher does not leave a stale panel (#2236).
For example, a Bbox, MikroTik or UniFi integration can begin with system, WAN, wireless, DHCP and port data. Optical-line details, instant per-client rates or vendor-specific actions may need a later contract proposal.
Do not convert an instantaneous rate into a fake cumulative counter. Do not invent FTTH fields inside an unrelated section. If the data matters and has no neutral home, stop and propose the contract change.
The canonical wire types live in agent/probe/payload.go and the related types in agent/probe/probe.go. Read those files before defining the mapping.
The endpoint is:
POST /api/ingest/agent
Content-Type: application/json
Authorization: Bearer <agent-token>
X-Agent-Signature: <lowercase-hex-hmac-sha256>
The signature is HMAC-SHA256 using the agent token as the key and the exact HTTP request body as the message:
mac := hmac.New(sha256.New, []byte(token))
_, _ = mac.Write(body)
signature := hex.EncodeToString(mac.Sum(nil))
Sign the bytes after marshaling. Do not marshal again after signing. A formatting or field-order change produces a different signature.
A successful ingestion returns 202 Accepted. Clients may also accept 200 OK for compatibility, but must not treat 202 as an error.
A minimal envelope looks like this:
{
"router": "gateway-example",
"ts": 1793000000,
"version": "0.1.0",
"kind": "external",
"interval": 60,
"data": {}
}
That envelope demonstrates the wire format only. Add real sections from probe.PayloadData to populate the fleet.
Contract rules:
router is the registered agent slug, not a display name.ts is the sample time in Unix seconds and must be current enough for replay protection.version identifies the external agent release.kind is external.interval is the push cadence in seconds. Declare the real cadence so freshness handling can account for it.The working RouterOS implementation in netpulse-integrations/routeros shows configuration, token use, signing and pushing. RouterOS is supported only through this integration: the server has no RouterOS adapter or credentials. It is also a reference for the transport, not a template that requires copying the whole native agent.
RouterOS requirements for the integration:
www service serves it from 7.9; on older versions only the binary API path works. On RouterOS 6 with only the web service enabled the unit shows offline.www-ssl (preferred) or www service enabled (IP > Services). The pusher prefers the binary API (api, port 8728) when it is reachable and falls back to REST on the web service, so the api and api-ssl services are not required: web-only is a supported setup with reduced coverage (system identity and resource only).api, rest-api and read (System > Users): the REST API logs the user in through the API, so the group needs both policies plus read access. The built-in read-only groups already carry them.Asuswrt/Merlin follows the same external contract through netpulse-integrations/asuswrt. It reuses the portable probes from agent/probe, but not the native command, backup or upgrade runtime. Existing asuswrt router rows migrate to external with their agent tokens preserved.
The contract carries semantics, not just JSON names.
*Bps rates.If a value cannot be represented honestly, omit it and record the gap.
Some integrations need a field that the current contract does not have. A good core change is useful beyond one vendor.
Good candidates include neutral optical-line information or generic per-client traffic rates. Poor candidates are fields named after one vendor response, private endpoint payloads or vendor-specific behavior inside shared polling code.
Before implementing a core extension, open or update the issue with:
Vendor-specific parsing remains in the integration directory even when the neutral field is added to core.
Inside netpulse-integrations, a recommended layout is:
<vendor>/
cmd/<vendor>-pusher/main.go
internal/vendorapi/ # vendor HTTP client and session handling
internal/translate/ # vendor responses to probe.Payload
internal/translate/testdata/
README.md
CHANGELOG.md
The repository also carries the root LICENSE, README.md, CI workflow and CODEOWNERS. Each vendor directory declares its own maintainers there. A contributor can start with a pull request and become code owner for that directory after the integration has real hardware validation.
Recommended properties:
routeros/v0.1.0, with binaries and a changelog.Do not describe a community integration as maintained by the NetPulse project unless that is actually the case. The directory maintainer owns the vendor client, its releases and its hardware validation. NetPulse maintainers own the ingestion contract and neutral core fields.
A systemd deployment is enough:
[Unit]
Description=NetPulse external router pusher
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=netpulse-pusher
Group=netpulse-pusher
EnvironmentFile=/etc/netpulse-vendor-pusher/env
ExecStart=/usr/local/bin/vendor-pusher
Restart=on-failure
RestartSec=5s
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=true
[Install]
WantedBy=multi-user.target
Keep the environment file readable only by the service user. Run the pusher on a host that stays on. If it runs on a laptop and the laptop sleeps or shuts down, NetPulse will correctly mark the router stale.
External agents do not use the native OpenWrt self-upgrade or reinstall path. Release and upgrade procedures belong to the integration directory.
At minimum, include:
httptest.Server ingestion test that verifies the Bearer token and the HMAC over the exact body.For a new family or a core contract change, follow the longer public validation required by CONTRIBUTING.md. Record the exact agent and server versions, firmware, push interval, errors and unsupported features. Screenshots can support the result, but they do not replace parser fixtures and API evidence.
Create the router as type external in Settings, then create or rotate its agent token through the admin API:
POST /api/agents
Content-Type: application/json
{"slug":"gateway-example"}
This endpoint requires an admin session and returns the token. Creating or rotating a token invalidates the previous one, so update the external service configuration before expecting the next push.
Store the token as a secret. Do not put it in a public repository, a ticket, a fixture or a command transcript. Test with a local or disposable NetPulse instance when possible.
An external integration is ready to propose when:
The goal is a small NetPulse core with reliable community integrations, not a collection of vendor APIs compiled into every installation.