Ejemplo n.º 1
0
$db = new ossim_db();
$conn = $db->connect();
$ip = GET('ip');
$tree = GET('tree');
ossim_valid($ip, OSS_IP_ADDR, 'illegal:' . _("Ip Address"));
$length_name = !empty($_GET['length_name']) ? GET('length_name') : 40;
if (ossim_error()) {
    $ossim_error = true;
}
$image_url = "../../pixmaps/theme/";
$icon1 = $image_url . 'any.png';
$icon2 = $image_url . 'ltError.gif';
$empty_tree = "[{title: '<span class=\\'size12n\\'>" . _("Properties") . "</span>', key:'0', isFolder:true, icon:'{$icon1}', hideCheckbox: true, \n\t\tchildren:[{title: '<span>" . _("No data found") . "</span>', addClass:'bold_red', key:'load_error', isFolder:false, hideCheckbox: true, icon:'{$icon2}'}]}]";
switch ($tree) {
    case "tree_container_1":
        $properties_types = Host::get_properties_types($conn);
        $properties = Host::get_host_properties($conn, $ip, '', 'ord, date DESC');
        $grouped_properties = array();
        $services_list = Host_services::get_ip_data($conn, $ip, '1');
        if (count($properties_types) == 0 || $ossim_error) {
            echo $empty_tree;
            exit;
        }
        foreach ($properties_types as $k => $v) {
            if ($v['name'] != 'Service') {
                $grouped_properties[$v['name'] . "###" . $v['id'] . "###" . $v['description']] = array();
            }
        }
        if (count($properties) > 0) {
            foreach ($properties as $k => $v) {
                $grouped_properties[ucwords($v['property']) . "###" . $v['property_ref'] . "###" . $v['description']][] = array("id" => $v['id'], "sensor" => $v['sensor'], "date" => $v['date'], "property_id" => $v['property_ref'], "property" => $v['property'], "source_ref" => $v['source_id'], "source" => $v['source'], "value" => $v['value'], "extra" => $v['extra'], "anom" => $v['anom']);
Ejemplo n.º 2
0
            ?>
										<td class="tableServices_t1" bgcolor="<?php 
            echo $bgcolor;
            ?>
">
											<?php 
            if ($services['anom'] == 1) {
                ?>
<img src="../pixmaps/warning.png" title="<?php 
                echo _('Anomaly detection');
                ?>
" /><?php 
            }
            ?>
											<?php 
            $propertyName = Host::get_properties_types($conn, $services['property_ref']);
            echo $propertyName[0]['description'];
            ?>
										</td>
										
										<td class="tableServices_t2" bgcolor="<?php 
            echo $bgcolor;
            ?>
">
											<?php 
            if (!empty($services['sensor'])) {
                echo _('Sensor') . ': ' . $services['sensor'];
                ?>
<br /><?php 
            }
            ?>