Description
SNR switches (for example S29xx) can be stacked.
$os = "snr-switch";
|
current MIB:
https://data.nag.wiki/SNR%20Switches/MIBs/SNR-SWITCH_private_2.1.147.mib
need change to not discover CPU of master in stack:
Index: includes/definitions/mibs/dcn/dcn-xxx.php
|
===================================================================
|
--- includes/definitions/mibs/dcn/dcn-xxx.php (revision 15432)
|
+++ includes/definitions/mibs/dcn/dcn-xxx.php (working copy)
|
@@ -41,7 +41,8 @@
|
'oid_descr' => 'switchCPUType',
|
'oid' => 'switchCpuUsage',
|
//'oid_num' => '.1.3.6.1.4.1.6339.100.1.11.3',
|
- 'indexes' => [ 0 => [ 'descr' => '%oid_descr%' ] ]
|
+ 'indexes' => [ 0 => [ 'descr' => '%oid_descr%' ] ],
|
+ 'pre_test' => [ 'oid' => $mib . '::sysStackFlag.0', 'operator' => 'ne', 'value' => "stack" ]
|
];
|
|
/*
|
Tables of supported OIDs:
| noStack | stack | ||
|---|---|---|---|
| sysHardwareVersion.0 | |||
| sysSoftwareVersion.0 | only for master | ||
| sysStackFlag.0 | noStack(2) | stack(1) | |
| sysPowerStateTable.sysPowerState.<index> | |||
| sysPowerStateTable.sysPowerStatus.<index> | |||
| sysPowerStateTable.sysPowerSupplyType.<index> | |||
| sysSlotTable.sysCPUType.<index> | |||
| sysSlotTable.sysCPUFiveMinuteIdle.<index> | |||
| sysSlotTable.sysMemorySize.<index> | |||
| sysSlotTable.sysMemoryBusy.<index> | |||
| sysSlotTable.sysFlashSize.<index> | |||
| sysSlotTable.sysTemperature.<index> | |||
| sysSlotTable.sysCpuUsage.<index> | |||
| sysSlotTable.sysMemoryUsage.<index> | |||
| sysSlotTable.sysMemUsage.<index> | |||
| sysSlotTable.sysFreeFlashSize.<index> | |||
| sysSlotTable.sysMemorySizeInMB.<index> | |||
| switchInfoTable.swModuleType.<index> | internal vendor (DCN) model identifier | ||
| switchInfo.switchCPUType.0 | |||
| switchInfo.switchCPUFiveMinuteIdle.0 | |||
| switchInfo.switchMemorySize.0 | |||
| switchInfo.switchMemoryBusy.0 | |||
| switchInfo.switchFlashSize.0 | |||
| switchInfo.switchTemperature.0 | |||
| switchInfo.switchCpuUsage.0 | |||
| switchInfo.switchMemoryUsage.0 | |||
| switchInfo.switchFlashOccupiedSize.0 | |||
| switchInfo.switchFlashFreeSize.0 | |||
| switchInfo.switchFlashSizeInBytes.0 | |||
| switchInfo.switchFlashOccupiedSizeInBytes.0 | |||
| switchInfo.switchFlashFreeSizeInBytes.0 |
inventory for stack
Is it possible to add all device chassis to inventory?
now ther is always one in ENTITY-MIB::entPhysicalTable
switchInfoTable
|
SNR-SWITCH-MIB::swSlotIndex.1.0 = INTEGER: 1
|
SNR-SWITCH-MIB::swSlotIndex.2.0 = INTEGER: 2
|
SNR-SWITCH-MIB::swUnitIndex.1.0 = INTEGER: 0
|
SNR-SWITCH-MIB::swUnitIndex.2.0 = INTEGER: 0
|
SNR-SWITCH-MIB::swModuleType.1.0 = INTEGER: 460
|
SNR-SWITCH-MIB:: .2.0 = INTEGER: 460
|
The idea is only for stacked (SNR-SWITCH-MIB::sysStackFlag.0 = stack)
get ENTITY-MIB::entPhysicalTable chassis
- real example: found one (entPhysicalClass = chassis) with entPhysicalDescr ="NAG LLC chassis model SNR-S2995G-24TX"
- get SNR-SWITCH-MIB::switchInfoTable
- real example: found two Slots (1.0 and 2.0) with swModuleType 460
- so we have really two chasisses with same model, can create manualy entry for all from switchInfoTable
- entPhysicalIndex get from first part switchInfoTable index (1.0 -> 1 ; 2.0 -> 2, ...)
- inventory_mib = SNR-SWICTH
- entPhysicalDescr same as chassis from entPhysicalTable IF have same swModuleType
- entPhysicalIsFRU same as chassis from entPhysicalTable IF have same swModuleType
- entPhysicalModelName same as chassis from entPhysicalTable IF have same swModuleType
- entPhysicalMfgName same as chassis from entPhysicalTable IF have same swModuleType
- entPhysicalAlias rewrite to swModuleType (empty in ENTITY-MIB::entPhysicalTable)
- entPhysicalContainedIn = 0
- entPhysicalParentRelPos = first part switchInfoTable index
- entPhysicalClass = chassis
- entPhysicalHardwareRev = N/a or NULL or empty
- entPhysicalFirmwareRev = N/a or NULL or empty
- entPhysicalSoftwareRev = N/a or NULL or empty
- entPhysicalAssetID = N/a or NULL or empty
- entPhysicalVendorType = N/a or NULL or empty
- entPhysicalSerialNum = N/a or NULL or empty
- so we have really two chasisses with same model, can create manualy entry for all from switchInfoTable
- real example: found two Slots (1.0 and 2.0) with swModuleType 460
when attach to inventory ports from SNR-SWITCH-MIB::priPortTable set entPhysicalContainedIn to correct chassis
SNR-SWITCH-MIB::priPortTable.priPortEntry.portName.1 = STRING: "Ethernet1/0/1"
1/0/x – is link to index from switchInfoTab