ICT Power Current Polling returning warning and not graphing

My first time submitting to a forum like this so my apologies. I

I am adding ICT Power ICT200DB-12IRC power panels into librenms and I noticed that the current sensors for the individual power breakers are only showing as 0 on the graphs. Searching the forums I see where someone else reported similar problem back in 2019 but did not see a resolution. The poller is reporting:

Warning: is_nan() expects parameter 1 to be float, string given in /opt/librenms/includes/polling/functions.inc.php on line 165

Warning: A non-numeric value encountered in /opt/librenms/includes/polling/functions.inc.php on line 171

Here is a pastebin of the full poller output.


I was able to come up with a resolution by updating /opt/librenms/includes/polling/sensors/current/ict-pdu.inc.php with an elseif to match on the oids it is polling and execute them differently. JUst thought I’d share!

$oid_sensor = $sensor['sensor_oid'];

if ($oid_sensor == '.') {
    $sensor_value = abs(trim(str_replace('"', '', $snmp_data[$oid_sensor])));
} elseif (preg_match('/.|.', $oid_sensor)) {
    $sensor_value = abs(trim(str_replace('"', '', $snmp_data[$sensor['sensor_oid']])));
} else {
    $sensor_value = trim(str_replace('"', '', $snmp_data[$sensor['sensor_oid'] . '.0']));

If you found a fix please submit it as a pull request so we can merge it to fix it for everyone.


Although, since it seems to be a single file change, it probably would be easy to submit using the github website.

This topic was automatically closed 186 days after the last reply. New replies are no longer allowed.