本文整理汇总了PHP中Asset_host::get_sensors方法的典型用法代码示例。如果您正苦于以下问题:PHP Asset_host::get_sensors方法的具体用法?PHP Asset_host::get_sensors怎么用?PHP Asset_host::get_sensors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Asset_host
的用法示例。
在下文中一共展示了Asset_host::get_sensors方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: empty
//CTX name
$ctx_name = empty($ctx) ? _('None') : Session::get_entity_name($conn, $ctx);
$ctx_name = Util::utf8_encode2($ctx_name);
//Icon
$icon = $asset->get_icon();
$icon = !empty($icon) ? 'data:image/png;base64,' . base64_encode($icon) : '';
//Server related to CTX
$server_obj = Server::get_server_by_ctx($conn, $ctx);
$s_name = '';
$s_ip = '';
if ($server_obj) {
$s_name = $server_obj->get_name();
$s_ip = $server_obj->get_ip();
}
//Asset Sensors
$asset_sensors = $asset->get_sensors();
$sensors = $asset_sensors->get_sensors();
//Asset Devices
$asset_devices = $asset->get_devices();
$_devices = $asset_devices->get_devices();
$devices = array();
foreach ($_devices as $dt_id => $dt_data) {
foreach ($dt_data as $dst_id => $d_name) {
$device_id = $dt_id;
$device_id .= $dst_id > 0 ? ':' . $dst_id : '';
$devices[$device_id] = $d_name;
}
}
$data['status'] = 'OK';
$data['data'] = array('is_in_db' => $is_in_db, 'is_editable' => $is_editable, 'id' => $id, 'ctx' => array('id' => $ctx, 'name' => $ctx_name, 'related_server' => array('ip' => $s_ip, 'name' => $s_name)), 'name' => $name, 'ip' => implode(',', $ips), 'descr' => $descr, 'external' => $external, 'fqdns' => $fqdns, 'asset_value' => $asset_value, 'location' => $location, 'icon' => $icon, 'os' => $os, 'model' => $model, 'sensors' => $sensors, 'devices' => $devices);
$db->close();
示例2: _
$descr = $host->get_descr();
$icon = $host->get_html_icon();
$fqdns = $host->get_fqdns();
$external = $host->get_external();
$location = $host->get_location();
$latitude = $location['lat'];
$longitude = $location['lon'];
$zoom = $location['zoom'];
$asset_value = $host->get_asset_value();
$threshold_a = $host->get_threshold_a();
$threshold_c = $host->get_threshold_c();
//Host Ips
$host_ips = $host->get_ips();
$ips = $host_ips->get_ips('string');
//Host Sensors
$host_sensors = $host->get_sensors();
$sensors = $host_sensors->get_sensors();
//Host Devices
$host_devices = $host->get_devices();
$devices = $host_devices->get_devices();
//Host Scan
$is_nagios_enabled = Asset_host_scan::is_plugin_in_host($conn, $id, 2007);
//Closing database connection
$db->close();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title><?php
echo _("OSSIM Framework");
?>