Commit version 24.12.13800

This commit is contained in:
2025-01-06 17:35:06 -05:00
parent b7f6a79c2c
commit 55d9218816
6133 changed files with 4239740 additions and 1374287 deletions

View File

@ -4,36 +4,34 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
// FIXME this is not working statuses, need move to ports module or separate FC ports module
$atto_fc_ports = snmpwalk_cache_oid($device, 'fcPortPortNumber', array(), $mib);
$atto_fc_ports = snmpwalk_cache_oid($device, 'fcPortPortNumber', [], $mib);
foreach ($atto_fc_ports as $port)
{
$index = $port['fcPortPortNumber'];
$sensorName = "FiberChannel Port.$index";
$oid = ".1.3.6.1.4.1.4547.2.3.3.1.1.3.$index";
foreach ($atto_fc_ports as $port) {
$index = $port['fcPortPortNumber'];
$sensorName = "FiberChannel Port.$index";
$oid = ".1.3.6.1.4.1.4547.2.3.3.1.1.3.$index";
// FIXME why value NULL? Just use the entry from $port['whatevertheoidis'] ?
discover_status($device, $index, "fcPortOperationalState.$index", 'atto6500n-mib-fcPort', $sensorName, NULL, array('entPhysicalClass' => 'port'));
discover_status($device, $index, "fcPortOperationalState.$index", 'atto6500n-mib-fcPort', $sensorName, NULL, ['entPhysicalClass' => 'port']);
}
$atto_sas_ports = snmpwalk_cache_oid($device, 'sasPortPortNumber', array(), $mib);
$atto_sas_ports = snmpwalk_cache_oid($device, 'sasPortPortNumber', [], $mib);
foreach ($atto_sas_ports as $port)
{
$index = $port['sasPortPortNumber'];
$sensorName = "SAS Port $index";
$oid = ".1.3.6.1.4.1.4547.2.3.3.3.1.2.$index";
foreach ($atto_sas_ports as $port) {
$index = $port['sasPortPortNumber'];
$sensorName = "SAS Port $index";
$oid = ".1.3.6.1.4.1.4547.2.3.3.3.1.2.$index";
// FIXME same as above
discover_status($device, $index, "sasPortOperationalState.$index", 'atto6500n-mib-sasPort', $sensorName, NULL, array('entPhysicalClass' => 'port'));
discover_status($device, $index, "sasPortOperationalState.$index", 'atto6500n-mib-sasPort', $sensorName, NULL, ['entPhysicalClass' => 'port']);
}
unset($atto_fc_ports, $atto_sas_ports);

View File

@ -4,9 +4,9 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2020 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
@ -30,65 +30,59 @@
$device_tmp = $device;
// Disable snmp bulk and retries, because some 2960S freeze on this walks
$device_tmp['snmp_retries'] = 1;
$device_tmp['snmp_nobulk'] = TRUE;
$stackredundant = snmp_get_oid($device_tmp, 'cswRingRedundant.0', 'CISCO-STACKWISE-MIB');
if (snmp_status())
{
$stackstatus = snmpwalk_cache_oid($device_tmp, 'cswSwitchInfoEntry', array(), 'CISCO-STACKWISE-MIB');
$stackportoper = snmpwalk_cache_oid($device_tmp, 'cswStackPortOperStatus', array(), 'CISCO-STACKWISE-MIB');
$device_tmp['snmp_nobulk'] = TRUE;
$stackredundant = snmp_get_oid($device_tmp, 'cswRingRedundant.0', 'CISCO-STACKWISE-MIB');
if (snmp_status()) {
$stackstatus = snmpwalk_cache_oid($device_tmp, 'cswSwitchInfoEntry', [], 'CISCO-STACKWISE-MIB');
$stackportoper = snmpwalk_cache_oid($device_tmp, 'cswStackPortOperStatus', [], 'CISCO-STACKWISE-MIB');
$ports_down = 0;
foreach ($stackportoper as $entry)
{
// Count down ports for check if stack exist
if ($entry['cswStackPortOperStatus'] === 'down') { $ports_down++; }
}
$stack_count = count($stackstatus); // Count stack members
foreach ($stackstatus as $index => $entry)
{
$roleoid = '.1.3.6.1.4.1.9.9.500.1.2.1.1.3.'.$index;
$roledescr = 'Switch '.$entry['cswSwitchNumCurrent'].' stacking role';
$stateoid = '.1.3.6.1.4.1.9.9.500.1.2.1.1.6.'.$index;
$statedescr = 'Switch '.$entry['cswSwitchNumCurrent'].' stacking state';
if ($stack_count === 1 && $entry['cswSwitchNumCurrent'] == 1 && $stackredundant === 'false' &&
$ports_down === 2 && $entry['cswSwitchRole'] === 'master' && $entry['cswSwitchState'] === 'ready')
{
// Heh, on IOS 15.x stacking is always enabled and does not have any way to detect if stack module exists and stacking is configured
$stack_count = 0;
print_debug("Stacking exists, but not configured and not active.");
break; // exit foreach
$ports_down = 0;
foreach ($stackportoper as $entry) {
// Count down ports for check if stack exist
if ($entry['cswStackPortOperStatus'] === 'down') {
$ports_down++;
}
}
if (!empty($entry['cswSwitchRole']))
{
discover_status_ng($device, $mib, 'cswSwitchRole', $roleoid, $index, 'cisco-stackwise-member-state', $roledescr, $entry['cswSwitchRole'], array('entPhysicalClass' => 'stack', 'entPhysicalIndex' => $index));
discover_status_ng($device, $mib, 'cswSwitchState', $stateoid, $index, 'cisco-stackwise-switch-state', $statedescr, $entry['cswSwitchState'], array('entPhysicalClass' => 'stack', 'entPhysicalIndex' => $index));
$stack_count = count($stackstatus); // Count stack members
foreach ($stackstatus as $index => $entry) {
$roleoid = '.1.3.6.1.4.1.9.9.500.1.2.1.1.3.' . $index;
$roledescr = 'Switch ' . $entry['cswSwitchNumCurrent'] . ' stacking role';
$stateoid = '.1.3.6.1.4.1.9.9.500.1.2.1.1.6.' . $index;
$statedescr = 'Switch ' . $entry['cswSwitchNumCurrent'] . ' stacking state';
if ($stack_count === 1 && $entry['cswSwitchNumCurrent'] == 1 && $stackredundant === 'false' &&
$ports_down === 2 && $entry['cswSwitchRole'] === 'master' && $entry['cswSwitchState'] === 'ready') {
// Heh, on IOS 15.x stacking is always enabled and does not have any way to detect if stack module exists and stacking is configured
$stack_count = 0;
print_debug("Stacking exists, but not configured and not active.");
break; // exit foreach
}
if (!empty($entry['cswSwitchRole'])) {
discover_status_ng($device, $mib, 'cswSwitchRole', $roleoid, $index, 'cisco-stackwise-member-state', $roledescr, $entry['cswSwitchRole'], ['entPhysicalClass' => 'stack', 'entPhysicalIndex' => $index]);
discover_status_ng($device, $mib, 'cswSwitchState', $stateoid, $index, 'cisco-stackwise-switch-state', $statedescr, $entry['cswSwitchState'], ['entPhysicalClass' => 'stack', 'entPhysicalIndex' => $index]);
}
}
}
if ($stack_count)
{
$oid = '.1.3.6.1.4.1.9.9.500.1.1.3.0';
$descr = 'Stackports in redundant ring';
discover_status_ng($device, $mib, 'cswRingRedundant', $oid, '0', 'cisco-stackwise-redundant-state', $descr, $stackredundant, array('entPhysicalClass' => 'stack'));
if ($stack_count) {
$oid = '.1.3.6.1.4.1.9.9.500.1.1.3.0';
$descr = 'Stackports in redundant ring';
discover_status_ng($device, $mib, 'cswRingRedundant', $oid, '0', 'cisco-stackwise-redundant-state', $descr, $stackredundant, ['entPhysicalClass' => 'stack']);
foreach ($stackportoper as $index => $entry)
{
$oid = '.1.3.6.1.4.1.9.9.500.1.2.2.1.1.'.$index;
$port = get_port_by_index_cache($device, $index);
$descr = 'Stackport ' . $port['port_label'];
foreach ($stackportoper as $index => $entry) {
$oid = '.1.3.6.1.4.1.9.9.500.1.2.2.1.1.' . $index;
$port = get_port_by_index_cache($device, $index);
$descr = 'Stackport ' . $port['port_label'];
if (!empty($entry['cswStackPortOperStatus']))
{
$options = array('entPhysicalClass' => 'port', 'entPhysicalIndex' => $index, 'measured_class' => 'port', 'measured_entity' => $port['port_id']);
discover_status_ng($device, $mib, 'cswStackPortOperStatus', $oid, $index, 'cisco-stackwise-port-oper-state', $descr, $entry['cswStackPortOperStatus'], $options);
}
if (!empty($entry['cswStackPortOperStatus'])) {
$options = ['entPhysicalClass' => 'port', 'entPhysicalIndex' => $index, 'measured_class' => 'port', 'measured_entity' => $port['port_id']];
discover_status_ng($device, $mib, 'cswStackPortOperStatus', $oid, $index, 'cisco-stackwise-port-oper-state', $descr, $entry['cswStackPortOperStatus'], $options);
}
}
} else {
echo "No stacking detected.";
}
} else {
echo "No stacking detected.";
}
}
unset($device_tmp);

View File

@ -5,40 +5,36 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
// Note, device attrib 'eqlgrpmemid' sets in equallogic 'os' module.
$eqlgrpmemid = get_dev_attrib($device, 'eqlgrpmemid');
if (is_numeric($eqlgrpmemid))
{
// EQLDISK-MIB::eqlDiskModelNumber.1.1049142137.1 = STRING: ST3450857SS
// EQLDISK-MIB::eqlDiskModelNumber.1.1049142137.2 = STRING: ST3450857SS
// EQLDISK-MIB::eqlDiskStatus.1.1049142137.1 = INTEGER: on-line(1)
// EQLDISK-MIB::eqlDiskStatus.1.1049142137.2 = INTEGER: on-line(1)
// EQLDISK-MIB::eqlDiskId.1.1049142137.1 = INTEGER: 0
// EQLDISK-MIB::eqlDiskId.1.1049142137.2 = INTEGER: 1
$cache['equallogic']['eqlDiskTable'] = snmpwalk_cache_oid($device, 'eqlDiskTable', array(), 'EQLDISK-MIB');
if (is_numeric($eqlgrpmemid)) {
// EQLDISK-MIB::eqlDiskModelNumber.1.1049142137.1 = STRING: ST3450857SS
// EQLDISK-MIB::eqlDiskModelNumber.1.1049142137.2 = STRING: ST3450857SS
// EQLDISK-MIB::eqlDiskStatus.1.1049142137.1 = INTEGER: on-line(1)
// EQLDISK-MIB::eqlDiskStatus.1.1049142137.2 = INTEGER: on-line(1)
// EQLDISK-MIB::eqlDiskId.1.1049142137.1 = INTEGER: 0
// EQLDISK-MIB::eqlDiskId.1.1049142137.2 = INTEGER: 1
$cache['equallogic']['eqlDiskTable'] = snmpwalk_cache_oid($device, 'eqlDiskTable', [], 'EQLDISK-MIB');
foreach ($cache['equallogic']['eqlDiskTable'] as $index => $entry)
{
if (strstr($index, $eqlgrpmemid))
{
$descr = 'Disk '.$entry['eqlDiskId'] . ': ' . trim($entry['eqlDiskModelNumber']);
foreach ($cache['equallogic']['eqlDiskTable'] as $index => $entry) {
if (strstr($index, $eqlgrpmemid)) {
$descr = 'Disk ' . $entry['eqlDiskId'] . ': ' . trim($entry['eqlDiskModelNumber']);
$oid = '.1.3.6.1.4.1.12740.3.1.1.1.8.'.$index;
$value = $entry['eqlDiskStatus'];
$oid = '.1.3.6.1.4.1.12740.3.1.1.1.8.' . $index;
$value = $entry['eqlDiskStatus'];
if ($value !== '')
{
discover_status_ng($device, $mib, 'eqlDiskStatus', $oid, $index, 'eql-disk-state', $descr, $value, array('entPhysicalClass' => 'storage'));
}
if ($value !== '') {
discover_status_ng($device, $mib, 'eqlDiskStatus', $oid, $index, 'eql-disk-state', $descr, $value, ['entPhysicalClass' => 'storage']);
}
}
}
}
}
// EOF