function show_splitlog($config) { echo '<div class="row">' . PHP_EOL; echo ' <div class="col-sm-6">' . PHP_EOL; print_events(array('short' => TRUE, 'pagesize' => $config['frontpage']['eventlog']['items'], 'severity' => $config['frontpage']['eventlog']['severity'], 'header' => array('url' => '/eventlog/', 'title' => 'Recent Events', 'header-border' => TRUE))); echo ' </div>'; echo ' <div class="col-sm-6">' . PHP_EOL; print_syslogs(array('short' => TRUE, 'pagesize' => $config['frontpage']['syslog']['items'], 'priority' => $config['frontpage']['syslog']['priority'], 'header' => array('url' => '/syslog/', 'title' => 'Recent Syslog Messages', 'header-border' => TRUE))); echo ' </div>'; echo '</div>'; }
echo "</div></div>"; } if ($config['enable_syslog']) { if (dbFetchCell("SELECT COUNT(*) from `syslog` WHERE `device_id` = ?", array($device['device_id']))) { ?> <div class="well info_box"> <div class="title"><a href="<?php echo generate_url(array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'logs', 'section' => 'syslog')); ?> "> <i class="oicon-clipboard-eye"></i> Syslog</a></div> <div class="content"> <?php print_syslogs(array('device' => $device['device_id'], 'short' => TRUE)); ?> </div> </div> <?php } } echo "</div>"; echo '<div class="col-md-6">'; // Right Pane if ($device['os_group'] == "unix") { include "overview/processors-unix.inc.php"; } else { include "overview/processors.inc.php"; } if (is_array($device_state['ucd_mem'])) {
function show_splitlog($config) { //Show syslog and eventlog echo '<div class="row">' . PHP_EOL; echo ' <div class="col-md-6">' . PHP_EOL; echo ' <h3 class="bill">最近的事件日志内容</h3>' . PHP_EOL; print_events(array('short' => true, 'pagesize' => $config['frontpage']['eventlog']['items'])); echo ' </div>' . PHP_EOL; echo ' <div class="col-md-6">' . PHP_EOL; echo ' <h3 class="bill">最近的日志信息</h3>' . PHP_EOL; print_syslogs(array('short' => true, 'pagesize' => $config['frontpage']['syslog']['items'], 'priority' => $config['frontpage']['syslog']['priority'])); echo ' </div>' . PHP_EOL; echo '</div>' . PHP_EOL; }
function show_syslog($config) { // Show syslog $show_syslog = "<div class=\"row\">"; $show_syslog .= " <div class=\"col-md-12 \">"; $show_syslog .= " <h3 class=\"bill\">最近的日志信息</h3>"; echo $show_syslog; print_syslogs(array('pagesize' => $config['frontpage']['syslog']['items'], 'priority' => $config['frontpage']['syslog']['priority'])); $show_syslog = " </div>"; $show_syslog .= "</div>"; echo $show_syslog; }
} $priorities[$p] = ucfirst($priority['name']); } $search[] = array('type' => 'multiselect', 'name' => 'Priorities', 'id' => 'priority', 'width' => '150px', 'subtext' => TRUE, 'value' => $vars['priority'], 'values' => $priorities); //Program field //$programs[''] = '所有程序'; foreach (dbFetchRows('SELECT `program` FROM `syslog`' . $where . 'GROUP BY `program` ORDER BY `program`') as $data) { $program = $data['program'] != '' ? $data['program'] : '[[EMPTY]]'; $programs[$program] = $program; } $search[] = array('type' => 'multiselect', 'name' => 'Programs', 'id' => 'program', 'width' => '150px', 'size' => '15', 'value' => $vars['program'], 'values' => $programs); $search[] = array('type' => 'newline'); $search[] = array('type' => 'datetime', 'id' => 'timestamp', 'presets' => TRUE, 'min' => dbFetchCell('SELECT MIN(`timestamp`) FROM `syslog`' . $where), 'max' => dbFetchCell('SELECT MAX(`timestamp`) FROM `syslog`' . $where), 'from' => $vars['timestamp_from'], 'to' => $vars['timestamp_to']); print_search($search, '系统日志'); // Pagination $vars['pagination'] = TRUE; if (!$vars['pagesize']) { $vars['pagesize'] = 100; } if (!$vars['pageno']) { $vars['pageno'] = 1; } // Print syslog print_syslogs($vars); $pagetitle[] = '系统日志'; ?> </div> <!-- col-md-12 --> </div> <!-- row --> <?php // EOF
} else { $sql = mysql_query("SELECT * FROM `devices` AS D, bgpPeers AS B, devices_perms AS P WHERE D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' AND bgpPeerAdminStatus = 'start' AND bgpPeerState != 'established' AND B.device_id = D.device_id AND D.ignore = 0"); } while ($peer = mysql_fetch_assoc($sql)) { generate_front_box("#ffaaaa", "<center><strong>" . generate_device_link($peer, shorthost($peer['hostname'])) . "</strong><br />\n <span style='font-size: 14px; font-weight: bold; margin: 5px; color: #c00;'>BGP Down</span>\n <span style='" . (strstr($peer['bgpPeerIdentifier'], ':') ? 'font-size: 10px' : '') . "'><strong>" . $peer['bgpPeerIdentifier'] . "</strong></span><br />\n <span class=body-date-1>AS" . truncate($peer['bgpPeerRemoteAs'] . " " . $peer['astext'], 14, "") . "</span>\n </center>"); } } if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0) { if ($_SESSION['userlevel'] == '10') { $sql = mysql_query("SELECT * FROM `devices` AS D WHERE D.status = '1' AND D.uptime > 0 AND D.uptime < '" . $config['uptime_warning'] . "' AND D.ignore = 0"); } else { $sql = mysql_query("SELECT * FROM `devices` AS D, devices_perms AS P WHERE D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' AND D.status = '1' AND D.uptime > 0 AND D.uptime < '" . $config['uptime_warning'] . "' AND D.ignore = 0"); } while ($device = mysql_fetch_assoc($sql)) { generate_front_box("#aaffaa", "<center><strong>" . generate_device_link($device, shorthost($device['hostname'])) . "</strong><br />\n <span style='font-size: 14px; font-weight: bold; margin: 5px; color: #009;'>Device<br />Rebooted</span><br />\n <span class=body-date-1>" . formatUptime($device['uptime'], 'short') . "</span>\n </center>"); } } if ($config['enable_syslog']) { // Open Syslog Div echo "<div style='margin: 4px; clear: both; padding: 5px;'>\n <h3>Recent Syslog Messages</h3>\n "; print_syslogs(array('pagesize' => $config['frontpage']['syslog']['items'])); echo "</div>"; // Close Syslog Div } else { // Open eventlog Div echo "<div style='margin: 4px; clear: both; padding: 5px;'>\n <h3>Recent Eventlog Entries</h3>\n "; print_events(array('pagesize' => $config['frontpage']['eventlog']['items'])); echo "</div>"; // Close eventlog Div } echo "</div>";
function show_syslog($config) { // Show syslog $show_syslog = "<div class=\"row-fluid\">"; $show_syslog .= " <div class=\"span12 \">"; $show_syslog .= " <h3 class=\"bill\">Recent Syslog Messages</h3>"; echo $show_syslog; print_syslogs(array('pagesize' => $config['frontpage']['syslog']['items'])); $show_syslog = " </div>"; $show_syslog .= "</div>"; echo $show_syslog; }
<?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 * */ if ($config['enable_syslog']) { if (dbFetchCell("SELECT COUNT(*) from `syslog` WHERE `device_id` = ?", array($device['device_id']))) { print_syslogs(array('device' => $device['device_id'], 'short' => TRUE, 'pagesize' => '20', 'header' => array('title' => 'Syslog', 'icon' => 'oicon-clipboard-eye', 'url' => generate_url(array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'logs', 'section' => 'syslog'))))); } } // EOF