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:
dennypage
2021-08-03 07:31:00 -07:00
committed by GitHub
parent 332641236c
commit 049b7af3d5
8 changed files with 28392 additions and 7 deletions

View File

@@ -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);