本文整理汇总了PHP中Asset_host::get_os方法的典型用法代码示例。如果您正苦于以下问题:PHP Asset_host::get_os方法的具体用法?PHP Asset_host::get_os怎么用?PHP Asset_host::get_os使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Asset_host
的用法示例。
在下文中一共展示了Asset_host::get_os方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: empty
echo '<pre>';
print_r($asset);
echo '</pre>';
*/
//Getting asset data
$id = $asset->get_id();
$name = $asset->get_name();
$_ips = $asset->get_ips();
$ips = $_ips->get_ips();
$ips = array_keys($ips);
$descr = html_entity_decode($asset->get_descr(), ENT_QUOTES, 'UTF-8');
$fqdns = $asset->get_fqdns();
$external = $asset->get_external();
$location = $asset->get_location();
$asset_value = $asset->get_asset_value();
$os_data = $asset->get_os();
$os = $os_data['value'];
$model = $asset->get_model();
//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();
示例2: sprintf
//Server related to CTX
$server_obj = Server::get_server_by_ctx($conn, $ctx);
if ($server_obj) {
$s_name = $server_obj->get_name();
$s_ip = $server_obj->get_ip();
$server = $s_name . ' (' . $s_ip . ')';
$e_msg = sprintf(_("Unable to deploy agent to assets on a child server. Please login to %s to deploy the HIDS agents"), $server);
}
echo ossim_error($e_msg, AV_WARNING);
exit;
}
//Getting asset information
$_ips = $asset->get_ips();
$ips = $_ips->get_ips();
//Getting Operating System
$os = $asset->get_os();
$os = $os['value'];
//Checking sensors
$asset_sensors = $asset->get_sensors();
$sensors = $asset_sensors->get_sensors();
//HIDS sensors
$s_data = Ossec_utilities::get_sensors($conn, $sensor_id);
$hids_sensors = $s_data['sensors'];
$asset_hids_sensors = array();
if (is_array($sensors) && !empty($sensors)) {
foreach ($sensors as $s_id => $s_data) {
$asset_hids_sensors[$s_id] = $hids_sensors[$s_id];
}
}
if (empty($asset_hids_sensors)) {
echo ossim_error(_('Unable to deploy HIDS agent. The asset does not have a valid sensor. Please update the sensor in asset details and try again'));