$entry) { $data = [ 'device_id' => $device['device_id'], 'sla_mib' => 'HPICF-IPSLA-MIB', 'sla_index' => $sla_index, //'sla_owner' => $entry['rttMonCtrlAdminOwner'], //'sla_tag' => $entry['rttMonCtrlAdminTag'], 'rtt_type' => $entry['hpicfIpSlaType'], // Possible: icmpEcho(1), udpEcho(2), udpJitter(3), udpJitterVoIP(4), // tcpConnect(5), dhcp(6), dns(7) 'sla_status' => $entry['hpicfIpSlaRowStatus'], // Possible: active, notInService, notReady, createAndGo, createAndWait, destroy 'deleted' => 0, ]; // Use jitter or simple echo graph for SLA if (str_icontains_array($data['rtt_type'], 'jitter')) { $data['sla_graph'] = 'jitter'; } else { $data['sla_graph'] = 'echo'; } // Target switch ($entry['hpicfIpSlaDestAddressType']) { case 'ipv4': case 'ipv6': $data['sla_target'] = hex2ip($entry['hpicfIpSlaDestAddress']); break; case 'ipv4z': case 'ipv6z': // Not tested $data['sla_target'] = hex2ip($entry['hpicfIpSlaDestAddress']); break; case 'dns': [$data['sla_tag'], , $data['sla_target']] = explode("\n", snmp_hexstring($entry['hpicfIpSlaDestAddress'])); break; default: if ($entry['hpicfIpSlaType'] == 'dhcp') { $data['sla_target'] = 'Interface ' . $entry['hpicfIpSlaSourceInterface']; } else { $data['sla_target'] = snmp_hexstring($entry['hpicfIpSlaDestAddress']); } 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['hpicfIpSlaMsgResTimeout'] > 0 ? $entry['hpicfIpSlaMsgResTimeout'] : 5000); $data['sla_limit_high_warn'] = intval($data['sla_limit_high'] / 5); $sla_table['HPICF-IPSLA-MIB'][$sla_index] = $data; // Pull to array for main processing } // EOF