Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netbox scanner #8

Open
da-ekchajzer opened this issue Apr 27, 2022 · 0 comments
Open

Netbox scanner #8

da-ekchajzer opened this issue Apr 27, 2022 · 0 comments

Comments

@da-ekchajzer
Copy link
Collaborator

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.

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant