title: NetBox: Prefix utilization
agents: netbox
catalog: app/netbox
license: GPLv2
distribution: check_mk
description:
 Utilization of the selected IPAM prefixes in percent, {WARN} at 80% and {CRIT}
 at 90% by default (rule "NetBox prefix utilization"). For non-container
 prefixes the number of assigned and free addresses is reported as well.

 NetBox's REST API does not expose a prefix's utilization, so the value is
 recomputed the way NetBox computes it internally: prefixes marked as utilized
 count as 100%; prefixes with status {container} are measured by the address
 space their child prefixes cover; all others by their child IP addresses (plus
 IP ranges flagged as utilized) against the usable prefix size - which for IPv4
 prefixes shorter than /31 that are not marked as a pool excludes the network and
 broadcast address.

 Each prefix costs one to three API requests, so select deliberately rather than
 monitoring every prefix. Prefixes can be selected explicitly by CIDR, or by tag
 or role slug - tagging in NetBox keeps the Checkmk rule free of churn.

item:
 The prefix in CIDR notation, with the VRF name appended in brackets when the
 prefix is not in the global table, e.g. {10.0.0.0/22} or {10.0.0.0/22 [CUST-A]}.

discovery:
 One service per prefix selected in the special agent rule.
