question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Power Supply max power draw is posted as 0

See original GitHub issue

Hey, I have a Dell R740XD inventory file, that when I try to sync, the script for some reason tries to put ‘0’ as maximum power draw, which Netbox does not permit.

2022-10-06 14:17:23,617 - INFO: Updating NetBox 'power port' object 'PS' with data: {'maximum_draw': 0, 'tags': [{'name': 'NetBox-synced'}, {'name': 'Source: my-redfish-example'}], 'custom_fields': {'firmware': '0.00', 'health': 'OK'}}
2022-10-06 14:17:23,617 - DEBUG2: Sending PATCH to 'https://netbox-stage.example.net/api/dcim/power-ports/803/' with data 'b'{"maximum_draw": 0, "tags": [{"name": "NetBox-synced"}, {"name": "Source: my-redfish-example"}], "custom_fields": {"firmware": "0.00", "health": "OK"}}''.
2022-10-06 14:17:24,981 - DEBUG2: Received HTTP Status 400.
2022-10-06 14:17:24,982 - ERROR: NetBox returned: PATCH /api/dcim/power-ports/803/ Bad Request
2022-10-06 14:17:24,982 - ERROR: NetBox returned body: {'maximum_draw': ['Ensure this value is greater than or equal to 1.']}
2022-10-06 14:17:24,982 - ERROR: Request Failed for power port. Used data: {'maximum_draw': 0, 'tags': [{'name': 'NetBox-synced'}, {'name': 'Source: my-redfish-example'}], 'custom_fields': {'firmware': '0.00', 'health': 'OK'}}

The inventory file seems to have the right fields for it:

[...]
"power_supply":[
         {
            "bay":1,
            "capacity_in_watt":800,
            "chassi_ids":[
               1
            ],
            "firmware":"1.00",
            "health_status":"OK",
            "id":"0",
            "input_voltage":229,
            "last_power_output":95,
            "model":"865414-B21",
            "name":"HpeServerPowerSupply",
            "operation_status":"Enabled",
            "part_number":"866730-001",
            "serial":"5WBXU0BLLAV6YM",
            "type":"AC",
            "vendor":"LTEON"
         },
         {
            "bay":2,
            "capacity_in_watt":800,
            "chassi_ids":[
               1
            ],
            "firmware":"1.00",
            "health_status":"OK",
            "id":"1",
            "input_voltage":229,
            "last_power_output":77,
            "model":"865414-B21",
            "name":"HpeServerPowerSupply",
            "operation_status":"Enabled",
            "part_number":"866730-001",
            "serial":"5WBXU0BLLAV6ND",
            "type":"AC",
            "vendor":"LTEON"
         }
      ],
[...]

Netbox v3.2.7, Script latest development- and main-branch

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Eldiabolo21commented, Oct 18, 2022

Thank you, this issue is fixed!

0reactions
Eldiabolo21commented, Oct 17, 2022

I can’t really say, as this seem to be more a symptom than the real problem. As I wrote before, the script went through and the power supply issues weren’t a problem any more, when I added the correct serial number to netbox. This leads me to belive there is something wrong with the mechanism of mapping the inventory ID.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does a power supply draw only as much power as it needs?
The higher the maximum power is that a power supply can provide, the higher is the amount of energy it takes to heat...
Read more >
ASR 9K Power-supply - Cisco Community
Hello, I have some questions about ASR9K's Power-supply when I Issue ... what 1368.3(Total num of 0/PM0/*~0/PM3/*) and Power Draw indicate.
Read more >
How Many Watts You Need for a PC PSU (2020) - YouTube
We're testing how many watts you need for the average PC build, testing system load versus power supply 'size.' We're looking into how...
Read more >
The Brewing Problem with GPU Power Design | Transients
The power draw of this card prompted investigation into how much power ... If you want a PSU that handled Transient spikes in...
Read more >
Any disadvantage to over-sizing power supply? - Reddit
They have a peak efficiency that is a certain % of its rating, as well as a minimum draw. You can look up...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found