make sensor_type larger, merge both logs into one tab (ran out of space!)

git-svn-id: http://www.observium.org/svn/observer/trunk@2719 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-11-07 19:39:15 +00:00
parent 9891f0201b
commit 86248c8bce
9 changed files with 56 additions and 41 deletions

View File

@ -928,7 +928,7 @@ CREATE TABLE IF NOT EXISTS `sensors` (
`poller_type` varchar(16) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'snmp',
`sensor_oid` varchar(64) CHARACTER SET latin1 NOT NULL,
`sensor_index` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
`sensor_type` varchar(32) CHARACTER SET latin1 NOT NULL,
`sensor_type` varchar(255) CHARACTER SET latin1 NOT NULL,
`sensor_descr` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`sensor_divisor` int(11) NOT NULL DEFAULT '1',
`sensor_multiplier` int(11) NOT NULL DEFAULT '1',

View File

@ -19,6 +19,5 @@ ALTER TABLE `bills` ADD `rate_average_in` int(11) NOT NULL;
ALTER TABLE `bills` ADD `rate_average_out` int(11) NOT NULL;
ALTER TABLE `bills` ADD `rate_average` int(11) NOT NULL;
ALTER TABLE `bills` ADD `bill_last_calc` datetime NOT NULL;
CREATE TABLE IF NOT EXISTS `bill_history` ( `id` int(11) NOT NULL AUTO_INCREMENT, `bill_id` int(11) NOT NULL, `bill_datefrom` datetime NOT NULL, `bill_dateto` datetime NOT NULL, `bill_type` text NOT NULL, `bill_allowed` int(11) NOT NULL, `bill_used` int(11) NOT NULL, `bill_overuse` int(11) NOT NULL, `bill_percent` decimal(5,2) NOT NULL, `rate_95th_in` int(11) NOT NULL, `rate_95th_out` int(11) NOT NULL, `rate_95th` int(11) NOT NULL, `dir_95th` varchar(3) NOT NULL, `rate_average` int(11) NOT NULL, `rate_average_in` int(11) NOT NULL, `rate_average_out` int(11) NOT NULL, `traf_in` int(11) NOT NULL, `traf_out` int(11) NOT NULL, `traf_total` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `bill_id` (`bill_id`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
ALTER TABLE `sensors` CHANGE `sensor_oid` `sensor_oid` VARCHAR( 255 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;

View File

@ -15,7 +15,7 @@ echo('<tr style="background-color: ' . $bg . '">
' . $entry['datetime'] . '
</td>');
if (!isset($_GET['id']) && (!isset($overview) || $overview == 0)) {
if (!isset($vars['device'])) {
$dev = device_by_id_cache($entry['host']);
echo("<td class=list-bold width=150>
" . generate_device_link($dev, shorthost($dev['hostname'])) . "
@ -24,7 +24,8 @@ if (!isset($_GET['id']) && (!isset($overview) || $overview == 0)) {
if ($entry['type'] == "interface")
{
$entry['link'] = "<b>".generate_port_link(getifbyid($entry['reference']))."</b>";
$this_if = ifLabel(getifbyid($entry['reference']));
$entry['link'] = "<b>".generate_port_link($this_if, makeshortif(strtolower($this_if['label'])))."</b>";
} else {
$entry['link'] = "System";
}
@ -34,4 +35,4 @@ echo("<td>".$entry['link']."</td>");
echo("<td>".htmlspecialchars($entry['message']) . "</td>
</tr>");
?>
?>

View File

@ -10,14 +10,13 @@ if (device_permitted($entry['device_id']))
$entry['hostname'] = shorthost($entry['hostname'], 20);
if ($_GET['page'] != "device")
if ($vars['page'] != "device")
{
echo("<td class=syslog width=140>" . $entry['date'] . "</td>");
echo("<td width=160><strong>".generate_device_link($entry)."</strong></td>");
echo("<td class=syslog><strong>" . $entry['program'] . " : </strong> " . htmlspecialchars($entry['msg']) . "</td>");
} else {
echo("<td class=syslog><i>" . $entry['date'] . "</i>&nbsp;&nbsp;&nbsp;<strong>" . $entry['program'] . "</strong>&nbsp;&nbsp;&nbsp;" . htmlspecialchars($entry['msg']) . "</td>");
}
echo("</tr>");

View File

@ -222,22 +222,13 @@ if (device_permitted($vars['device']) || $check_device == $vars['device'])
if (device_permitted($device['device_id']))
{
echo('<li class="' . $select['events'] . '">
<a href="'.generate_device_url($device, array('tab' => 'events')).'">
<img src="images/16/report_magnify.png" align="absmiddle" border="0" /> Events
echo('<li class="' . $select['logs'] . '">
<a href="'.generate_device_url($device, array('tab' => 'logs')).'">
<img src="images/16/report_magnify.png" align="absmiddle" border="0" /> Logs
</a>
</li>');
}
if ($config['enable_syslog'])
{
echo('<li class="' . $select['syslog'] . '">
<a href="'.generate_device_url($device, array('tab' => 'syslog')).'">
<img src="images/16/printer.png" align="absmiddle" border="0" /> Syslog
</a>
</li>');
}
if ($_SESSION['userlevel'] >= "7")
{
if (!is_array($config['rancid_configs'])) { $config['rancid_configs'] = array($config['rancid_configs']); }

View File

@ -1,15 +0,0 @@
<?php
$entries = dbFetchRows("SELECT *,DATE_FORMAT(datetime, '%D %b %Y %T') as humandate FROM `eventlog` WHERE `host` = ? ORDER BY `datetime` DESC LIMIT 0,250", array($device['device_id']));
echo('<table cellspacing="0" cellpadding="2" width="100%">');
foreach ($entries as $entry)
{
include("includes/print-event.inc.php");
}
echo('</table>');
$pagetitle[] = "Events";
?>

View File

@ -0,0 +1,41 @@
<hr />
<form method="post" action="">
<label><strong>Search</strong>
<input type="text" name="string" id="string" value="<?php echo($_POST['string']); ?>" />
</label>
<label>
<strong>Type</strong>
<select name="type" id="type">
<option value="">All Types</option>
<option value="system">System</option>
<?php
foreach (dbFetchRows("SELECT `type` FROM `eventlog` WHERE device_id = ? GROUP BY `type` ORDER BY `type`", array($device['device_id'])) as $data)
{
echo("<option value='".$data['type']."'");
if ($data['type'] == $_POST['type']) { echo("selected"); }
echo(">".$data['type']."</option>");
}
?>
</select>
</label>
<input class=submit type=submit value=Search>
</form>
<?php
print_optionbar_end();
$entries = dbFetchRows("SELECT *,DATE_FORMAT(datetime, '%D %b %Y %T') as humandate FROM `eventlog` WHERE `host` = ? ORDER BY `datetime` DESC LIMIT 0,250", array($device['device_id']));
echo('<table cellspacing="0" cellpadding="2" width="100%">');
foreach ($entries as $entry)
{
include("includes/print-event.inc.php");
}
echo('</table>');
$pagetitle[] = "Events";
?>

View File

@ -1,8 +1,5 @@
<?php
print_optionbar_start('25');
?>
<hr />
<form method="post" action="">
<label><strong>Search</strong>

View File

@ -34,15 +34,17 @@ function get_cache($host, $value) {
function process_syslog ($entry, $update) {
global $config;
global $dev_cache;
foreach ($config['syslog_filter'] as $bi)
if (strpos($entry['msg'], $bi) !== FALSE) {
{
if (strpos($entry['msg'], $bi) !== FALSE)
{
print_r($entry);
echo('D-'.$bi);
return $entry;
}
}
$entry['device_id'] = get_cache($entry['host'], 'device_id');
if ($entry['device_id']) {