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

Open
opened 2023-03-20 16:13:03 +01:00 by Lozbik · 2 comments
Lozbik commented 2023-03-20 16:13:03 +01:00 (Migrated from github.com)

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

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](https://github.com/Solvik/netbox-agent#configuration) file are not enough. > This my conf file now: <img width="645" alt="screen netbox-agent-conf" src="https://user-images.githubusercontent.com/82113196/226382298-6d0e67d1-fff7-4e99-9708-9de4e4c11ac3.png">
Solvik commented 2023-03-22 20:06:29 +01:00 (Migrated from github.com)

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.

Hi @Lozbik The role is what will be used as a Netbox Device Role, for example: <img width="385" alt="image" src="https://user-images.githubusercontent.com/201761/227010393-eb60859f-6519-43ac-bfab-2f0293035938.png"> <img width="369" alt="Screenshot 2023-03-22 at 20 03 32" src="https://user-images.githubusercontent.com/201761/227010428-6349badf-dc3f-4595-a783-74196c469a16.png"> 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 2023-04-03 18:14:39 +02:00 (Migrated from github.com)

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?

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. <img width="1015" alt="Снимок экрана 2023-04-03 в 18 46 08" src="https://user-images.githubusercontent.com/82113196/229560841-f6672e01-72ce-479b-a74d-60a9b16d0533.png"> 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 <img width="289" alt="Снимок экрана 2023-04-03 в 19 10 23" src="https://user-images.githubusercontent.com/82113196/229570581-a951e78c-03cd-43f1-8a90-d14fbbdbfede.png"> 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?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: DGNum/netbox-agent#269
No description provided.