<?php /** * Observium Network Management and Monitoring System * Copyright (C) 2006-2015, Adam Armstrong - http://www.observium.org * * @package observium * @subpackage webui * @author Adam Armstrong <*****@*****.**> * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ register_html_title("Printing"); $navbar = array(); $navbar['brand'] = "Printer supplies"; $navbar['class'] = "navbar-narrow"; foreach ($printing_tabs as $type) { if (!$vars['supply']) { $vars['supply'] = $type; } $navbar['options'][$type]['url'] = generate_url(array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'printing', 'supply' => $type)); $navbar['options'][$type]['text'] = nicecase($type); if ($vars['supply'] == $type) { $navbar['options'][$type]['class'] = "active"; } } if (dbFetchCell('SELECT COUNT(*) FROM `sensors` WHERE device_id = ? AND `measured_class` = ?', array($device['device_id'], 'printersupply')) > 0) { $navbar['options']['pagecount']['url'] = generate_url(array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'printing', 'supply' => 'pagecount')); $navbar['options']['pagecount']['text'] = 'Printed counters'; if ($vars['supply'] == 'pagecount') { $navbar['options']['pagecount']['class'] = "active";
<?php /** * Observium Network Management and Monitoring System * Copyright (C) 2006-2015, Adam Armstrong - http://www.observium.org * * @package observium * @subpackage webui * @author Adam Armstrong <*****@*****.**> * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ print_inventory($vars); register_html_title("Inventory"); // EOF
<?php /** * Observium Network Management and Monitoring System * Copyright (C) 2006-2015, Adam Armstrong - http://www.observium.org * * @package observium * @subpackage webui * @author Adam Armstrong <*****@*****.**> * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ print_vm_table($vars); register_html_title("Virtual Machines"); // EOF
<?php /** * Observium Network Management and Monitoring System * Copyright (C) 2006-2015, Adam Armstrong - http://www.observium.org * * @package observium * @subpackage webui * @author Adam Armstrong <*****@*****.**> * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ register_html_title("Search"); $sections = array('ipv4' => 'IPv4 Address', 'ipv6' => 'IPv6 Address', 'mac' => 'MAC Address', 'arp' => 'ARP/NDP Tables', 'fdb' => 'FDB Tables'); if (dbFetchCell("SELECT COUNT(wifi_session_id) FROM wifi_sessions") > '0') { $sections['dot1x'] = '.1x Sessions'; // Can be extended to include all dot1x sessions } $navbar['brand'] = "Search"; $navbar['class'] = "navbar-narrow"; foreach ($sections as $section => $text) { $type = strtolower($section); if (!isset($vars['search'])) { $vars['search'] = $section; } if ($vars['search'] == $section) { $navbar['options'][$section]['class'] = "active"; } $navbar['options'][$section]['url'] = generate_url(array('page' => 'search', 'search' => $section)); $navbar['options'][$section]['text'] = $text; }
$form_items[$entry][$item] = $name; } } $form = array('type' => 'rows', 'space' => '5px', 'submit_by_key' => TRUE, 'url' => generate_url($vars)); //Device field $form_items['devices'] = generate_form_values('device', $form_devices); $form['row'][0]['device_id'] = array('type' => 'multiselect', 'name' => 'Device', 'width' => '100%', 'value' => $vars['device_id'], 'groups' => array('', 'UP', 'DOWN', 'DISABLED'), 'values' => $form_items['devices']); // Device OS field $form['row'][0]['os'] = array('type' => 'multiselect', 'name' => 'Select OS', 'width' => '100%', 'value' => $vars['os'], 'values' => $form_items['os']); // Parts field ksort($form_items['parts']); $form['row'][0]['parts'] = array('type' => 'multiselect', 'name' => 'Part Numbers', 'width' => '100%', 'value' => $vars['parts'], 'values' => $form_items['parts']); //Serial field $form['row'][0]['serial'] = array('type' => 'text', 'name' => 'Serial', 'width' => '100%', 'placeholder' => TRUE, 'submit_by_key' => TRUE, 'value' => escape_html($vars['serial'])); //Description field $form['row'][0]['description'] = array('type' => 'text', 'name' => 'Description', 'grid' => 3, 'width' => '100%', 'placeholder' => TRUE, 'submit_by_key' => TRUE, 'value' => escape_html($vars['description'])); // search button $form['row'][0]['search'] = array('type' => 'submit', 'grid' => 1, 'right' => TRUE); print_form($form); unset($form, $form_items, $form_devices); // Pagination $vars['pagination'] = TRUE; print_inventory($vars); register_html_title('Inventory'); ?> </div> <!-- col-md-12 --> </div> <!-- row --> <?php // EOF
$form = array('type' => 'rows', 'submit_by_key' => TRUE, 'url' => 'search/search=dot1x/'); //Device field $form['row'][0]['device_id'] = array('type' => 'multiselect', 'name' => 'Device', 'width' => '100%', 'grid' => 3, 'value' => $vars['device_id'], 'groups' => array('', 'UP', 'DOWN', 'DISABLED'), 'values' => $form_items['devices']); //Search by field $form['row'][0]['searchby'] = array('type' => 'select', 'name' => 'Search By', 'width' => '100%', 'grid' => 2, 'onchange' => "\$('#address').prop('placeholder', \$('#searchby option:selected').text())", 'value' => $vars['searchby'], 'values' => array('mac' => 'MAC Address', 'ip' => 'IP Address', 'username' => 'Username')); if ($vars['searchby'] == 'mac') { $name = 'MAC Address'; } else { if ($vars['searchby'] == 'ip') { $name = 'IP Address'; } else { $name = 'Username'; } } //Address field $form['row'][0]['address'] = array('type' => 'text', 'name' => $name, 'width' => '100%', 'grid' => 4, 'placeholder' => TRUE, 'submit_by_key' => TRUE, 'value' => escape_html($vars['address'])); // search button $form['row'][0]['search'] = array('type' => 'submit', 'grid' => 3, 'value' => 'dot1x', 'right' => TRUE); print_form($form); unset($form, $form_items, $form_devices); // Pagination $vars['pagination'] = TRUE; print_dot1xtable($vars); register_html_title('.1x Session Search'); ?> </div> <!-- col-md-12 --> </div> <!-- row --> <?php // EOF
<?php /** * Observium Network Management and Monitoring System * Copyright (C) 2006-2015, Adam Armstrong - http://www.observium.org * * @package observium * @subpackage webui * @author Adam Armstrong <*****@*****.**> * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ register_html_title("Poller/Discovery Timing"); $rrd_file = $config['rrd_dir'] . '/poller-wrapper.rrd'; if (is_file($rrd_file) && $_SESSION['userlevel'] >= 7) { echo generate_box_open(array('header-border' => TRUE, 'title' => 'Poller Wrapper History')); $graph_array = array('type' => 'poller_wrapper_threads', 'width' => 1158, 'height' => 100, 'from' => $config['time']['week'], 'to' => $config['time']['now']); echo generate_graph_tag($graph_array); //echo "<h3>Poller wrapper Total time</h3>"; $graph_array = array('type' => 'poller_wrapper_times', 'width' => 1158, 'height' => 100, 'from' => $config['time']['week'], 'to' => $config['time']['now']); echo generate_graph_tag($graph_array); echo generate_box_close(array('footer_content' => '<b>Please note:</b> The total time for the poller wrapper is not the same as the timings below. Total poller wrapper time is real polling time for all devices and all threads.')); } echo generate_box_open(array('header-border' => TRUE, 'title' => 'Poller/Discovery Timing')); echo '<table class="' . OBS_CLASS_TABLE_STRIPED_MORE . '">' . PHP_EOL; ?> <thead> <tr> <th class="state-marker"></th> <th>Device</th>
/** * Observium Network Management and Monitoring System * Copyright (C) 2006-2015, Adam Armstrong - http://www.observium.org * * @package observium * @subpackage webui * @author Adam Armstrong <*****@*****.**> * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ // Global write permissions required. if ($_SESSION['userlevel'] < 10) { print_error_permission(); return; } register_html_title("Delete devices"); if (is_numeric($vars['id'])) { $device = device_by_id_cache($vars['id']); $confirm = array('confirm', 'yes', 'on', '1'); if ($device && in_array($vars['confirm'], $confirm)) { $delete_rrd = in_array($vars['deleterrd'], $confirm); print_message(delete_device($vars['id'], $delete_rrd), 'console'); //echo('<div class="btn-group "> // <button type="button" class="btn btn-default"><a href="/"><i class="oicon-globe-model"></i> Overview</a></button> // <button type="button" class="btn btn-default"><a href="/devices/"><i class="oicon-servers"></i> Devices List</a></button> // </div>'); } else { print_warning("Are you sure you want to delete device <strong>" . $device['hostname'] . "</strong>?"); $form = array('type' => 'horizontal', 'id' => 'delete_host', 'title' => 'Delete device <strong>' . $device['hostname'] . '</strong>', 'icon' => 'oicon-server--minus', 'url' => 'delhost/'); $form['row'][0]['id'] = array('type' => 'hidden', 'value' => $vars['id']); $form['row'][4]['deleterrd'] = array('type' => 'checkbox', 'name' => 'Delete RRDs', 'value' => (bool) $vars['deleterrd']);
<?php /** * Observium Network Management and Monitoring System * Copyright (C) 2006-2015, Adam Armstrong - http://www.observium.org * * @package observium * @subpackage webui * @author Adam Armstrong <*****@*****.**> * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ // FIXME, obsolete if ($_SESSION['userlevel'] <= 7) { print_error_permission(); return; } // User level 8-9 only can see config $readonly = $_SESSION['userlevel'] < 10; register_html_title("Delete service"); if ($vars['delsrv'] && !$readonly) { include $config['html_dir'] . "/includes/service-delete.inc.php"; if ($updated) { print_success("Service Deleted!"); } } foreach (dbFetchRows("SELECT * FROM `services` AS S, `devices` AS D WHERE S.device_id = D.device_id ORDER BY hostname") as $device) { $servicesform .= "<option value='" . $device['service_id'] . "'>" . $device['service_id'] . "." . $device['hostname'] . " - " . $device['service_type'] . "</option>"; } echo "\n<h4>Delete Service</h4>\n<form id='addsrv' name='addsrv' method='post' action=''>\n <input type=hidden name='delsrv' value='yes'>\n <table width='300' border='0'>\n <tr>\n <td>\n Device\n </td>\n <td>\n <select name='service'>\n {$servicesform}\n </select>\n </td>\n </tr>\n </table>\n<input type='submit' name='Submit' value='Delete' />\n</form>"; // EOF
* Observium Network Management and Monitoring System * Copyright (C) 2006-2015, Adam Armstrong - http://www.observium.org * * @package observium * @subpackage webui * @author Adam Armstrong <*****@*****.**> * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ // Global write permissions required. if ($_SESSION['userlevel'] < 10) { print_error_permission(); return; } include $config['html_dir'] . "/pages/usermenu.inc.php"; register_html_title("Add User"); if (auth_usermanagement()) { if ($vars['submit'] == 'add_user') { if ($vars['new_username']) { $vars['new_username'] = strip_tags($vars['new_username']); if (!auth_user_exists($vars['new_username'])) { if (isset($vars['can_modify_passwd'])) { $vars['can_modify_passwd'] = 1; } else { $vars['can_modify_passwd'] = 0; } if (!$vars['new_password']) { print_warning("Please enter a password!"); } else { if (adduser($vars['new_username'], $vars['new_password'], $vars['new_level'], $vars['new_email'], $vars['new_realname'], $vars['can_modify_passwd'], $vars['new_description'])) { print_success('User ' . escape_html($vars['new_username']) . ' added!');
} //$where = ' IN ('.implode(',', array_keys($port_cache)).')'; $where = generate_query_values(array_keys($port_cache), 'port_id'); foreach ($ext_tables as $table) { // Here stored port_id! $cache['ports_option'][$table] = dbFetchColumn("SELECT DISTINCT `port_id` FROM `{$table}` WHERE 1 " . $where); } $cache['ports_vlan'] = array(); // Cache port vlans foreach (dbFetchRows('SELECT * FROM `ports_vlans` AS PV LEFT JOIN vlans AS V ON PV.`vlan` = V.`vlan_vlan` AND PV.`device_id` = V.`device_id` WHERE PV.`device_id` = ? ORDER BY PV.`vlan`', array($device['device_id'])) as $entry) { $cache['ports_vlan'][$entry['port_id']][$entry['vlan']] = $entry; } echo generate_box_open(); echo '<table class="' . $table_class . ' table-hover">' . PHP_EOL; $cols = array(array(NULL, 'class="state-marker"'), array(NULL), 'port' => array('Port'), array(NULL), 'traffic' => array('Traffic'), 'speed' => array('Speed'), 'mac' => array('MAC Address'), array(NULL)); echo get_table_header($cols, $vars); echo '<tbody>' . PHP_EOL; foreach ($ports as $port) { if (is_filtered()) { continue; } print_port_row($port, $vars); } echo '</tbody></table>'; echo generate_box_close(); } } register_html_title("Ports"); unset($where, $ext_tables, $cache['ports_option'], $cache['ports_vlan']); // EOF
<?php /** * Observium Network Management and Monitoring System * Copyright (C) 2006-2015, Adam Armstrong - http://www.observium.org * * @package observium * @subpackage webui * @author Adam Armstrong <*****@*****.**> * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ // Possibly add navbar to filter on type? (Proxmox, VMWare, ...) register_html_title('Virtual Machines'); print_vm_table($vars); // EOF
list($icon) = explode('-', str_replace('_', '-', $app['app_type'])); $image = $config['html_dir'] . '/images/apps/' . $icon . '.png'; if ($icon != $app['app_type'] && is_file($image)) { // 'postfix_qshape' -> 'postfix' // 'exim-mailqueue' -> 'exim' } else { $icon = 'apps'; // Generic } } $navbar['options'][$app['app_type']]['image'] = 'images/apps/' . $icon . '.png'; if (is_file($config['html_dir'] . '/images/apps/' . $icon . '_2x.png')) { // HiDPI icon $navbar['options'][$app['app_type']]['image_2x'] = 'images/apps/' . $icon . '_2x.png'; } $app_types[$app['app_type']] = array(); } print_navbar($navbar); unset($navbar); if ($vars['app']) { $include = $config['html_dir'] . '/pages/apps/' . $vars['app'] . '.inc.php'; if (is_file($include)) { include $include; } else { include $config['html_dir'] . '/pages/apps/default.inc.php'; } } else { include $config['html_dir'] . '/pages/apps/overview.inc.php'; } register_html_title('Applications'); // EOF
if ($vars['group'] == $type) { $navbar['options'][$type]['class'] = "active"; } $navbar['options'][$type]['url'] = generate_url(array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'munin', 'group' => $type)); $navbar['options'][$type]['text'] = escape_html(ucwords($section)); } } print_navbar($navbar); $graph_enable = $graph_enable[$vars['group']]; echo generate_box_open(); echo '<table class="table table-condensed table-striped table-hover">'; #foreach ($config['graph_types']['device'] as $graph => $entry) foreach ($graph_enable as $graph => $entry) { $graph_array = array(); if ($graph_enable[$graph]) { if (!empty($entry['plugin'])) { $graph_title = $entry['title']; $graph_array['type'] = "munin_graph"; $graph_array['device'] = $device['device_id']; $graph_array['plugin'] = $entry['plugin']; } else { $graph_title = $config['graph_types']['device'][$graph]['descr']; $graph_array['type'] = "device_" . $graph; } include "includes/print-device-graph.php"; } } echo '</table>'; echo generate_box_close(); register_html_title("Graphs"); // EOF
<?php /** * Observium Network Management and Monitoring System * Copyright (C) 2006-2015, Adam Armstrong - http://www.observium.org * * @package observium * @subpackage webui * @author Adam Armstrong <*****@*****.**> * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ register_html_title('Ports'); // Set Defaults here if (!isset($vars['format']) || !is_file($config['html_dir'] . '/pages/ports/' . $vars['format'] . '.inc.php')) { $vars['format'] = 'list'; } if (OBS_DEBUG) { print_vars($vars); } $param = array(); if (!isset($vars['sort'])) { $vars['sort'] = 'device'; } //if (!isset($vars['ignore'])) { $vars['ignore'] = "0"; } if (!isset($vars['disabled'])) { $vars['disabled'] = "0"; } if (!isset($vars['deleted'])) { $vars['deleted'] = "0"; }
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ ?> <div class="row"> <div class="col-md-12"> <?php // Select the devices only with ARP/NDP tables $form_devices = dbFetchColumn('SELECT DISTINCT `device_id` FROM `ip_mac` LEFT JOIN `ports` USING(`port_id`)'); $form_items['devices'] = generate_form_values('device', $form_devices); $form = array('type' => 'rows', 'space' => '5px', 'submit_by_key' => TRUE, 'url' => 'search/search=arp/'); $form['row'][0]['device_id'] = array('type' => 'multiselect', 'name' => 'Device', 'width' => '100%', 'value' => $vars['device_id'], 'groups' => array('', 'UP', 'DOWN', 'DISABLED'), 'values' => $form_items['devices']); $form['row'][0]['ip_version'] = array('type' => 'select', 'name' => 'IP', 'width' => '100%', 'value' => $vars['ip_version'], 'values' => array('' => 'IPv4 & IPv6', '4' => 'IPv4 only', '6' => 'IPv6 only')); $form['row'][0]['searchby'] = array('type' => 'select', 'name' => 'Search By', 'width' => '100%', 'onchange' => "\$('#address').prop('placeholder', \$('#searchby option:selected').text())", 'value' => $vars['searchby'], 'values' => array('mac' => 'MAC Address', 'ip' => 'IP Address')); $form['row'][0]['address'] = array('type' => 'text', 'name' => $vars['searchby'] == 'ip' ? 'IP Address' : 'MAC Address', 'width' => '100%', 'grid' => 3, 'placeholder' => TRUE, 'submit_by_key' => TRUE, 'value' => escape_html($vars['address'])); // search button $form['row'][0]['search'] = array('type' => 'submit', 'grid' => 3, 'value' => 'arp', 'right' => TRUE); print_form($form); unset($form, $form_items, $form_devices); // Pagination $vars['pagination'] = TRUE; print_arptable($vars); register_html_title('ARP/NDP Search'); ?> </div> <!-- col-md-12 --> </div> <!-- row --> <?php // EOF
$form = array('type' => 'rows', 'space' => '5px', 'submit_by_key' => TRUE, 'url' => generate_url($vars)); $where = ' WHERE 1 ' . generate_query_values($device['device_id'], 'device_id'); // Checkers Field $form_filter = dbFetchColumn('SELECT DISTINCT `alert_test_id` FROM `alert_log`' . $where); $form_items['checkers'] = generate_form_values('alert_log', $form_filter, 'alert_test_id'); $form['row'][0]['alert_test_id'] = array('type' => 'multiselect', 'name' => 'Checkers', 'width' => '100%', 'div_class' => 'col-lg-2 col-md-2 col-sm-4', 'subtext' => TRUE, 'value' => $vars['alert_test_id'], 'values' => $form_items['checkers']); // Status Type Field $form_filter = dbFetchColumn('SELECT DISTINCT `log_type` FROM `alert_log`' . $where); $form_items['statuses'] = generate_form_values('alert_log', $form_filter, 'log_type'); $form['row'][0]['log_type'] = array('type' => 'multiselect', 'name' => 'Status Type', 'width' => '100%', 'div_class' => 'col-lg-2 col-md-2 col-sm-4', 'size' => '15', 'value' => $vars['log_type'], 'values' => $form_items['statuses']); // Datetime Field $form['row'][0]['timestamp'] = array('type' => 'datetime', 'div_class' => 'col-lg-5 col-md-7 col-sm-9', 'presets' => TRUE, 'min' => dbFetchCell('SELECT `timestamp` FROM `alert_log`' . $where . ' ORDER BY `timestamp` LIMIT 0,1;'), 'max' => dbFetchCell('SELECT `timestamp` FROM `alert_log`' . $where . ' ORDER BY `timestamp` DESC LIMIT 0,1;'), 'from' => $vars['timestamp_from'], 'to' => $vars['timestamp_to']); // Second row with timestamp for sm //$form['row_options'][1] = array('class' => 'hidden-lg hidden-md hidden-xs'); //$form['row'][1]['timestamp'] = $form['row'][0]['timestamp']; //$form['row'][1]['timestamp']['div_class'] = 'text-nowrap col-sm-9'; // search button $form['row'][0]['search'] = array('type' => 'submit', 'div_class' => 'col-lg-3 col-md-1 col-sm-3', 'right' => TRUE); print_form($form); unset($form, $form_items, $form_filter); // Pagination $vars['pagination'] = TRUE; // Print Alert Log print_alert_log($vars); register_html_title('Alert Log'); ?> </div> <!-- col-md-12 --> </div> <!-- row --> <?php // EOF
Device configuration: </a> </h3> </div> <div id="device_config" class="panel-collapse collapse in"> <div class="panel-body"> <?php // Disable pretty print for big files $device_config_class = strlen($device_config) < 250000 ? 'prettyprint linenums lang-sh' : ''; echo '<pre class="' . $device_config_class . '">' . PHP_EOL . escape_html($device_config) . '</pre>' . PHP_EOL; ?> </div> </div> </div> </div> <?php } else { //r(strlen($device_config)); // Disable pretty print for big files $device_config_class = strlen($device_config) < 250000 ? 'prettyprint linenums lang-sh' : ''; $text = '<pre class="' . $device_config_class . '">' . PHP_EOL . escape_html($device_config) . '</pre>' . PHP_EOL; } $text .= '<script type="text/javascript">window.prettyPrint && prettyPrint();</script>' . PHP_EOL; echo $text; } register_html_title('Config'); // Clean unset($text, $device_config, $diff, $rev, $rev_active_index); // EOF
foreach ($service_list as $service) { if ($vars['app'] == $service['service_type']) { $navbar['options'][$service['service_type']]['class'] = 'active'; } $navbar['options'][$service['service_type']]['url'] = generate_url(array('page' => 'apps', 'app' => $service['service_type'])); $navbar['options'][$service['service_type']]['text'] = nicecase($service['service_type']); $navbar['options'][$service['service_type']]['image'] = 'images/apps/' . $icon . '.png'; if (is_file($config['html_dir'] . '/images/apps/' . $icon . '_2x.png')) { // HiDPI icon $navbar['options'][$service['service_type']]['image_2x'] = 'images/apps/' . $icon . '_2x.png'; } $service_types[$service['service_type']] = array(); } print_navbar($navbar); unset($navbar); register_html_title("Services"); print_optionbar_start(); echo "<span style='font-weight: bold;'>Services</span> » "; $menu_options = array('basic' => 'Basic', 'details' => 'Details'); if (!$vars['view']) { $vars['view'] = "basic"; } $sep = ""; foreach ($menu_options as $option => $text) { if (empty($vars['view'])) { $vars['view'] = $option; } echo $sep; if ($vars['view'] == $option) { echo "<span class='pagemenu-selected'>"; }
// Message field $form['row'][0]['message'] = array('type' => 'text', 'name' => 'Message', 'placeholder' => 'Message', 'width' => '100%', 'div_class' => 'col-lg-3 col-md-4 col-sm-4', 'value' => $vars['message']); // Priority field $form_items['priorities'] = generate_form_values('syslog', NULL, 'priorities'); $form['row'][0]['priority'] = array('type' => 'multiselect', 'name' => 'Priorities', 'width' => '100%', 'div_class' => 'col-lg-1 col-md-2 col-sm-2', 'subtext' => TRUE, 'value' => $vars['priority'], 'values' => $form_items['priorities']); // Program field $form_filter = dbFetchColumn('SELECT DISTINCT `program` FROM `syslog` IGNORE INDEX (`program`)' . $where); $form_items['programs'] = generate_form_values('syslog', $form_filter, 'programs'); $form['row'][0]['program'] = array('type' => 'multiselect', 'name' => 'Programs', 'width' => '100%', 'div_class' => 'col-lg-1 col-md-2 col-sm-2', 'size' => '15', 'value' => $vars['program'], 'values' => $form_items['programs']); // Datetime Field $form['row'][0]['timestamp'] = array('type' => 'datetime', 'div_class' => 'col-lg-5 col-md-7 col-sm-10 col-lg-push-0 col-md-push-2 col-sm-push-2', 'presets' => TRUE, 'min' => dbFetchCell('SELECT `timestamp` FROM `syslog`' . $where . ' ORDER BY `timestamp` LIMIT 0,1;'), 'max' => dbFetchCell('SELECT `timestamp` FROM `syslog`' . $where . ' ORDER BY `timestamp` DESC LIMIT 0,1;'), 'from' => $vars['timestamp_from'], 'to' => $vars['timestamp_to']); // Second row with timestamp for md and sm //$form['row_options'][1] = array('class' => 'hidden-lg hidden-xs'); //$form['row'][1]['timestamp'] = $form['row'][0]['timestamp']; //$form['row'][1]['timestamp']['div_class'] = 'text-nowrap col-md-7 col-sm-8 col-md-offset-2 col-sm-offset-2'; // search button $form['row'][0]['search'] = array('type' => 'submit', 'div_class' => 'col-lg-1 col-md-5 col-sm-2', 'right' => TRUE); print_form($form); unset($form, $form_items, $form_devices); // Pagination $vars['pagination'] = TRUE; // Print syslog print_syslogs($vars); register_html_title('Syslog'); ?> </div> <!-- col-md-12 --> </div> <!-- row --> <?php // EOF
<?php /** * Observium Network Management and Monitoring System * Copyright (C) 2006-2015, Adam Armstrong - http://www.observium.org * * @package observium * @subpackage webui * @author Adam Armstrong <*****@*****.**> * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ register_html_title("User preferences"); $navbar['class'] = 'navbar-narrow'; $navbar['brand'] = 'User Preferences'; $pages = array('general' => 'General', 'authentication' => 'Authentication', 'authlog' => 'Auth Log'); if (!auth_can_change_password($_SESSION['username'])) { unset($pages['authentication']); } if (!$vars['section']) { $vars['section'] = "general"; } foreach ($pages as $page_name => $page_desc) { if ($vars['section'] == $page_name) { $navbar['options'][$page_name]['class'] = "active"; } $navbar['options'][$page_name]['url'] = generate_url(array('page' => 'preferences', 'section' => $page_name)); $navbar['options'][$page_name]['text'] = escape_html($page_desc); } /* $navbar['options_right']['add']['url'] = '#add_contact_modal';
$rtt_type = $sla['rtt_type']; if (!in_array($rtt_type, $rtt_types)) { if (isset($config['sla_type_labels'][$rtt_type])) { $text = $config['sla_type_labels'][$rtt_type]; } else { $text = nicecase($rtt_type); } } $rtt_types[$rtt_type] = $text; } asort($rtt_types); foreach ($rtt_types as $type => $text) { if ($vars['rtt_type'] == $type) { $navbar['options'][$type]['class'] = "active"; } $navbar['options'][$type]['url'] = generate_url(array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'slas', 'rtt_type' => $type)); $navbar['options'][$type]['text'] = $text; } $navbar['options']['graphs']['text'] = 'Graphs'; $navbar['options']['graphs']['icon'] = 'oicon-chart-up'; $navbar['options']['graphs']['right'] = TRUE; if ($vars['view'] == "graphs") { $navbar['options']['graphs']['class'] = 'active'; $navbar['options']['graphs']['url'] = generate_url($vars, array('view' => NULL)); } else { $navbar['options']['graphs']['url'] = generate_url($vars, array('view' => "graphs")); } print_navbar($navbar); print_sla_table($vars); register_html_title("SLAs"); // EOF
print_error_permission(); return; } if ($_POST['addsrv']) { if ($_SESSION['userlevel'] == '10') { $updated = '1'; #FIXME should call add_service (needs more parameters) $service_id = dbInsert(array('device_id' => $_POST['device'], 'service_ip' => $_POST['ip'], 'service_type' => $_POST['type'], 'service_desc' => $_POST['descr'], 'service_param' => $_POST['params'], 'service_ignore' => '0'), 'services'); if ($service_id) { $message .= $message_break . "Service added (" . $service_id . ")!"; $message_break .= "<br />"; } } } if ($handle = opendir($config['install_dir'] . "/includes/services/")) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && !strstr($file, ".")) { $servicesform .= "<option value='{$file}'>{$file}</option>"; } } closedir($handle); } foreach (dbFetchRows("SELECT * FROM `devices` ORDER BY `hostname`") as $device) { $devicesform .= "<option value='" . $device['device_id'] . "'>" . $device['hostname'] . "</option>"; } if ($updated) { print_message("Device Settings Saved"); } register_html_title("Add service"); echo "\n<h4>Add Service</h4>\n<form id='addsrv' name='addsrv' method='post' action=''>\n <input type=hidden name='addsrv' value='yes'>\n <table width='200' border='0'>\n <tr>\n <td>\n Device\n </td>\n <td>\n <select name='device'>\n {$devicesform}\n </select>\n </td>\n </tr>\n <tr>\n <td>\n Type\n </td>\n <td>\n <select name='type'>\n {$servicesform}\n </select>\n </td>\n </tr>\n <tr>\n <td width='300'><div align='right'>Description</div></td>\n <td colspan='2'><textarea name='descr' cols='50'></textarea></td>\n </tr>\n <tr>\n <td width='300'><div align='right'>IP Address</div></td>\n <td colspan='2'><input name='ip'></textarea></td>\n </tr>\n <tr>\n <td width='300'><div align='right'>Parameters</div></td>\n <td colspan='2'><input name='params'></textarea></td>\n </tr>\n <tr>\n </table>\n <input type='submit' name='Submit' value='Add' />\n <label><br />\n </label>\n</form>"; // EOF
if (is_numeric($data['vlan_vlan'])) { $form_devices[] = $data['device_id']; $form_items['vlans'][$data['vlan_vlan']] = 'Vlan ' . $data['vlan_vlan']; $form_items['vlan_name'][$data['vlan_name']] = $data['vlan_name']; } } ksort($form_items['vlans']); natcasesort($form_items['vlan_name']); // Select the devices with FDB tables //$form_devices = dbFetchColumn('SELECT DISTINCT `device_id` FROM `vlans_fdb`'); $form_items['devices'] = generate_form_values('device', $form_devices); $form = array('type' => 'rows', 'space' => '5px', 'submit_by_key' => TRUE, 'url' => 'search/search=fdb/'); $form['row'][0]['device_id'] = array('type' => 'multiselect', 'name' => 'Device', 'width' => '100%', 'value' => $vars['device_id'], 'groups' => array('', 'UP', 'DOWN', 'DISABLED'), 'values' => $form_items['devices']); $form['row'][0]['vlan_id'] = array('type' => 'multiselect', 'name' => 'VLAN IDs', 'width' => '100%', 'value' => $vars['vlan_id'], 'values' => $form_items['vlans']); $form['row'][0]['vlan_name'] = array('type' => 'multiselect', 'name' => 'VLAN Name', 'width' => '100%', 'value' => escape_html($vars['vlan_name']), 'values' => $form_items['vlan_name']); $form['row'][0]['address'] = array('type' => 'text', 'name' => 'MAC Address', 'width' => '100%', 'grid' => 3, 'placeholder' => TRUE, 'submit_by_key' => TRUE, 'value' => escape_html($vars['address'])); // search button $form['row'][0]['search'] = array('type' => 'submit', 'grid' => 3, 'value' => 'fdb', 'right' => TRUE); print_form($form); unset($form, $form_items, $form_devices); // Pagination $vars['pagination'] = TRUE; print_fdbtable($vars); register_html_title("FDB Search"); ?> </div> <!-- col-md-12 --> </div> <!-- row --> <?php // EOF
<?php /** * Observium Network Management and Monitoring System * Copyright (C) 2006-2015, Adam Armstrong - http://www.observium.org * * @package observium * @subpackage webui * @author Adam Armstrong <*****@*****.**> * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ // Pagination $vars['pagination'] = TRUE; $vars['entity'] = $port['port_id']; $vars['entity_type'] = "port"; print_events($vars); register_html_title("Events"); // EOF
* Observium Network Management and Monitoring System * Copyright (C) 2006-2015, Adam Armstrong - http://www.observium.org * * @package observium * @subpackage webui * @author Adam Armstrong <*****@*****.**> * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ $link_array = array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'routing'); #$type_text['overview'] = "Overview"; $type_text['ipsec_tunnels'] = "IPSEC Tunnels"; // Cisco ACE $type_text['loadbalancer_rservers'] = "Rservers"; $type_text['loadbalancer_vservers'] = "Serverfarms"; register_html_title("Routing"); $navbar = array(); $navbar['brand'] = "Routing"; $navbar['class'] = "navbar-narrow"; foreach ($routing_tabs as $type) { if (!$vars['proto']) { $vars['proto'] = $type; } $navbar['options'][$type]['url'] = generate_url(array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'routing', 'proto' => $type)); $navbar['options'][$type]['text'] = nicecase($type); if ($vars['proto'] == $type) { $navbar['options'][$type]['class'] = "active"; } } print_navbar($navbar); unset($navbar);
/** * Observium Network Management and Monitoring System * Copyright (C) 2006-2015, Adam Armstrong - http://www.observium.org * * @package observium * @subpackage webui * @author Adam Armstrong <*****@*****.**> * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ if ($_SESSION['userlevel'] < 10) { print_error_permission(); return; } register_html_title('Settings'); /** * Convert amqp|conn|host into returning value of $arrayvar['amqp']['conn']['host'] * * @param string $sqlname Variable name * @param array $arrayvar Array where to see param * @param Boolean $try_isset If True, return isset($sqlname) check, else return variable content * @return mixed */ function sql_to_array($sqlname, $arrayvar, $try_isset = TRUE) { list($key, $pop_sqlname) = explode('|', $sqlname, 2); $isset = isset($arrayvar[$key]); if ($pop_sqlname === NULL) { // Reached the variable, return its content, or FALSE if it's not set if ($try_isset) {
// if ($cache['devices']['id'][$device_id]['disabled'] && !$config['web_show_disabled']) { continue; } // else if (!in_array($device_id, $ip_devices)) { continue; } // Devices only with IP addresses // $devices_array[$device_id] = $hostname; //} $form = array('type' => 'rows', 'space' => '5px', 'submit_by_key' => TRUE); //$form['row'][0]['device'] = array( // 'type' => 'multiselect', // 'name' => 'Device', // 'width' => '100%', // 'value' => $vars['device'], // 'values' => $form_items['devices']); $form['row'][0]['interface'] = array('type' => 'select', 'name' => 'Interface', 'width' => '100%', 'value' => $vars['interface'], 'values' => array('' => 'All Interfaces', 'Lo' => 'Loopbacks', 'Vlan' => 'Vlans')); $form['row'][0]['network'] = array('type' => 'text', 'name' => 'IP Network', 'width' => '100%', 'placeholder' => TRUE, 'ajax' => TRUE, 'ajax_vars' => array('field' => 'ipv6_network'), 'value' => escape_html($vars['network'])); $form['row'][0]['address'] = array('type' => 'text', 'name' => 'IP Address', 'width' => '100%', 'grid' => 3, 'placeholder' => TRUE, 'value' => escape_html($vars['address'])); // search button $form['row'][0]['search'] = array('type' => 'submit', 'grid' => 3, 'value' => 'ipv6', 'right' => TRUE); print_form($form); unset($form, $form_items); // Pagination $vars['pagination'] = TRUE; // Print addresses print_addresses($vars); register_html_title("IPv6 Addresses"); ?> </div> <!-- col-md-12 --> </div> <!-- row --> <?php // EOF
$navbar['options'][$app_section]['class'] = "active"; } $navbar['options'][$app_section]['url'] = generate_url($vars, array('app_section' => $app_section)); $navbar['options'][$app_section]['text'] = $text; } print_navbar($navbar); unset($navbar); } else { // It appears this app doesn't have multiple sections. We set app_section to default here. $vars['app_section'] = 'default'; } // If a matching app_section array exists within app_graphs, print the graphs. if (isset($app_graphs[$vars['app_section']]) && is_array($app_graphs[$vars['app_section']])) { echo generate_box_open(); echo '<table class="table table-striped table-hover table-condensed">'; foreach ($app_graphs[$vars['app_section']] as $key => $text) { $graph_type = $key; $graph_array['to'] = $config['time']['now']; $graph_array['id'] = $app['app_id']; $graph_array['type'] = "application_" . $key; echo '<tr><td>'; echo '<h3>', $text, '</h4>'; print_graph_row($graph_array); echo '</td></tr>'; } echo '</table>'; generate_box_close(); } } register_html_title("Apps"); // EOF
$where .= generate_query_values($vars['device_id'], 'device_id'); } // Message field $form['row'][0]['message'] = array('type' => 'text', 'name' => 'Message', 'placeholder' => 'Message', 'width' => '100%', 'div_class' => 'col-lg-3 col-md-4 col-sm-4', 'value' => $vars['message']); // Severities field $form_filter = dbFetchColumn('SELECT DISTINCT `severity` FROM `eventlog`' . $where); $form_items['severities'] = generate_form_values('eventlog', $form_filter, 'severity'); $form['row'][0]['severity'] = array('type' => 'multiselect', 'name' => 'Severities', 'width' => '100%', 'div_class' => 'col-lg-1 col-md-2 col-sm-2', 'subtext' => TRUE, 'value' => $vars['severity'], 'values' => $form_items['severities']); // Types field $form_filter = dbFetchColumn('SELECT DISTINCT `entity_type` FROM `eventlog` IGNORE INDEX (`type`)' . $where); $form_items['types'] = generate_form_values('eventlog', $form_filter, 'type'); $form['row'][0]['type'] = array('type' => 'multiselect', 'name' => 'Types', 'width' => '100%', 'div_class' => 'col-lg-1 col-md-2 col-sm-2', 'size' => '15', 'value' => $vars['type'], 'values' => $form_items['types']); // Datetime Field $form['row'][0]['timestamp'] = array('type' => 'datetime', 'div_class' => 'col-lg-5 col-md-7 col-sm-10 col-lg-push-0 col-md-push-2 col-sm-push-2', 'presets' => TRUE, 'min' => dbFetchCell('SELECT `timestamp` FROM `eventlog`' . $where . ' ORDER BY `timestamp` LIMIT 0,1;'), 'max' => dbFetchCell('SELECT `timestamp` FROM `eventlog`' . $where . ' ORDER BY `timestamp` DESC LIMIT 0,1;'), 'from' => $vars['timestamp_from'], 'to' => $vars['timestamp_to']); // search button $form['row'][0]['search'] = array('type' => 'submit', 'div_class' => 'col-lg-1 col-md-5 col-sm-2', 'right' => TRUE); print_form($form); unset($form, $form_items, $form_devices); // Pagination $vars['pagination'] = TRUE; // Print events print_events($vars); register_html_title('Eventlog'); ?> </div> <!-- col-md-12 --> </div> <!-- row --> <?php // EOF