Solvik / netbox-agent

Netbox agent to run on your infrastructure's servers
Apache License 2.0
273 stars 67 forks source link

A brief description of the fields in netbox_agent.yaml that netbox-agent can work with. #269

Open Lozbik opened 1 year ago

Lozbik commented 1 year ago

I'm just getting started with netbox-agent and can't figure out the fields in the netbox_agent.yaml file. I figured out how to connect the agent to the server. However, I could only transfer: role and 1 interface (L0) without an ip address. Is there an example of filling in the netbox_agent.yaml file? Or documentation on its fields? This is my config file right now and I just have no idea how to add new variable fields because the names I tried to use don't work. And the fields that are described in the template configuration file are not enough.

This my conf file now:

screen netbox-agent-conf
Solvik commented 1 year ago

Hi @Lozbik

The role is what will be used as a Netbox Device Role, for example:

image Screenshot 2023-03-22 at 20 03 32

You can look at your existing roles under https://netbox.foo.com/dcim/device-roles/

For IP addresses, the default behavior of the agent is to ignore dummy/docker interfaces and 127.0.0.X interfaces

network:
  # Regex to ignore interfaces
  ignore_interfaces: "(dummy.*|docker.*)"
  # Regex to ignore IP addresses
  ignore_ips: (127\.0\.0\..*)

With the following configuration it should create and updates network interfaces such as ethX and ensX etc.

Lozbik commented 1 year ago

Hi, sorry for such a long answer, I was sick.

  1. I tried to use the network setup option you suggested. And I get an error at the time of agent launch. It looks like this, I don't have any ideas what's going wrong.

    Снимок экрана 2023-04-03 в 18 46 08
  2. About the parameters that netbox-agent supports. There are no problems with adding server_role. But I would like to control all fields when I add device. For example: device name, device type, Description and some hardware parameters. I tried to pick up the keys to fill in myself, but each time I got an error, such as for the name KeyError: 'No action for key"device.name " to check its value.' Can you tell me the exact names of the fields that I can specify in the netbox-agent config?

  3. Similar problem with custom_fields. I try to use it as in the example

    Снимок экрана 2023-04-03 в 19 10 23

but I get the similar error KeyError: No action for key "device.custom_fields" to check its value.. Can you show a working example of filling in custom_fields?