Lists: '; $menu_options = array('basic' => 'Basic', 'detail' => 'Detail'); $sep = ""; foreach ($menu_options as $option => $text) { echo($sep); if ($vars['format'] == "list_" . $option) { echo ''; } echo '' . $text . ''; if ($vars['format'] == "list_" . $option) { echo ''; } $sep = " | "; } echo ' | Graphs: '; $menu_options = array('bits' => 'Bits', 'processor' => 'CPU', 'ucd_load' => 'Load', 'mempool' => 'Memory', 'uptime' => 'Uptime', 'storage' => 'Storage', 'diskio' => 'Disk I/O', 'poller_perf' => 'Poller', 'ping_perf' => 'Ping', 'temperature' => 'Temperature' ); $sep = ""; foreach ($menu_options as $option => $text) { echo $sep; if ($vars['format'] == 'graph_' . $option) { echo ''; } echo '' . $text . ''; if ($vars['format'] == 'graph_' . $option) { echo ''; } $sep = " | "; } echo '
'; $graphs_types = ''; echo $graphs_types; if (isset($vars['searchbar']) && $vars['searchbar'] == "hide") { echo('Restore Search'); } else { echo('Remove Search'); } echo(" | "); if (isset($vars['bare']) && $vars['bare'] == "yes") { echo('Restore Header'); } else { echo('Remove Header'); } print_optionbar_end(); echo '
'; list($format, $subformat) = explode("_", $vars['format'], 2); if ($format == "graph") { if (empty($vars['from'])) { $graph_array['from'] = $config['time']['day']; } else { $graph_array['from'] = $vars['from']; } if (empty($vars['to'])) { $graph_array['to'] = $config['time']['now']; } else { $graph_array['to'] = $vars['to']; } echo "
"; include_once 'includes/print-date-selector.inc.php'; echo '
'; $sql_param = array(); if (isset($vars['state'])) { if ($vars['state'] == 'up') { $state = '1'; } elseif ($vars['state'] == 'down') { $state = '0'; } } if (!empty($vars['hostname'])) { $where .= " AND hostname LIKE ?"; $sql_param[] = "%" . $vars['hostname'] . "%"; } if (!empty($vars['os'])) { $where .= " AND os = ?"; $sql_param[] = $vars['os']; } if (!empty($vars['version'])) { $where .= " AND version = ?"; $sql_param[] = $vars['version']; } if (!empty($vars['hardware'])) { $where .= " AND hardware = ?"; $sql_param[] = $vars['hardware']; } if (!empty($vars['features'])) { $where .= " AND features = ?"; $sql_param[] = $vars['features']; } if (!empty($vars['type'])) { if ($vars['type'] == 'generic') { $where .= " AND ( type = ? OR type = '')"; $sql_param[] = $vars['type']; } else { $where .= " AND type = ?"; $sql_param[] = $vars['type']; } } if (!empty($vars['state'])) { $where .= " AND status= ?"; $sql_param[] = $state; $where .= " AND disabled='0' AND `ignore`='0'"; $sql_param[] = ''; } if (!empty($vars['disabled'])) { $where .= " AND disabled= ?"; $sql_param[] = $vars['disabled']; } if (!empty($vars['ignore'])) { $where .= " AND `ignore`= ?"; $sql_param[] = $vars['ignore']; } if (!empty($vars['location']) && $vars['location'] == "Unset") { $location_filter = ''; } if (!empty($vars['location'])) { $location_filter = $vars['location']; } if (!empty($vars['group'])) { require_once('../includes/device-groups.inc.php'); $where .= " AND ( "; foreach (GetDevicesFromGroup($vars['group']) as $dev) { $where .= "device_id = ? OR "; $sql_param[] = $dev; } $where = substr($where, 0, strlen($where) - 3); $where .= " )"; } $query = "SELECT * FROM `devices` WHERE 1 "; if (isset($where)) { $query .= $where; } $query .= " ORDER BY hostname"; $row = 1; foreach (dbFetchRows($query, $sql_param) as $device) { if (is_integer($row / 2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } if (device_permitted($device['device_id'])) { if (!$location_filter || $device['location'] == $location_filter) { $graph_type = "device_" . $subformat; if ($_SESSION['widescreen']) { $width = 270; } else { $width = 315; } $graph_array_new = array(); $graph_array_new['type'] = $graph_type; $graph_array_new['device'] = $device['device_id']; $graph_array_new['height'] = '110'; $graph_array_new['width'] = $width; $graph_array_new['legend'] = 'no'; $graph_array_new['title'] = 'yes'; $graph_array_new['from'] = $graph_array['from']; $graph_array_new['to'] = $graph_array['to']; $graph_array_zoom = $graph_array_new; $graph_array_zoom['height'] = '150'; $graph_array_zoom['width'] = '400'; $graph_array_zoom['legend'] = 'yes'; $overlib_link = "device/device=" . $device['device_id'] . "/"; echo '
'; echo '
'; echo overlib_link($overlib_link, generate_lazy_graph_tag($graph_array_new), generate_graph_tag($graph_array_zoom), null); echo "
\n\n"; } } } } else { if (is_admin() === true || is_read() === true) { $os = "SELECT `os` FROM `devices` AS D WHERE 1 GROUP BY `os` ORDER BY `os`"; $ver = "SELECT `version` FROM `devices` AS D WHERE 1 GROUP BY `version` ORDER BY `version`"; $platform = "SELECT `hardware` FROM `devices` AS D WHERE 1 GROUP BY `hardware` ORDER BY `hardware`"; $features = "SELECT `features` FROM `devices` AS D WHERE 1 GROUP BY `features` ORDER BY `features`"; $types = "SELECT `type` FROM `devices` AS D WHERE 1 GROUP BY `type` ORDER BY `type`"; } else { $os = "SELECT `os` FROM `devices` AS `D`, `devices_perms` AS `P` WHERE `P`.`user_id` = ? AND `P`.`device_id` = `D`.`device_id` GROUP BY `os` ORDER BY `os`"; $ver = "SELECT `version` FROM `devices` AS `D`, `devices_perms` AS `P` WHERE `P`.`user_id` = ? AND `P`.`device_id` = `D`.`device_id` GROUP BY `version` ORDER BY `version`"; $platform = "SELECT `hardware` FROM `devices` AS `D`, `devices_perms` AS `P` WHERE `P`.`user_id` = ? AND `P`.`device_id` = `D`.`device_id` GROUP BY `hardware` ORDER BY `hardware`"; $features = "SELECT `features` FROM `devices` AS `D`, `devices_perms` AS `P` WHERE `P`.`user_id` = ? AND `P`.`device_id` = `D`.`device_id` GROUP BY `features` ORDER BY `features`"; $types = "SELECT `type` FROM `devices` AS `D`, `devices_perms` AS `P` WHERE `P`.`user_id` = ? AND `P`.`device_id` = `D`.`device_id` GROUP BY `type` ORDER BY `type`"; $param[] = $_SESSION['user_id']; } $os_options = ''; $ver_options = ''; $platform_options = ''; $features_options = ''; $locations_options = ''; $types_options = ''; if (isset($vars['searchbar']) && $vars['searchbar'] == "hide") { $searchbar = ''; } else { $searchbar = '
' . $os_options . '
' . $ver_options . '
' . $platform_options . '
' . $features_options . '
' . $locations_options . '
' . $types_options . '
Update URL Reset
'; } echo $searchbar; echo '
'; if ($subformat == "detail") { echo ''; } echo ''; if ($subformat == "detail") { echo ''; } echo ' '; if ($subformat == "detail") { echo ''; } echo '
StatusVendorDeviceMetricsPlatform Operating System UptimeLocationActions
'; ?>