當前位置: 首頁>>代碼示例>>PHP>>正文


PHP NetworkPort::getUniqueObjectIDByFQDN方法代碼示例

本文整理匯總了PHP中NetworkPort::getUniqueObjectIDByFQDN方法的典型用法代碼示例。如果您正苦於以下問題:PHP NetworkPort::getUniqueObjectIDByFQDN方法的具體用法?PHP NetworkPort::getUniqueObjectIDByFQDN怎麽用?PHP NetworkPort::getUniqueObjectIDByFQDN使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在NetworkPort的用法示例。


在下文中一共展示了NetworkPort::getUniqueObjectIDByFQDN方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: executeActions

 function executeActions($output, $params)
 {
     if (count($this->actions)) {
         foreach ($this->actions as $action) {
             switch ($action->fields["action_type"]) {
                 case "send":
                     $ticket = new Ticket();
                     if ($ticket->getFromDB($output['id'])) {
                         NotificationEvent::raiseEvent('recall', $ticket);
                     }
                     break;
                 case "add_validation":
                     $output['_add_validation'] = $action->fields["value"];
                     break;
                 case "assign":
                     $output[$action->fields["field"]] = $action->fields["value"];
                     break;
                 case 'compute':
                     // Value could be not set (from test)
                     $urgency = isset($output['urgency']) ? $output['urgency'] : 3;
                     $impact = isset($output['impact']) ? $output['impact'] : 3;
                     // Apply priority_matrix from config
                     $output['priority'] = Ticket::computePriority($urgency, $impact);
                     break;
                 case "affectbyip":
                 case "affectbyfqdn":
                 case "affectbymac":
                     if (!isset($output["entities_id"])) {
                         $output["entities_id"] = $params["entities_id"];
                     }
                     if (isset($this->regex_results[0])) {
                         $regexvalue = RuleAction::getRegexResultById($action->fields["value"], $this->regex_results[0]);
                     } else {
                         $regexvalue = $action->fields["value"];
                     }
                     switch ($action->fields["action_type"]) {
                         case "affectbyip":
                             $result = NetworkPort::getUniqueObjectIDByIPAddressOrMac($regexvalue, "IP", $output["entities_id"]);
                             break;
                         case "affectbyfqdn":
                             $result = NetworkPort::getUniqueObjectIDByFQDN($regexvalue, $output["entities_id"]);
                             break;
                         case "affectbymac":
                             $result = NetworkPort::getUniqueObjectIDByIPAddressOrMac($regexvalue, "MAC", $output["entities_id"]);
                             break;
                         default:
                             $result = array();
                     }
                     if (!empty($result)) {
                         $output["itemtype"] = $result["itemtype"];
                         $output["items_id"] = $result["id"];
                     }
                     break;
             }
         }
     }
     return $output;
 }
開發者ID:ryukansent,項目名稱:Thesis-SideB,代碼行數:58,代碼來源:ruleticket.class.php


注:本文中的NetworkPort::getUniqueObjectIDByFQDN方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。