DCImanager 6

Connecting the PDU dummy handler

The dummy handler allows you to add a virtual power distribution unit (PDU) to the platform. Using a virtual device can be useful for testing the platform.

Features of work

Handler capabilities:

  • creating a PDU with the required number of ports;
  • port polling;
  • enabling and disabling ports;
  • collection of power consumption statistics — random values are generated for statistics.

Handler features:

  • when periodically polling the device, the status of the manually disabled ports changes to "On";
  • adding a PDU and editing its parameters is available only through the API.

Adding the handler into the platform

  1. Download the archive with the handler from the ISPsystem repository. For more information about the structure of the handler, see the article Creating a PDU handler.
  2. Log in to DCImanager 6 with administrator permissions:

    curl -o- -k https://domain.com/api/auth/v4/public/token \
        -H "isp-box-instance: true" \
        -d '{
            "email": "<admin_email>",
            "password": "<admin_pass>"
        }'
    
    Comments to the command

    A response message in the format below will be received:

    {"id":"24","token":"24-cee181d2-ccaa-4b64-a229-234aa7a25db6"}

     Save the value of the token parameter from the received response.

  3. Create a description for the handler:

    curl -o- -k https://domain.com/api/eservice/v3/custom_equipment \
        -H "isp-box-instance: true" \
        -H "x-xsrf-token: <token>" \
        -d '{
            "device_type": "pdu",
            "handler": "<internal_handler_name>",
            "name": "<handler_name>",
            "protocol": ["custom"],
            "features": []
        }'
    Comments to the command

    The response will contain the id of the created handler. Save this value.

    Example of reply
    {"id": 1}
  4. Upload the archive with the handler into the platform:

    curl -o- -k https://domain.com/api/eservice/v3/custom_equipment/<handler_id>/content \
        -H "isp-box-instance: true" \
        -H "x-xsrf-token: <token>" \
        -F "data=@dummy_pdu_handler.tar.gz" \
        -F "handler_import=dummy_handler.dummy_pdu"
    Comments to the command
  5. Add a virtual PDU using the uploaded handler:

    curl -o- -k https://domain.com/api/dci/v3/pdu \
        -H "isp-box-instance: true" \
        -H "x-xsrf-token: <token>" \
        -d '{
             "device":"<internal_handler_name>",
             "ip":"<ip_address>",
             "name":"<pdu_name>",
             "note":"<comments>",
             "rack":<rack_id>,
             "size":<device_size>,
             "unit":<unit_id>,
             "custom_params": {
                               "port_count":<port_number>,
                               "port_name_template":"<port_template>"
                              }
        }'
    Comments to the command

    You can add a virtual PDU through the platform interface. For more information, see the Adding a PDU article. When adding:

    1. In the Handler field, select the internal name of the handler.
    2. Specify an arbitrary IP address for the PDU.
    3. In the Handler settings section:
      1. Specify the port_count Key and a Value equal to the number of PDU ports.
      2. To specify a port name template:
        1. Click the Add settings button.
        2. Specify the port_name_template Key and the Value that corresponds to the port name template. For example, if you specify "Port #{id}", the ports of the device will be named Port #1, Port #2, etc. Optional parameter. The default value is "Port {id}"