where('id', $device_group_id)->value('name'); ?>
Lists: '; $menu_options = ['basic' => 'Basic', 'detail' => 'Detail']; $sep = ''; foreach ($menu_options as $option => $text) { $listoptions .= $sep; if ($vars['format'] == 'list_' . $option) { $listoptions .= ''; } $listoptions .= '' . $text . ''; if ($vars['format'] == 'list_' . $option) { $listoptions .= ''; } $sep = ' | '; } $listoptions .= '   Graphs: '; $menu_options = ['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) { $listoptions .= $sep; if ($vars['format'] == 'graph_' . $option) { $listoptions .= ''; } $listoptions .= '' . $text . ''; if ($vars['format'] == 'graph_' . $option) { $listoptions .= ''; } $sep = ' | '; } $headeroptions = ''; if (isset($vars['searchbar']) && $vars['searchbar'] == 'hide') { $headeroptions .= 'Restore Search'; } else { $headeroptions .= 'Remove Search'; } $headeroptions .= ' | '; if (isset($vars['bare']) && $vars['bare'] == 'yes') { $headeroptions .= 'Restore Header'; } else { $headeroptions .= 'Remove Header'; } [$format, $subformat] = explode('_', $vars['format'], 2); $detailed = $subformat == 'detail'; $no_refresh = $format == 'list'; if ($format == 'graph') { if (empty($vars['from'])) { $graph_array['from'] = \LibreNMS\Config::get('time.day'); } else { $graph_array['from'] = $vars['from']; } if (empty($vars['to'])) { $graph_array['to'] = \LibreNMS\Config::get('time.now'); } else { $graph_array['to'] = $vars['to']; } echo '
'; echo '
'; echo '
'; echo '
' . $listoptions . '
'; echo '
' . $headeroptions . '
'; echo '
'; include_once 'includes/html/print-date-selector.inc.php'; echo '
'; echo '
'; echo '
'; echo '
'; $sql_param = []; if (isset($vars['state'])) { if ($vars['state'] == 'up') { $state = '1'; } elseif ($vars['state'] == 'down') { $state = '0'; } } if (! empty($vars['searchquery'])) { $where .= ' AND (sysName LIKE ? OR hostname LIKE ? OR display LIKE ? OR hardware LIKE ? OR os LIKE ? OR location LIKE ?)'; $sql_param += array_fill(0, 6, '%' . $vars['searchquery'] . '%'); } 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 `disable_notify`='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['disable_notify'])) { $where .= ' AND `disable_notify`= ?'; $sql_param[] = $vars['disable_notify']; } if (! empty($vars['location']) && $vars['location'] == 'Unset') { $location_filter = ''; } if (! empty($vars['location'])) { $location_filter = $vars['location']; } if (isset($vars['poller_group'])) { $where .= ' AND `poller_group`= ?'; $sql_param[] = $vars['poller_group']; } if (! empty($vars['group'])) { $where .= ' AND ( '; foreach (DB::table('device_group_device')->where('device_group_id', $vars['group'])->pluck('device_id') as $dev) { $where .= 'device_id = ? OR '; $sql_param[] = $dev; } $where = substr($where, 0, strlen($where) - 3); $where .= ' )'; } show_device_group($vars['group']); $query = 'SELECT * FROM `devices` LEFT JOIN `locations` ON `devices`.`location_id` = `locations`.`id` 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 = \LibreNMS\Config::get('list_colour.even'); } else { $row_colour = \LibreNMS\Config::get('list_colour.odd'); } 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 = []; $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'; $link_array = $graph_array; $link_array['page'] = 'graphs'; $link_array['type'] = $graph_type; $link_array['device'] = $device['device_id']; unset($link_array['height'], $link_array['width']); $overlib_link = \LibreNMS\Util\Url::generate($link_array); echo '
'; echo '
'; echo \LibreNMS\Util\Url::overlibLink($overlib_link, \LibreNMS\Util\Url::lazyGraphTag($graph_array_new), \LibreNMS\Util\Url::graphTag($graph_array_zoom)); echo "
\n\n"; } } } echo '
'; } else { $state = isset($vars['state']) ? $vars['state'] : ''; $state_selection = "'; $features_selected = isset($vars['features']) ? json_encode(['id' => $vars['features'], 'text' => $vars['features']]) : '""'; $hardware_selected = isset($vars['hardware']) ? json_encode(['id' => $vars['hardware'], 'text' => $vars['hardware']]) : '""'; $os_selected = isset($vars['os']) ? json_encode(['id' => $vars['os'], 'text' => $vars['hardware']]) : '""'; $type_selected = isset($vars['type']) ? json_encode(['id' => $vars['type'], 'text' => ucfirst($vars['type'])]) : '""'; $version_selected = isset($vars['version']) ? json_encode(['id' => $vars['version'], 'text' => $vars['version']]) : '""'; $os_selected = '""'; if (isset($vars['os'])) { $os_selected = json_encode(['id' => $vars['os'], 'text' => \LibreNMS\Config::getOsSetting($vars['os'], 'text', $vars['os'])]); } $location_selected = '""'; if (isset($vars['location'])) { $location_text = $vars['location']; if (is_numeric($vars['location'])) { $location_text = \App\Models\Location::where('id', $vars['location'])->value('location') ?: $vars['location']; } $location_selected = json_encode(['id' => $vars['location'], 'text' => $location_text]); } ?>
Id Vendor >Device Metrics Platform Operating System Up/Down Time Location Actions