Commit graph

12 commits

Author SHA1 Message Date
13b84b4da1
feat: Run formatters 2024-10-21 12:55:54 +02:00
Christophe Simon
e789619b34 Added disks extended attributes
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.
2022-03-02 15:53:38 +01:00
Christophe Simon
af9df9ab4b Fixed PSU power consumption calculation
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.
2022-02-23 16:06:32 +01:00
Solvik Blum
58c18fc2da add more compatibility, now to netbox 2.10 2021-05-12 19:41:01 +02:00
Anton A. Grishin
28955612be
fix allocated_draw for inactive PSU (#168)
Co-authored-by: Anton Grishyn <grishin@maxpay.com>
2020-09-07 14:20:32 +02:00
Solvik
feec16c4fe
fix latest flake8 error (#135) 2020-06-15 15:46:09 +02:00
Solvik Blum
b94f246196 some power fixes 2020-06-14 18:29:28 +02:00
Solvik
5590f39131
Fix agent, wasn't working anymore (#115)
Bad rebase made dmidecode calls fail
2020-02-16 20:24:40 +01:00
ramnes
bab2d26ad0 Setup tests 2020-02-02 20:24:01 +01:00
Solvik
a0106675e0
handle more PSU dmidecode format (#75) 2019-09-11 10:37:31 +02:00
Solvik
4303312b17
fix PSU power parsing (#74) 2019-09-10 14:48:16 +02:00
Solvik
8d0168acb5
Add power supply support (#56) 2019-09-05 13:47:10 +02:00