2019-08-02 18:34:35 +02:00
# Netbox agent
2019-08-02 18:32:33 +02:00
2019-08-05 10:01:33 +02:00
This project aims to create hardware automatically into [Netbox ](https://github.com/netbox-community/netbox ) based on standard tools (dmidecode, lldpd, parsing /sys/, etc).
2019-08-04 15:20:57 +02:00
The goal is to generate an existing infrastructure on Netbox and have the ability to update it regularly by executing the agent.
# Features
* Create servers, chassis and blade through standard tools (`dmidecode`)
2019-08-09 12:08:11 +02:00
* Create physical, bonding and vlan network interfaces with IPs
* Create IPMI interface if found
* Create or get existing VLAN and associate it to interfaces
2019-08-05 18:12:27 +02:00
* Generic ability to guess datacenters and rack location through drivers (`cmd` and `file` and custom ones)
* Update existing `Device` and `Interfaces`
* Handle blade moving (new slot, new chassis)
2019-08-04 15:20:57 +02:00
2019-08-09 12:08:11 +02:00
# Requirements
- Netbox >= 2.6
- Python >= 3.4
2019-08-13 11:04:32 +02:00
- [pynetbox ](https://github.com/digitalocean/pynetbox/ )
2019-08-09 12:08:11 +02:00
- [python3-netaddr ](https://github.com/drkjam/netaddr )
- [python3-netifaces ](https://github.com/al45tair/netifaces )
2019-08-09 13:26:51 +02:00
- ethtool
- dmidecode
- ipmitool
2019-08-04 23:24:51 +02:00
# Known limitations
* The project is only compatible with Linux.
Since it uses `ethtool` and parses `/sys/` directory, it's not compatible with *BSD distributions.
2019-08-06 17:44:55 +02:00
* Netbox `>=2.6.0,<=2.6.2` has a caching problem ; if the cache lifetime is too high, the script can get stale data after modification.
2019-08-09 12:08:11 +02:00
We advise to set `CACHE_TIME` to `0` .
2019-08-04 23:24:51 +02:00
2019-08-04 15:20:57 +02:00
# Configuration
2019-08-04 20:10:43 +02:00
```
netbox:
2019-08-04 15:20:57 +02:00
url: 'http://netbox.internal.company.com'
token: supersecrettoken
2019-08-09 12:08:11 +02:00
network:
ignore_interfaces: "(dummy.*|docker.*)"
ignore_ips: (127\.0\.0\..*)
2019-08-04 15:20:57 +02:00
datacenter_location:
2019-08-09 12:08:11 +02:00
driver: "cmd:cat /etc/qualification | tr [a-z] [A-Z]"
regex: "DATACENTER: (?P< datacenter > [A-Za-z0-9]+)"
# driver: 'cmd:lldpctl'
# regex: 'SysName: .*\.([A-Za-z0-9]+)'
#
# driver: "file:/tmp/datacenter"
# regex: "(.*)"
rack_location:
2019-08-04 15:20:57 +02:00
# driver: 'cmd:lldpctl'
2019-08-09 12:08:11 +02:00
# match SysName: sw-dist-a1.dc42
# regex: 'SysName:[ ]+[A-Za-z]+-[A-Za-z]+-([A-Za-z0-9]+)'
#
# driver: "file:/tmp/datacenter"
# regex: "(.*)"
2019-08-04 15:20:57 +02:00
```
2019-08-02 18:32:33 +02:00
2019-08-02 18:34:35 +02:00
# Hardware
2019-08-02 18:32:33 +02:00
Tested on:
2019-08-02 18:34:35 +02:00
## Dell Inc.
2019-08-02 18:32:33 +02:00
2019-08-02 18:34:35 +02:00
### Blades
2019-08-03 16:02:07 +02:00
2019-08-08 14:46:06 +02:00
* PowerEdge M1000e (your `DeviceType` should have slots named `Slot 01` and so on)
2019-08-02 18:32:33 +02:00
* PowerEdge M640
* PowerEdge M630
* PowerEdge M620
* PowerEdge M610
2019-08-02 18:34:35 +02:00
### Pizzas
2019-08-03 16:02:07 +02:00
2019-08-02 18:32:33 +02:00
* DSS7500
2019-08-02 18:34:35 +02:00
## HP
2019-08-03 16:02:07 +02:00
### Blades
2019-08-08 14:46:06 +02:00
* HP BladeSystem c7000 Enclosure G2 / G3 (your `DeviceType` should have slots named `Bay 1` and so on)
2019-08-03 16:02:07 +02:00
* HP ProLiant BL460c Gen8
* HP ProLiant BL460c Gen9
### Pizzas
* ProLiant DL380p Gen8
2019-08-02 18:32:33 +02:00
2019-08-02 18:34:35 +02:00
## HPE
2019-08-03 16:02:07 +02:00
* HPE ProLiant XL450 Gen10
2019-08-02 18:32:33 +02:00
2019-08-02 18:34:35 +02:00
# TODO
2019-08-02 18:32:33 +02:00
- [ ] Handle switch < > NIC connections (using lldp)
- [ ] CPU, RAID Card(s), RAM, Disks in `Device` 's `Inventory`
- [ ] `CustomFields` support with firmware versions for Device (BIOS), RAID Cards and disks