rejig events system (still not great. meh) clean up some pages.

git-svn-id: http://www.observium.org/svn/observer/trunk@1223 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-06-20 21:37:05 +00:00
parent 64628bd1fb
commit 8060d5a030
19 changed files with 89 additions and 34 deletions

View File

@@ -1,15 +1,17 @@
<?php
$descr = $_POST['descr'];
$ignore = $_POST['ignore'];
$type = $_POST['type'];
$disabled = $_POST['disabled'];
$community = $_POST['community'];
$snmpver = $_POST['snmpver'];
$descr = mres($_POST['descr']);
$ignore = mres($_POST['ignore']);
$type = mres($_POST['type']);
$disabled = mres($_POST['disabled']);
$community = mres($_POST['community']);
$snmpver = mres($_POST['snmpver']);
$port = mres($_POST['port']);
#FIXME needs more sanity checking!
$sql = "UPDATE `devices` SET `purpose` = '" . mysql_escape_string($descr) . "', `community` = '" . mysql_escape_string($community) . "', `type` = '$type'";
$sql .= ", `snmpver` = '" . mysql_escape_string($snmpver) . "', `ignore` = '$ignore', `disabled` = '$disabled' WHERE `device_id` = '$_GET[id]'";
#FIXME needs more sanity checking! and better feedback
$sql = "UPDATE `devices` SET `purpose` = '" . $descr . "', `community` = '" . $community . "', `type` = '$type'";
$sql .= ", `snmpver` = '" . $snmpver . "', `ignore` = '$ignore', `disabled` = '$disabled', `port` = '$port' WHERE `device_id` = '".$device['device_id']."'";
$query = mysql_query($sql);
$rows_updated = mysql_affected_rows();

View File

@@ -24,11 +24,15 @@ if(isset($bg) && $bg == $list_colour_a) { $bg = $list_colour_b; } else { $bg=$li
</td>");
}
echo('<td class="syslog" width="100">');
if($entry['interface']) {
echo(generateiflink(getifbyid($entry['interface'])));
}
echo("</td><td>" . htmlspecialchars($entry['message']) . "</td>
if($entry['type'] == "interface") {
$entry['link'] = "<b>".generateiflink(getifbyid($entry['reference']))."</b>";
} else {
$entry['link'] = "System";
}
echo("<td>".$entry['link']."</td>");
echo("<td>".htmlspecialchars($entry['message']) . "</td>
</tr>");

View File

@@ -11,7 +11,7 @@ if(!is_integer($syslog_iter/2)) { $bg_colour = $list_colour_a; } else { $bg_colo
echo("<tr style=\"background-color: $bg_colour\">
<td width=0></td>");
echo("<td class=syslog width=125>" . $entry['date'] . "</td>");
echo("<td class=syslog width=140>" . $entry['date'] . "</td>");
$entry['hostname'] = shorthost($entry['hostname'], 20);

View File

@@ -36,12 +36,22 @@ echo("<table cellpadding=0 cellspacing=0><tr><td>
<tr>
<td width='300'><div align='right'>SNMP Community</div></td>
<td colspan='3'><input name='community' size='20' value='" . $device['community'] . "'></input>
<select name='snmpver'>
</td>
</tr>
<tr>
<td><div align=right>SNMP Version</div></td>
<td><select name='snmpver'>
<option value='v1'>v1</option>
<option value='v2c'" . ($device['snmpver'] == 'v2c' ? 'selected=selected' : '') . ">v2c</option>
</select>
</td>
</tr>
<tr>
<td width='300'><div align='right'>SNMP Port</div></td>
<td colspan='3'><input name='port' size='20' value='" . $device['port'] . "'></input>
</td>
</tr>
<tr>
<td align='right'>
Type

View File

@@ -2,7 +2,7 @@
$query = "SELECT *,DATE_FORMAT(datetime, '%D %b %Y %T') as humandate FROM `eventlog` WHERE `host` = '$_GET[id]' ORDER BY `datetime` DESC LIMIT 0,250";
$data = mysql_query($query);
echo('<table cellspacing="0" cellpadding="1" width="100%">');
echo('<table cellspacing="0" cellpadding="2" width="100%">');
while($entry = mysql_fetch_array($data)) {
include("includes/print-event.inc");

View File

@@ -17,7 +17,7 @@
$text_descr = str_replace("DFC Card", "DFC", $text_descr);
$proc_popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$text_descr;
$proc_popup .= "</div><img src=\'graph.php?id=" . $proc['proc_id'] . "&type=proc&from=$month&to=$now&width=400&height=125\'>";
$proc_popup .= "</div><img src=\'graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$month&to=$now&width=400&height=125\'>";
$proc_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
$perc = round($proc['processor_usage']);

View File

@@ -65,6 +65,19 @@ echo("
}
$sql = "SELECT *, DATE_FORMAT(timestamp, '%d/%b/%y %T') AS date from syslog WHERE device_id = '" . $_GET['id'] . "' $where";
$sql .= " ORDER BY timestamp DESC LIMIT 20";
$query = mysql_query($sql);
if(mysql_affected_rows() > "0"){
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
echo("<p style='padding: 0px 5px 5px;' class=sectionhead><img align='absmiddle' src='".$config['base_url']."/images/16/printer.png'> Recent Syslog</p>");
echo("<table cellspacing=0 cellpadding=2 width=100%>");
while($entry = mysql_fetch_array($query)) { include("includes/print-syslog.inc"); }
echo("</table>");
echo("</div>");
}
echo("</div>");
echo("<div style='float:right; width: 50%;'>");

View File

@@ -24,7 +24,7 @@
$mini_url = $config['base_url'] . "/graph.php?id=".$proc['processor_id']."&type=processor&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4";
$proc_popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$text_descr;
$proc_popup .= "</div><img src=\'graph.php?id=" . $proc['proc_id'] . "&type=proc&from=$month&to=$now&width=400&height=125\'>";
$proc_popup .= "</div><img src=\'graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$month&to=$now&width=400&height=125\'>";
$proc_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
$perc = round($proc['processor_usage']);