-
-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Problem
I want to use cabestan to gather my assets listed in my netbox instance.
Solution
We could use the API provided by netbox to retrieve the assets
Retrieving multiple assets by type
Documentation : https://docs.netbox.dev/en/stable/rest-api/overview/#retrieving-multiple-objects
A simple GET request at the resource endpoint will return the list of all the ressources.
curl -s -X GET http://netbox/api/ipam/ip-addresses/ | jq '.'
{
"count": 42031,
"next": "http://netbox/api/ipam/ip-addresses/?limit=50&offset=50",
"previous": null,
"results": [
{
"id": 5618,
"address": "192.0.2.1/24",
...
},
{
"id": 5619,
"address": "192.0.2.2/24",
...
},
{
"id": 5620,
"address": "192.0.2.3/24",
...
},
...
]
}
Type of assets
IP
Documentation : https://docs.netbox.dev/en/stable/core-functionality/ipam/
IP assets could be used in the network scanners process.
Devices
Documentation : https://docs.netbox.dev/en/stable/core-functionality/devices/
Devices represent all the physical assets in netbox. We could gather some information depending on the level of completeness of the net box instance :
- Inventory Items (CPU, Power Suply, …)
- Power information (Theoretical power usage (W) / Power distribution (W))
- IP which can be used for network scanning
Virtual machines
Documentation : https://docs.netbox.dev/en/stable/core-functionality/virtualization/
Clusters and VMs can be specified in netbox. We could retrieve information about the configuration and the status of each VM.