diff --git a/LibreNMS/Modules/Xdsl.php b/LibreNMS/Modules/Xdsl.php index 1e09361ed1..113737de3b 100644 --- a/LibreNMS/Modules/Xdsl.php +++ b/LibreNMS/Modules/Xdsl.php @@ -150,6 +150,12 @@ class Xdsl implements Module $portAdsl->port_id = $os->ifIndexToId($ifIndex); + if ($portAdsl->port_id == 0) { + // failure of ifIndexToId(), port_id is invalid, and syncModels will crash + echo ' ADSL( Failed to discover this port, ifIndex invalid : ' . $portAdsl->adslLineCoding . '/' . Number::formatSi($portAdsl->adslAtucChanCurrTxRate, 2, 3, 'bps') . '/' . Number::formatSi($portAdsl->adslAturChanCurrTxRate, 2, 3, 'bps') . ') '; + continue; + } + if ($datastore) { $this->storeAdsl($portAdsl, $data, (int) $ifIndex, $os, $datastore); echo ' ADSL(' . $portAdsl->adslLineCoding . '/' . Number::formatSi($portAdsl->adslAtucChanCurrTxRate, 2, 3, 'bps') . '/' . Number::formatSi($portAdsl->adslAturChanCurrTxRate, 2, 3, 'bps') . ') ';