Open da-ekchajzer opened 2 years ago
I want to use cabestan to gather my assets listed in my netbox instance.
We could use the API provided by netbox to retrieve the assets
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", ... }, ... ] }
Documentation : https://docs.netbox.dev/en/stable/core-functionality/ipam/
IP assets could be used in the network scanners process.
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 :
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.
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 '.'
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 :
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.
Additional context