Skip to content

Conversation

@stonebuzz
Copy link
Collaborator

@stonebuzz stonebuzz commented Jan 28, 2026

Handle PDU inventory from SNMP

Needed by : glpi-project/glpi#22863

fixes : https://github.com/glpi-project/Professional-Services/issues/27

Here’s the English summary of this updated PDU structure:

  • Main object: pdu

    • Type: object
    • Required property: name

Properties:

  1. name: string

    • The name of the PDU.
  2. model: string

    • The model of the PDU.
  3. type: string (required)

    • The type of PDU.
  4. credentials: integer

    • Reference to glpi snmpcredentials_id (optional).
  5. sysdescr: string

    • Remote device system description.
  6. plugs: array of objects

    • List of the PDU’s plugs.

    • Each plug is an object with:

      • name: string (required) — Name of the plug.
      • number: string (optional) — Plug number.
      • type: string (optional) — Plug type.

@stonebuzz stonebuzz marked this pull request as draft January 28, 2026 10:22
@stonebuzz
Copy link
Collaborator Author

@g-bougard @trasher

I would appreciate your initial opinion.

Related specification : https://outline.teclib.com/doc/inventaire-des-pdus-oEGY3aIdjg#h-inventaire-auto

@trasher
Copy link
Collaborator

trasher commented Jan 28, 2026

Seems correct after a quick review :)

@stonebuzz
Copy link
Collaborator Author

Thanks @trasher

I suggest keeping this as a draft for now, while I finish implementing the feature. I may need to make some adjustments along the way if necessary.

@trasher
Copy link
Collaborator

trasher commented Jan 28, 2026

OK for me 👍

@stonebuzz
Copy link
Collaborator Author

stonebuzz commented Jan 29, 2026

Example with minimalist XML file

<?xml version="1.0" encoding="UTF-8" ?>
<REQUEST>
  <CONTENT>
    <DEVICE>
      <FIRMWARES>
        <DESCRIPTION>APC Rack PDU Firmware</DESCRIPTION>
        <MANUFACTURER>APC</MANUFACTURER>
        <NAME>AP8853</NAME>
        <TYPE>PDU</TYPE>
        <VERSION>v6.9.6</VERSION>
      </FIRMWARES>
      <INFO>
        <COMMENTS>APC Rack PDU Switched, 2G, Metered-by-Outlet</COMMENTS>
        <CONTACT>Schneider Electric Support</CONTACT>
        <FIRMWARE>6.9.6</FIRMWARE>
        <ID>1</ID>
        <IPS>
          <IP>192.168.1.50</IP>
        </IPS>
        <LOCATION>DataCenter_Room_01_Rack_A4</LOCATION>
        <MAC>00:C0:B7:65:DE:01</MAC>
        <MANUFACTURER>APC</MANUFACTURER>
        <MODEL>AP8853</MODEL>
        <NAME>PDU-MASTER-RACK-A4</NAME>
        <SERIAL>ZA133456789</SERIAL>
        <TYPE>PDU</TYPE>
        <UPTIME>45:12:30.22</UPTIME>
      </INFO>
      <PDU>
        <TYPE>C13/C19</TYPE>
        <PLUGS>
          <NAME>Plug_A1</NAME>
          <NUMBER>1</NUMBER>
          <TYPE>C13</TYPE>
        </PLUGS>
        <PLUGS>
          <NAME>Plug_A2</NAME>
          <NUMBER>2</NUMBER>
          <TYPE>C14</TYPE>
        </PLUGS>
      </PDU>
    </DEVICE>
    <MODULEVERSION>4.1</MODULEVERSION>
    <PROCESSNUMBER>1</PROCESSNUMBER>
  </CONTENT>
  <DEVICEID>APC-PDU-001</DEVICEID>
  <QUERY>SNMPQUERY</QUERY>
</REQUEST>

@stonebuzz
Copy link
Collaborator Author

type and number have been added to Plug

Comment on lines +2861 to +2896
"pdu": {
"type": "object",
"title": "Power Distribution Unit inventory",
"properties": {
"type": {
"type": "string",
"title": "PDU type"
},
"plugs": {
"title": "List of plugs of pdu",
"type": "array",
"items": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"title": "Plug name"
},
"number": {
"type": "integer",
"title": "Plug number"
},
"type": {
"type": "string",
"title": "Plug type"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to move this property under "network_device" properties. At the same level than "credentials" for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants