The function parsing the RAID logical volumes in the HP module did not
manage the case where disks were set in JBOD mode, thus having no RAID
array set.
This patch fixes this by checking if arrays are defined on pdisks before
parsing the logical disks.
Also added returncode read when executing the RAID related commands to
raise a more precise error.
This patch fixes a mismatch between the way network interfaces are
looked for from network cards, and the way they are created:
- If a network card has a NAC address, it used in the search criteria to
find the network interface
- When creating virtual interfaces, the MAC address is not specified in
the creation parameters
This raises an exception when a virtual card has a MAC address:
- The virtual interface has been created without MAC address
- But the network card has one, so the interface is looked for using it
- The network interface is not found, so it's created
- An error is risen because an interface with the same name already
exists
This patch sets the MAC address on the interface if it exists, no matter if
it is virtual or not.
Some interfaces do not have device (logical) name (eth0, for instance), such
as not connected network mezzanine cards in blade servers.
In such situations, the card will be named `unknown[0-9]`.
This patch brings some of the physical and virtual drive attributes as
`custom_fields` to the disks inventory.
The goal is to have this information present to ease disks maintenance
when a drive becomes unavailable and its attributes can't be read anymore
from the RAID controller.
It also helps to standardize the extended disk attributes across the
different manufacturers.
As the disk physical identifers were not available under the correct
format (hexadecimal format using the `xml` output as opposed as `X:Y:Z` format
using the default `list` format), the command line parser has been
refactored to read the `list` format, rather than `xml` one in the
`omreport` raid controller parser.
As the custom fields have to be created prior being able to register
the disks extended attributes, this feature is only activated using the
`--process-virtual-drives` command line parameter, or by setting
`process_virtual_drives` to `true` in the configuration file.
The custom fields to create as `DCIM > inventory item` `Text` are described
below.
NAME LABEL DESCRIPTION
mount_point Mount point Device mount point(s)
pd_identifier Physical disk identifier Physical disk identifier in the RAID controller
vd_array Virtual drive array Virtual drive array the disk is member of
vd_consistency Virtual drive consistency Virtual disk array consistency
vd_device Virtual drive device Virtual drive system device
vd_raid_type Virtual drive RAID Virtual drive array RAID type
vd_size Virtual drive size Virtual drive array size
In the current implementation, the disks attributes ore not updated: if
a disk with the correct serial number is found, it's sufficient to
consider it as up to date.
To force the reprocessing of the disks extended attributes, the
`--force-disk-refresh` command line option can be used: it removes all
existing disks to before populating them with the correct parsing.
Unless this option is specified, the extended attributes won't be
modified unless a disk is replaced.
It is possible to dump the physical/virtual disks map on the filesystem under
the JSON notation to ease or automate disks management. The file path has to
be provided using the `--dump-disks-map` command line parameter.
When PSUs were found, the voltage value was never set, raising an
exception when trying to multiply current * voltage (float * None).
This patch reads per PSU voltage (with 230V as default) and define power
consumption from it.
```bash
$ netbox_agent -du --device.custom_fields="last_run=$(date),last_run_ts=$(date +'%s')"
```
obviously, custom_fields need to be create manually in netbox admin
- Added an option to specify an SSL CA certificates file to talk to the
Netbox API
- Enhanced GPU expansion bays inventory: internal GPU (VGA) goes into
the blade, external GPU (3D) goes into the expansion bay
- Unified the way expansion bays are managed (GPU and drive exansion
bays)
- Started to refactor `network` module to make it more readable
- Dependencies in `setup.py` now reads its requirements from
`requirements.txt` to avoid double maintenance
This patch adds the ability to detect and manage GPU and Disk expansion
bays, and either add their internal components into the device
corresponding to the blade server, or into a dedicated device.
It takes advantage of the work made by @cyrinux on GPU bays management, and
applies the same principle to the external disk bays, but harmonize the
inventory management:
- If no argument is specified on the command line, the GPU cards, RAID
controllers and their attached disks are added in the blade device,
and the device corresponding to an expansion device is deleted.
- If the `--expansion-as-device` option is specified on the command
line, a dedicated device corresponding to the expansion bay is
created, and the GPUs, RAID card and attached disks are removed from
the blade device and added to the expansion device.
This patch adds an option to clear remaining devices in the context of a
new device replacing an old one with the same name but with a different
hardware.
The serial leading to the bug is described below:
- A first server is registered under name `A` with serial `X`
- A second server is registered under name `B` with serial `Y`
- The server with serial `X` is decomissionned, but not removed
- The server with serial `Y` is reinstalled with name `A`
In this case, a device with serial `X` is well found, and netbox agent
tries to update its name. But this raises an error because of the unique
constraint on name, as another device already holds this name.
The proposed solution to handle this situation is to delete any device
with same `name` but different `serial` before handling a device.
As this is not necessarily the expected behavior, it can be enabled by
using the `--purge-old-devices` to avoid breaking existing inventory.
* When nvme binary absent or too old and no json output, this crash the inventory, i prefer just pass nvme inventory and continue
* log if nvme-cli is not installed
* Add "ProLiant BL460c Gen10 Graphics Exp"
* Add GPU expansion support for HP_ProLiant_BL460c_Gen10_Graphics_Exp
* Add ProLiant BL460c Graphics Expansion Blade support in README
* Dont crash if vendor other than HP
* Typo