当前位置: 首页>>代码示例>>PHP>>正文


PHP Asset_host::get_related_hids_agents方法代码示例

本文整理汇总了PHP中Asset_host::get_related_hids_agents方法的典型用法代码示例。如果您正苦于以下问题:PHP Asset_host::get_related_hids_agents方法的具体用法?PHP Asset_host::get_related_hids_agents怎么用?PHP Asset_host::get_related_hids_agents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Asset_host的用法示例。


在下文中一共展示了Asset_host::get_related_hids_agents方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

            $res = Av_center::get_system_info_by_id($conn, $system_ids['non-canonical']);
            if ($res['status'] == 'success') {
                //We use this function to calculate sensor name because in HA environments there are two systems for one Sensor ID
                if (empty($res['data']['ha_ip'])) {
                    $sensor_name = $res['data']['name'];
                } else {
                    $sensor_name = Av_sensor::get_name_by_id($conn, $sensor_id);
                }
                $sensor_ip = $res['data']['current_ip'];
                if (Ossec_utilities::get_default_sensor_id() == $sensor_id && empty($res['data']['ha_ip'])) {
                    $sensor_ip = $res['data']['admin_ip'];
                }
                $sensor_ip_txt = $sensor_ip . ' [' . $sensor_name . ']';
            }
            //Getting Agent information
            $_aux_agent = Asset_host::get_related_hids_agents($conn, $asset_id, $sensor_id);
            $agent_key = md5(strtoupper($sensor_id) . '#' . $agent_id);
            $agent = $_aux_agent[$agent_key];
            if (empty($agent)) {
                $validation_errors['agent_id'] = _('Error! Agent information cannot be retrieved from system');
            } else {
                $agent_descr = $agent['name'] . ' (' . $agent['ip_cidr'] . ')';
            }
        }
    }
}
$db->close();
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:a_deployment_form.php

示例2: array

 //Getting assets with Windows OS
 $tables = ', host_properties hp, user_component_filter f';
 $filters = array('where' => 'hp.host_id=host.id AND hp.property_ref=3 AND (hp.value LIKE "windows%" OR hp.value LIKE "microsoft%")
                 AND f.asset_id = host.id AND f.asset_type="asset" AND f.session_id = "' . session_id() . '"');
 list($assets_w_os, $total_windows) = Asset_host::get_list($conn, $tables, $filters, FALSE);
 $total_deployed = 0;
 $deployment_stats = array();
 if ($total_windows > 0) {
     //HIDS sensors
     $s_data = Ossec_utilities::get_sensors($conn);
     $hids_sensors = $s_data['sensors'];
     foreach ($assets_w_os as $asset_id => $a_data) {
         $deployment_stats[$asset_id] = array('status' => 'success', 'data' => '');
         //Getting HIDS sensor and Windows IP
         $sensor_id = NULL;
         $hids_agents = Asset_host::get_related_hids_agents($conn, $asset_id);
         $aux_ip_address = explode(',', $a_data['ips']);
         $aux_ip_address = array_flip($aux_ip_address);
         $default_ip_address = array_pop(array_keys($aux_ip_address));
         if (is_array($hids_agents) && !empty($hids_agents)) {
             //Case 1: HIDS Agents was previously deployed
             $hids_agent = array_pop($hids_agents);
             $sensor_id = $hids_agent['sensor_id'];
             $agent_id = $hids_agent['agent_id'];
             if (Asset_host_ips::valid_ip($hids_agent['ip_cidr']) && array_key_exists($hids_agent['ip_cidr'], $aux_ip_address)) {
                 $ip_address = $hids_agent['ip_cidr'];
             } else {
                 $ip_address = $default_ip_address;
             }
         } else {
             //Case 2: Not HIDS Agent deployed
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:bk_deploy_hids.php


注:本文中的Asset_host::get_related_hids_agents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。