Cyberpower UPS with RMCARD205 - Current value is off by a power of 10 - divisor fix?

I have multiple Cyberpower UPS units (OR1000LCDRM1U) with the SNMP network card in them. It is the model RMCARD205

LibreNMS shows the units fine, but the “Current” value that it shows is off by a power of 10.

This is what I see in the UPS for the Current value (It only has 1 Juniper EX4300-P switch plugged into it), and then this is what LibreNMS shows me.

I was able to edit the cyberpower.yaml file in /opt/librenms/includes/definitions/discovery to have the divisor value under the current area and it did show the proper value in LibreNMS after that. But once I modify that file it will then fail the validate and daily since I modified the file. I am guessing the only way I will not fail the update and validate is if these changes are made in github somehow? What is the proper process to request that change other than posting here?

Have a look at includes/discovery/sensors/current/cyberpower.inc.php, this is how sensors are being discovered and the divisor is present there.
Contribution process is described right here, it is pretty much straight-forward, but for commit like yours you would require to run tests as well.

@angryp

Looking at that file, I guess I am a tad more confused. I am NOT a programmer, it is a weakness of mine.

The file cyberpower.inc.php in /opt/librenms/includes/discovery/sensors/current/ describes the Input Current, not the Output Current.

Also the code is confusing and if I am out place, please tell me.

<?php

// input current
$oids = snmp_get($device, '.1.3.6.1.4.1.3808.1.1.3.2.3.1.1.2.1', '-OsqnU');
d_echo($oids."\n");

if ($oids) {
    echo ' Cyberpower Input Current';
    list($oid, $current) = explode(' ', $oids);
    $divisor            = 10;
    $type               = 'cyberpower';
    $descr              = 'Input';
    $current=$current/10;
    discover_sensor($valid['sensor'], 'current', $device, $oid, '0', $type, $descr, $divisor, '1', null, null, null, null, $current);
}

I am confused as to why there is a $divisor variable and then the $current variable is itself divided by 10.

Then it’s easy - add about the same section describing Output Current with respective OID, so that the sensor would be at least discoverable. Then you can play around with divisors.

A good example how it may look like - /opt/librenms/includes/discovery/sensors/current/eatonups.inc.php file, starting with line 18.

I’m no developer as well. I usually look at the code already present and copy-paste it with little adjustments. The main contributors have already made all the patterns, so it’s really easy to adapt to your needs.