initial commit; version 22.5.12042
This commit is contained in:
41
includes/discovery/status/atto6500n-mib.inc.php
Normal file
41
includes/discovery/status/atto6500n-mib.inc.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage discovery
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
// 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);
|
||||
|
||||
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'));
|
||||
}
|
||||
|
||||
$atto_sas_ports = snmpwalk_cache_oid($device, 'sasPortPortNumber', array(), $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";
|
||||
|
||||
// FIXME same as above
|
||||
discover_status($device, $index, "sasPortOperationalState.$index", 'atto6500n-mib-sasPort', $sensorName, NULL, array('entPhysicalClass' => 'port'));
|
||||
}
|
||||
|
||||
unset($atto_fc_ports, $atto_sas_ports);
|
||||
|
||||
// EOF
|
||||
97
includes/discovery/status/cisco-stackwise-mib.inc.php
Normal file
97
includes/discovery/status/cisco-stackwise-mib.inc.php
Normal file
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage discovery
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2020 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
// CISCO-STACKWISE-MIB::cswSwitchNumCurrent.1001 = Gauge32: 1
|
||||
// CISCO-STACKWISE-MIB::cswSwitchNumNextReload.1001 = Gauge32: 1
|
||||
// CISCO-STACKWISE-MIB::cswSwitchRole.1001 = INTEGER: master(1)
|
||||
// CISCO-STACKWISE-MIB::cswSwitchSwPriority.1001 = Gauge32: 1
|
||||
// CISCO-STACKWISE-MIB::cswSwitchHwPriority.1001 = Gauge32: 5
|
||||
// CISCO-STACKWISE-MIB::cswSwitchState.1001 = INTEGER: ready(4)
|
||||
// CISCO-STACKWISE-MIB::cswSwitchMacAddress.1001 = STRING: 3c:5e:c3:cb:d3:0
|
||||
// CISCO-STACKWISE-MIB::cswSwitchSoftwareImage.1001 = STRING: C2960X-UNIVERSALK9-M
|
||||
// CISCO-STACKWISE-MIB::cswSwitchPowerBudget.1001 = Gauge32: 0 Watts
|
||||
// CISCO-STACKWISE-MIB::cswSwitchPowerCommited.1001 = Gauge32: 0 Watts
|
||||
// CISCO-STACKWISE-MIB::cswSwitchSystemPowerPriority.1001 = Gauge32: 0
|
||||
// CISCO-STACKWISE-MIB::cswSwitchPoeDevicesLowPriority.1001 = Gauge32: 0
|
||||
// CISCO-STACKWISE-MIB::cswSwitchPoeDevicesHighPriority.1001 = Gauge32: 0
|
||||
// CISCO-STACKWISE-MIB::cswStackPortOperStatus.5180 = INTEGER: down(2)
|
||||
// CISCO-STACKWISE-MIB::cswStackPortOperStatus.5181 = INTEGER: down(2)
|
||||
// CISCO-STACKWISE-MIB::cswStackPortNeighbor.5180 = INTEGER: 0
|
||||
// CISCO-STACKWISE-MIB::cswStackPortNeighbor.5181 = INTEGER: 0
|
||||
$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');
|
||||
|
||||
$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
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
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'));
|
||||
//discover_status($device, $oid, "cswRingRedundant.0", 'cisco-stackwise-redundant-state', $descr, $stackredundant, array('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'];
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "No stacking detected.";
|
||||
}
|
||||
}
|
||||
|
||||
unset($device_tmp);
|
||||
|
||||
// EOF
|
||||
44
includes/discovery/status/eqldisk-mib.inc.php
Normal file
44
includes/discovery/status/eqldisk-mib.inc.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage discovery
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
// 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');
|
||||
|
||||
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'];
|
||||
|
||||
if ($value !== '')
|
||||
{
|
||||
discover_status_ng($device, $mib, 'eqlDiskStatus', $oid, $index, 'eql-disk-state', $descr, $value, array('entPhysicalClass' => 'storage'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// EOF
|
||||
Reference in New Issue
Block a user