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,9 +4,9 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
@ -27,81 +27,77 @@ $oids = snmpwalk_cache_oid($device, "crttMonIPEchoAdminTargetAddress", $oids, 'C
//$oids = snmpwalk_cache_oid($device, "crttMonIPEchoAdminSourceAddress", $oids, 'CISCO-RTTMON-IP-EXT-MIB');
foreach ($oids as $sla_index => $entry) {
if (!isset($entry['rttMonCtrlAdminStatus']) || // Skip additional multiindex entries from table
$entry['rttMonCtrlOperState'] === 'inactive') { // Skip inactive entries
continue;
}
if (!isset($entry['rttMonCtrlAdminStatus']) || // Skip additional multiindex entries from table
$entry['rttMonCtrlOperState'] === 'inactive') { // Skip inactive entries
continue;
}
// FIXME. Temporary hack, while this type of Jitter unsupported by Cisco
switch ($entry['rttMonCtrlAdminRttType']) {
case '34':
// See: https://jira.observium.org/browse/OBS-3053
// https://community.cisco.com/t5/routing/ip-sla-path-jitter-snmp-mib/td-p/2890302
// https://community.cisco.com/t5/switching/ipsla-path-jitter-monitoring/td-p/2131136
// CISCO-RTTMON-MIB::rttMonCtrlAdminRttType.200 = INTEGER: 34
$entry['rttMonCtrlAdminRttType'] = 'pathjitter';
break;
}
// FIXME. Temporary hack, while this type of Jitter unsupported by Cisco
switch ($entry['rttMonCtrlAdminRttType']) {
case '34':
// See: https://jira.observium.org/browse/OBS-3053
// https://community.cisco.com/t5/routing/ip-sla-path-jitter-snmp-mib/td-p/2890302
// https://community.cisco.com/t5/switching/ipsla-path-jitter-monitoring/td-p/2131136
// CISCO-RTTMON-MIB::rttMonCtrlAdminRttType.200 = INTEGER: 34
$entry['rttMonCtrlAdminRttType'] = 'pathjitter';
break;
}
$data = array(
'device_id' => $device['device_id'],
'sla_mib' => 'CISCO-RTTMON-MIB',
'sla_index' => $sla_index,
'sla_owner' => trim(snmp_hexstring($entry['rttMonCtrlAdminOwner'])),
'sla_tag' => trim(snmp_hexstring($entry['rttMonCtrlAdminTag'])),
'rtt_type' => $entry['rttMonCtrlAdminRttType'], // Possible: echo, pathEcho, fileIO, script, udpEcho, tcpConnect, http, dns, jitter, dlsw, dhcp,
// ftp, voip, rtp, lspGroup, icmpjitter, lspPing, lspTrace, ethernetPing, ethernetJitter,
// lspPingPseudowire, video, y1731Delay, y1731Loss, mcastJitter,
// (currently unsupported by vendor MIBs): pathjitter
'sla_status' => $entry['rttMonCtrlAdminStatus'], // Possible: active, notInService, notReady, createAndGo, createAndWait, destroy
'deleted' => 0,
);
$data = [
'device_id' => $device['device_id'],
'sla_mib' => 'CISCO-RTTMON-MIB',
'sla_index' => $sla_index,
'sla_owner' => trim(snmp_hexstring($entry['rttMonCtrlAdminOwner'])),
'sla_tag' => trim(snmp_hexstring($entry['rttMonCtrlAdminTag'])),
'rtt_type' => $entry['rttMonCtrlAdminRttType'], // Possible: echo, pathEcho, fileIO, script, udpEcho, tcpConnect, http, dns, jitter, dlsw, dhcp,
// ftp, voip, rtp, lspGroup, icmpjitter, lspPing, lspTrace, ethernetPing, ethernetJitter,
// lspPingPseudowire, video, y1731Delay, y1731Loss, mcastJitter,
// (currently unsupported by vendor MIBs): pathjitter
'sla_status' => $entry['rttMonCtrlAdminStatus'], // Possible: active, notInService, notReady, createAndGo, createAndWait, destroy
'deleted' => 0,
];
// Use jitter or simple echo graph for SLA
if (stripos($data['rtt_type'], 'jitter') !== FALSE)
{
$data['sla_graph'] = 'jitter';
} else {
$data['sla_graph'] = 'echo';
}
// Use jitter or simple echo graph for SLA
if (stripos($data['rtt_type'], 'jitter') !== FALSE) {
$data['sla_graph'] = 'jitter';
} else {
$data['sla_graph'] = 'echo';
}
// Target
switch ($data['rtt_type'])
{
case 'http':
case 'ftp':
$data['sla_target'] = trim(snmp_hexstring($entry['rttMonEchoAdminURL']));
break;
case 'dns':
$data['sla_target'] = trim(snmp_hexstring($entry['rttMonEchoAdminTargetAddressString']));
break;
case 'echo':
case 'jitter':
case 'icmpjitter':
default:
if (!empty($entry['crttMonIPEchoAdminTargetAddress']))
{
$data['sla_target'] = hex2ip($entry['crttMonIPEchoAdminTargetAddress']);
} else {
$data['sla_target'] = hex2ip($entry['rttMonEchoAdminTargetAddress']);
}
break;
}
// Target
switch ($data['rtt_type']) {
case 'http':
case 'ftp':
$data['sla_target'] = trim(snmp_hexstring($entry['rttMonEchoAdminURL']));
break;
case 'dns':
$data['sla_target'] = trim(snmp_hexstring($entry['rttMonEchoAdminTargetAddressString']));
break;
case 'echo':
case 'jitter':
case 'icmpjitter':
default:
if (!empty($entry['crttMonIPEchoAdminTargetAddress'])) {
$data['sla_target'] = hex2ip($entry['crttMonIPEchoAdminTargetAddress']);
} else {
$data['sla_target'] = hex2ip($entry['rttMonEchoAdminTargetAddress']);
}
break;
}
// Some fallbacks for when the tag is empty
if (!$data['sla_tag'])
{
$data['sla_tag'] = $data['sla_target'];
}
// Some fallbacks for when the tag is empty
if (!$data['sla_tag']) {
$data['sla_tag'] = $data['sla_target'];
}
// Limits
$data['sla_limit_high'] = ($entry['rttMonCtrlAdminTimeout'] > 0 ? $entry['rttMonCtrlAdminTimeout'] : 5000);
$data['sla_limit_high_warn'] = ($entry['rttMonCtrlAdminThreshold'] > 0 ? $entry['rttMonCtrlAdminThreshold'] : 1000);
if ($data['sla_limit_high_warn'] >= $data['sla_limit_high']) {
$data['sla_limit_high_warn'] = (int)($data['sla_limit_high'] / 5);
}
// Limits
$data['sla_limit_high'] = ($entry['rttMonCtrlAdminTimeout'] > 0 ? $entry['rttMonCtrlAdminTimeout'] : 5000);
$data['sla_limit_high_warn'] = ($entry['rttMonCtrlAdminThreshold'] > 0 ? $entry['rttMonCtrlAdminThreshold'] : 1000);
if ($data['sla_limit_high_warn'] >= $data['sla_limit_high']) {
$data['sla_limit_high_warn'] = (int)($data['sla_limit_high'] / 5);
}
$sla_table['CISCO-RTTMON-MIB'][$sla_index] = $data; // Pull to array for main processing
$sla_table['CISCO-RTTMON-MIB'][$sla_index] = $data; // Pull to array for main processing
}
// EOF