Skip to content

IPAM and DCIM (phpIPAM, NetBox)

Connecting an IPAM lets capacity planning check, before you add a host, that there are addresses left in the subnets your existing hosts and their BMCs are on. NetBox is a DCIM as well, so it also answers how many rack units are free and which PDU outlets have nothing plugged in. When NetBox is connected, its racks are used in place of the racks set on Settings.

Both are read-only. Collimo never writes to either, and says nothing about where the documentation and the network disagree (yet).

They're read on every edition; the add-host check that uses them is Business and MSP.

phpIPAM

What Collimo reads: every subnet, its usage (used, free, size), its first free address and its VLAN number. Folders aren't subnets, and are left out. A full subnet has no first free address, which phpIPAM answers with an error; that's expected. Usage is read for the first 300 subnets, one request each; past that, the panel says so.

  1. Administration → API: turn the API on, then Create API key.
  2. App ID collimo, App permissions Read, App security SSL with App code token. Copy the App code.
  3. In the setup wizard, add phpIPAM: the address (https://ipam.lab), the app ID as API app ID, and the app code as the secret.
Editing the stack by hand
SOURCE_7=phpipam https://ipam.lab name=ipam user=collimo every=10m
SOURCE_7_SECRET=<app code>

NetBox

What Collimo reads: prefixes, with at least 50 of their free addresses (enough to say "plenty", without listing a /16); racks, and how many units their mounted devices fill (devices with no position, such as 0U PDUs, take none); PDUs' power outlets, free when no cable is recorded and it isn't marked connected; and every device's power ports, with the outlet each is cabled to, for Resilience.

  1. In NetBox, open your profile, API Tokens, and add a token with Write enabled off.
  2. In the setup wizard, add NetBox: the address (https://netbox.lab), and the token as the secret.

The token can see what its user can. A superuser's read-only token sees everything; otherwise give the user view permission on these object types: IPAM › Prefix and IPAM › IP address (for free addresses), and DCIM › Site, DCIM › Rack, DCIM › Device type, DCIM › Device, DCIM › Power outlet and DCIM › Power port. View on Device covers each device's serial number, rack position and face, which rack placement reads; nothing else is needed.

NetBox 4.5's v2 tokens (nbt_…) and the older ones both work: a token that starts nbt_ is sent as a bearer token, any other as Token.

How each is worked out:

  • A prefix's size is its addresses, less the network and broadcast addresses on an IPv4 prefix of /30 or bigger that isn't a pool. Deprecated prefixes are left out.
  • Free addresses: NetBox is asked for up to 50. Fewer than 50 is the exact count; 50 shows as at least 50. The first of them is the first free.
  • A rack's free units are its height less the units its devices fill, from each device type's height. A device with no position (a 0U PDU, one not mounted) takes none. Each device's height is kept, so capacity planning knows what a new host like an existing one takes.
  • A PDU's free outlets are its power outlets with no cable that aren't marked connected.
  • Power cables: each power port's link peer, where it is a power outlet: the device holding that outlet is the UPS or PDU that feeds the port. A port cabled to a building's power feed, or to nothing, names none. Resilience matches each NetBox device to what Collimo reads by serial number, then by name, as rack placement does.
  • Lists are read 1,000 at a time, up to 20,000 of each.
Editing the stack by hand
SOURCE_8=netbox https://netbox.lab name=netbox every=10m
SOURCE_8_SECRET=<API token>

Every ten minutes is plenty: none of this changes by the minute.

Where it shows up

Each gets a panel on the LAN tab: subnets with the fullest first (free of size, and the first free address), and from NetBox, racks with their free units and what's in them, and each PDU's free outlets.

Capacity planning uses them when it checks adding a host: free addresses in each subnet the existing host and its BMC are on, and from NetBox, the rack's free units against the host's height. NetBox's racks win over the racks set on Settings.

NetBox also places your devices in their racks on the LAN tab: a device NetBox has mounted in a rack (with a position) puts the gateway, switch or access point Collimo knows in that rack, at that unit. They're matched by serial number, or failing that by name, ignoring case and any domain (core-sw1.lab.example places core-sw1). A serial or name two NetBox devices share places neither, so a switch is never put in the wrong rack. A device NetBox doesn't place can be placed by hand on its row, by an admin on Business or MSP; where NetBox places it, NetBox wins. See Switches: your racks.

Neither raises alerts. Metrics:

Metric What it is
infra_ipam_subnet_free_addresses Addresses left in a subnet (source, subnet)
infra_ipam_subnet_size_addresses Usable addresses in it
infra_dcim_rack_free_units A rack's free units (source, rack)

If something's wrong

What you see What to do
set user= on the slot to the phpIPAM API app's ID Fill in API app ID: the app ID from step 2, not your user name.
phpIPAM refused the credentials (401) The app code is wrong, or the app's security isn't SSL with App code token.
phpIPAM: … phpIPAM's own error, such as an app that's been disabled.
NetBox refused the credentials (401) The token is wrong, expired, or limited to other addresses.
NetBox denied the account access (403) The token's user can't view IPAM or DCIM: give them view permission on the object types listed above.
racks not read: … The token can read IPAM but not DCIM. Subnets still work.
A subnet shows free — Its usage wasn't read: it's past the first 300, or NetBox didn't answer for it.
The add-host check can't find a subnet for an address No prefix in the IPAM holds it. Add the subnet to the IPAM.