Adding adittional data fields for APC PDU AP8659 in overview section

Hello community,
Didn’t find exact topic, so looking for help here.

We are using APC switched/metered PDU AP8659.

LibreNMS gets a lot of data from PDU via SNMP and works fine.

What we miss - Power and energy consumption per outlet.

In the Device Overview section (page), we see the following subsections:
Temperature,
Humidity,
Voltage, per device
Current, per outlet
Power, Total (per device)
Power consumed, Total
and State

In the Current subsection, LibreNMS shows the current value of each outlet.

In the Power and Power consumed subsections, LibreNMS only shows Total power and total device consumption.

We really need LibreNMS to show Power in the same way as it shows Current - the value per outlet
We really need LibreNMS to show Power Consumed (energy) per outlet.

I want to ask LibreNMS devs, can it be possible to add the necessary data?

Or maybe you can help me figure out how to do it myself?

PS. I’ve added Custom OIDs at the moment and I’m getting the information I need . However, I think adding missing data to overview section would be beneficial for everyone.

Hi,
i understant, that team is busy, but could someone point me where to dig into?

Edit includes/definitions/discovery/apc.yaml to include what you need. Docs should cover this.

okay, file looks this: librenms/includes/definitions/discovery/apc.yaml at master · librenms/librenms · GitHub
i have added
oid: .1.3.6.1.4.1.318.1.1.26.9.4.3.1.7
class: outlet
component: power
items:
outlet1:
oid: .1.3.6.1.4.1.318.1.1.26.9.4.3.1.7.1
name: Outlet 1 Power
type: INTEGER
outlet2:
oid: .1.3.6.1.4.1.318.1.1.26.9.4.3.1.7.2
name: Outlet 2 Power
type: INTEGER

here oid .1.3.6.1.4.1.318.1.1.26.9.4.3.1.7.x ,where x from 1 to 24. but that didn’t work for me… give me second chance? :slight_smile:

That’s the wrong format, if you look at existing examples within that file it should show you what and how you need to add it.

I’m so sorry, but could you drop link to example?

You’ve literally linked to the file in your other reply to me. Check that file out and you’ll see the format you’ve tried is not right.

Thank you @laf that pointed me in the right direction.
Someone was very smart and left remark # rPDULoadStatusLoad and rPDU2PhaseStatusCurrent at OID .1.3.6.1.4.1.318.1.1.26.6.3.1.5 is done in the includes/discovery/sensors/current/apc.inc.php:19 file
It saved for me alot of time. Thanks for him :slight_smile:

To get what i need, it seems enough in includes/discovery/sensors/current/apc.inc.php // Per Outlet Power Bar section insert:
// Actual power OID
$actual_power_oid = ‘.1.3.6.1.4.1.318.1.1.26.9.4.3.1.7.’ . $index;
and
// Get the actual power value without division
$actual_power = snmp_get($device, $actual_power_oid, ‘-Oqv’, ‘’);

and right after current register power:
// Power discovery without value division
discover_sensor(null, ‘power’, $device, $actual_power_oid, $index, $type, $descr, ‘10’, ‘1’, null, null, null, null, $actual_power);

Next pitstop…
additionally to actual power sent by outlet we need to see energy sent by outlet.
i have tried to add like power, but with no luck.
$energy_oid = ‘.1.3.6.1.4.1.318.1.1.26.9.4.3.1.11.’ . $index;
$energy_kwh = snmp_get($device, $energy_oid, ‘-Oqv’, ‘’);
discover_sensor(null, ‘Energy sent by Outlet’, $device, $energy_oid, $index, $type, $descr . ’ - Energy since ’ . $start_time, ‘10’, ‘1’, null, null, null,

@laf could you help me with that?