# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= python-netbox-agent VERSION= 1.2.0 KEYWORDS= python VARIANTS= v13 v14 SDESC[v13]= NetBox agent for server (3.13) SDESC[v14]= NetBox agent for server (3.14) HOMEPAGE= https://github.com/solvik/netbox_agent CONTACT= Python_Automaton[python@ironwolf.systems] DOWNLOAD_GROUPS= main SITES[main]= PYPIWHL/aa/36/b86fdf5e9da3087d7153a4fda9c918794ad634a147056ddc9383d1b2658d DISTFILE[1]= netbox_agent-1.2.0-py3-none-any.whl:main DIST_SUBDIR= python-src DF_INDEX= 1 SPKGS[v13]= single SPKGS[v14]= single OPTIONS_AVAILABLE= PY313 PY314 OPTIONS_STANDARD= none VOPTS[v13]= PY313=ON PY314=OFF VOPTS[v14]= PY313=OFF PY314=ON DISTNAME= netbox_agent-1.2.0.dist-info GENERATED= yes [PY313].RUN_DEPENDS_ON= python-pynetbox:single:v13 python-netaddr:single:v13 python-netifaces2:single:v13 python-PyYAML:single:v13 python-jsonargparse:single:v13 python-python-slugify:single:v13 python-packaging:single:v13 python-distro:single:v13 [PY313].USES_ON= python:v13,wheel [PY314].RUN_DEPENDS_ON= python-pynetbox:single:v14 python-netaddr:single:v14 python-netifaces2:single:v14 python-PyYAML:single:v14 python-jsonargparse:single:v14 python-python-slugify:single:v14 python-packaging:single:v14 python-distro:single:v14 [PY314].USES_ON= python:v14,wheel [FILE:3132:descriptions/desc.single] # Netbox agent [Build Status] This project aims to create hardware automatically into [Netbox] based on standard tools (dmidecode, lldpd, parsing /sys/, etc). The goal is to generate an existing infrastructure on Netbox and have the ability to update it regularly by executing the agent. # Features * Create virtual machines, servers, chassis and blade through standard tools (`dmidecode`) * Create physical, bonding and vlan network interfaces with IPs (IPv4 & IPv6) * Create IPMI interface if found * Create or get existing VLAN and associate it to interfaces * Generic ability to guess datacenters and rack location through drivers (`cmd` and `file` and custom ones) * Update existing `Device` and `Interface` * Handle blade moving (new slot, new chassis) * Handle blade GPU expansions * Automatic cabling (server's interface to switch's interface) using lldp * Local inventory using `Inventory Item` for CPU, GPU, RAM, RAID cards, physical disks (behind raid cards) * PSUs creation and power consumption reporting (based on vendor's tools) * Associate hypervisor devices to the virtualization cluster * Associate virtual machines to the hypervisor device # Requirements - Netbox >= 3.7 - Python >= 3.8 - [pynetbox] - [python3-netaddr] - [python3-netifaces] - [jsonargparse] - ethtool - dmidecode - ipmitool - lldpd - lshw ## Inventory requirement - hpassacli - storcli - omreport # Installation ``` # pip3 install netbox-agent ``` # Usage The agent can be run from a shell and get its configuration from either the configuration file or environment variables. Configuration values are overridden based on the following precedence: command line arguments (might include config file) > environment variables > default config file > defaults. ``` # netbox_agent -c /etc/netbox_agent.yaml --register INFO:root:Creating chassis blade (serial: QTFCQ574502EF) INFO:root:Creating blade (serial: QTFCQ574502D2) myserver on chassis QTFCQ574502EF INFO:root:Setting device (QTFCQ574502D2) new slot on Slot 9 (Chassis QTFCQ574502EF).. INFO:root:Interface a8:1e:84:f2:9e:6a not found, creating.. INFO:root:Creating NIC enp1s0f1 (a8:1e:84:f2:9e:6a) on myserver INFO:root:Interface 02:42:7a:89:cf:a4 not found, creating.. INFO:root:Creating NIC br-07ea1e4a2f0e (02:42:7a:89:cf:a4) on myserver INFO:root:Create new IP 172.19.0.1/16 on br-07ea1e4a2f0e INFO:root:Interface a8:1e:84:f2:9e:69 not found, creating.. INFO:root:Creating NIC enp1s0f0 (a8:1e:84:f2:9e:69) on myserver INFO:root:Create new IP 42.42.42.42/24 on enp1s0f0 INFO:root:Create new IP fe80::aa1e:84ff:fef2:9e69/64 on enp1s0f0 INFO:root:Interface a8:1e:84:cd:9d:d6 not found, creating.. INFO:root:Creating NIC IPMI (a8:1e:84:cd:9d:d6) on myserver INFO:root:Create new IP 10.191.122.10/24 on IPMI ``` If you need, you can update only specific informations like: * Network * Inventory * Location * PSUs ``` # ip a add 42.42.42.43/24 dev enp1s0f1 # netbox_agent -c /etc/netbox_agent.yaml --update-network INFO:root:Create new IP 42.42.42.43/24 on enp1s0f1 # netbox_agent --update-inventory INFO:root:Creating Disk Samsung SSD 850 S2RBNX0K101698D ``` # Configuration [FILE:125:distinfo] b621ca0db1e64254a30c4b38c608c8773631be7fb03de76802fd36bc1c9c728f 53708 python-src/netbox_agent-1.2.0-py3-none-any.whl