function getPropertyImage($property) { $icons = array("software" => "software", "operating-system" => "host_os", "cpu" => "cpu", "services" => "ports", "memory" => "ram", "department" => "host_group", "macaddress" => "mac", "workgroup" => "net_group", "role" => "server_role", "property" => "notebook", "nagios_ok" => "tick", "nagios_ko" => "cross", "acl" => "acl", "storage" => "storage", "route" => "route"); $property = strtolower($property); $icon = empty($icons[$property]) ? "folder" : $icons[$property]; $icon .= ".png"; if (preg_match("/^OS\\=/i", $property)) { $os_icon = Host_os::get_os_pixmap_nodb($property, "..", true); if ($os_icon != "") { $icon = $os_icon; } } return $icon; }
$scantype = gettext("None"); if ($scan_list = Host_scan::get_list($conn, "WHERE host_ip = inet_aton('{$ip}')")) { $scantype = ""; foreach ($scan_list as $scan) { $id = $scan->get_plugin_id(); $plugin_name = ""; if ($plugin_list = Plugin::get_list($conn, "WHERE id = {$id}")) { $plugin_name .= $plugin_list[0]->get_name(); $scantype .= ucfirst($plugin_name) . "<br>"; } else { $scantype .= "{$id}<BR>"; } } } $xml .= "<cell><![CDATA[" . $scantype . "]]></cell>"; if ($os_data = Host_os::get_ip_data($conn, $host->get_ip())) { $os = $os_data["os"]; $host_os = $os . " " . Host_os::get_os_pixmap_nodb($os); } else { $host_os = ""; } $xml .= "<cell><![CDATA[" . $host_os . "]]></cell>"; $xml .= "</row>\n"; } $xml .= "</rows>\n"; echo $xml; $db->close($conn); ?>
$all_hosts[$cclas][] = $hip; $total_hosts++; } } } uasort($all_hosts, 'cmpf'); if ($key == "os") { if ($hg_list = Host_os::get_os_list($conn, $ossim_hosts, $filter)) { $j = 0; $length_os = 25; uasort($hg_list, 'cmpf'); $buffer .= "["; foreach ($hg_list as $os => $hg) { if ($j >= $from && $j < $to) { $html = ""; $pix = Host_os::get_os_pixmap_nodb($os, '../../pixmaps/', true); $pix = $pix == "" ? "../../pixmaps/theme/host_group.png" : $pix; $title = strlen($os) > $length_os ? substr($os, 0, $length_os) . "..." : $os; $title = Util::htmlentities($title) . " <font style=\"font-weight:normal;font-size:80%\">(" . count($hg) . " " . _("hosts") . ")</font>"; $tooltip = $os; $li = "key:'os_{$os}', url:'OS:{$os}', icon:'{$pix}', isLazy:true, title:'{$title}', tooltip:'{$tooltip}'"; $buffer .= ($j > $from ? "," : "") . "{ {$li} }\n"; } $j++; } if ($j > $to) { $li = "key:'os', page:'{$nextpage}', isFolder:true, isLazy:true, icon:'../../pixmaps/theme/host_os.png', title:'" . _("next") . " {$maxresults} " . _("OS") . "'"; $buffer .= ",{ {$li} }\n"; } $buffer .= "]"; }