$entry) { 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; } $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'; } // 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']; } // 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 } // EOF