mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Allow stack index other than '1.' for CiscoSB (#13078)
* When in a stack, the index for each port is based on the unit number in the stack. The first unit in the stack uses index '1.', the second uses index '2.', the third '3.' and so on. This change allows for stack indexes greater than '1' * Create ciscosb_cbs350-4x.snmprec * Create ciscosb_cbs350-4x.json Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
@@ -17,7 +17,7 @@ if (is_array($temp)) {
|
||||
$divisor = '1000';
|
||||
foreach ($temp as $index => $entry) {
|
||||
if (is_numeric($temp[$index]['rlPethPsePortOutputPower']) && $temp[$index]['rlPethPsePortOutputPower'] > 0) {
|
||||
$port_descr = get_port_by_index_cache($device['device_id'], str_replace('1.', '', $index));
|
||||
$port_descr = get_port_by_index_cache($device['device_id'], preg_replace('/^\d+\./', '', $index));
|
||||
$descr = $port_descr['ifDescr'] . ' PoE';
|
||||
$highlimit = $temp[$index]['rlPethPsePortOperPowerLimit'] / $divisor;
|
||||
discover_sensor($valid['sensor'], 'power', $device, $cur_oid . $index, $index, 'ciscosb', $descr, $divisor, '1', null, null, null, $highlimit, $temp[$index]['rlPethPsePortOutputPower'] / $divisor, 'snmp', $index);
|
||||
|
Reference in New Issue
Block a user