InfraDB

Linking Structam hosts to InfraDB, KazLabs' monitoring platform: hardware enrichment, the monitoring panel, alarms, links, InfraDB audit events and Prometheus federation.

On this page

Status. Tested: linking, hardware enrichment, the monitoring panel, the alarm outbox and its reconciliation, link write-back, the audit receiver and /metrics/federate against a fake InfraDB that follows InfraDB's own handlers, in the product's package tests on PostgreSQL. Not yet run: against a running InfraDB.

InfraDB is KazLabs' monitoring platform. NetBox owns identity, InfraDB owns monitoring, and Structam owns what is installed and configured on each host and how it changed. The integration links the two products' records of the same host and passes a few things across; it never creates a host on either side.

Connecting

Save it on Integrations → InfraDB (integrations.manage) or set the environment; a saved setting replaces the environment until you delete it.

SettingVariableDefault
URLSTRUCTAM_INFRADB_URLunset (integration off)
API tokenSTRUCTAM_INFRADB_TOKEN (or _FILE)unset
CA bundleSTRUCTAM_INFRADB_CA_FILEsystem roots
Push alarmsSTRUCTAM_INFRADB_ALARMSon
Hardware enrichmentSTRUCTAM_INFRADB_ENRICHon
Links in InfraDBSTRUCTAM_INFRADB_LINKSoff

Create the token in InfraDB, on the InfraDB server:

mc token create -name structam -role viewer -scopes ingest

Role viewer reads hosts; scope ingest pushes alarms; a role with inventory.edit (InfraDB's built-in engineer) is needed only with links on. Test reads the token's identity and one page of hosts and, with alarms on, posts an empty alarm batch to prove the ingest scope. The token is sealed, never returned, and only ever sent to the URL and CA bundle it was saved with. Calls are server-to-server JSON, follow no redirects, and go through the outbound proxy settings.

Linking hosts

Every 5 minutes Structam reads InfraDB's hosts and links each Structam host to at most one:

  1. a NetBox device, by InfraDB's NetBox source id (InfraDB's source ids are NetBox device ids, so virtual machines are never linked this way);
  2. otherwise a unique host name, then FQDN, then IP address.

An InfraDB host that came from NetBox is only ever linked to the device its source id names. Ambiguous evidence links nothing, and a run that could not read every page changes no link. Each run is recorded and audited (infradb.sync); Integrations → InfraDB shows link counts per rule.

What flows

DirectionWhatWhen
InfraDB to Structamhardware components and firmware (CPU, GPU, memory modules, disks, NICs, controllers, PSUs, BIOS, BMC firmware) as host components with source infradbwhen InfraDB's host changed
InfraDB to Structammonitoring state, active alarms and availability on the host page's InfraDB panelon view, cached 30 s per host
Structam to InfraDBalarms: change rules with raise_infradb_alarm, and agents offline for more than 10 minutesretried until accepted
Structam to InfraDBa "Structam" link and config_backup_url on linked hosts (links on)up to 200 hosts per run, only when the URL changes
InfraDB to StructamInfraDB audit events about hosts, as external events on the Structam host timelineas InfraDB's audit sink sends them
Structam to InfraDB's Prometheusper-host agent health series on /metrics/federatewhen scraped

Hardware rows from InfraDB are never merged with the agent's: InfraDB is authoritative for out-of-band hardware. A host that loses its link loses its InfraDB components. Sensors, fans, load and file systems are not copied.

Alarms

Structam keeps the desired alarm state in an outbox, written in the same transaction as its cause, and one node posts it to InfraDB with source: "structam" in batches of up to 1 000. Alarms clear when the cause resolves: the change is approved, or the agent is back. Every 15 minutes active raises are sent again, and Structam alarms InfraDB still shows without a cause are cleared. Change severities map high to major, medium to minor and low to warning.

InfraDB audit events

In InfraDB, add an audit sink: kind http, format ndjson, URL https://structam.example.com/api/v1/ingest/infradb-audit, bearer token a Structam API token with scope ingest owned by a service user:

structam user create -username infradb -service
structam token create -name infradb-audit -owner infradb -scopes ingest

Events are de-duplicated on their id; test events are acknowledged and dropped; events about alarms, API requests, hosts Structam does not know, and Structam's own link write-backs are skipped. Bodies are limited to 4 MiB and 5 000 events.

Prometheus federation

GET /metrics/federate (a token with scope metrics and permission view) serves five series per host, labelled mc_host with the InfraDB host name (else the FQDN, else the name): structam_host_agent_enrolled, structam_host_agent_connected, structam_host_agent_last_seen_age_seconds, structam_host_inventory_age_seconds and structam_host_pending_changes. The token's host scope filters the hosts, and STRUCTAM_METRICS_HOST_SERIES_MAX (2 000, InfraDB's default scrape cap) caps the series. /metrics itself carries no per-host labels.

Questions the docs do not answer?

Ask the people who build Structam. Installation media and licences come from KazLabs.

Talk to us