I’m seeing a discovery issue with LibreNMS on a Nokia 7705.
On this platform, TIMETRA-PORT-MIB::tmnxPortSFPNumLanes is not always returned. In LibreNMS/OS/Timos.php, the code is currently using that value directly for the channels field in the transceiver insert, which causes a database error when the value comes back null or empty. The relevant code is in the TiMOS transceiver discovery logic here: :contentReference[oaicite:0]{index=0}
This is the error I get during discovery:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'channels' cannot be null
The transceivers table has channels defined as NOT NULL, and for the 7705, if tmnxPortSFPNumLanes is missing, it really should just be treated as 1.
I tested the following change in /opt/librenms/LibreNMS/OS/Timos.php and this looks like the correct fix:
$channels = $data['TIMETRA-PORT-MIB::tmnxPortSFPNumLanes'] ?? null;
if ($channels === null || $channels === '') {
$channels = 1;
} else {
$channels = (int) $channels;
}
Then change the transceiver array entry to:
‘channels’ => $channels,
————————————————–
I do not have a running test system to submit this patch right now.