better front page? who knows!

git-svn-id: http://www.observium.org/svn/observer/trunk@200 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2008-03-24 01:21:11 +00:00
parent 126fbc630d
commit 93d3751b3f
5 changed files with 23 additions and 47 deletions

View File

@@ -61,8 +61,8 @@ $config['favicon'] = "favicon.ico";
$config['page_refresh'] = "30"; ## Refresh the page every xx seconds
$config['email_default'] = "adama@memetic.org";
$config['email_from'] = "Observer Dev <observer-dev@project-observer.org>";
$config['email_default'] = "you@yourdomain";
$config['email_from'] = "Observer <observer@yourdomain>";
$config['email_headers'] = "From: " . $config['email_from'] . "\r\n";
@@ -71,8 +71,8 @@ $config['email_headers'] = "From: " . $config['email_from'] . "\r\n";
$config['int_customers'] = 1; # Enable Customer Port Parsing
$config['int_transit'] = 1; # Enable Transit Types
$config['int_peering'] = 1; # Enable Peering Types
$config['int_core'] = 1; # Enable Core Port Types
$config['int_l2tp'] = 1; # Enable L2TP Port Types
$config['int_core'] = 1; # Enable Core Port Types
$config['int_l2tp'] = 1; # Enable L2TP Port Types
$config['show_locations'] = 1; # Enable Locations on menu
@@ -88,7 +88,6 @@ $config['syslog_filter'] = array("last message repeated", "Connection from UDP:
$config['syslog_age'] = "1 month"; ## Time to keep syslog for in
## MySQL DATE_SUB format (eg '1 day', '1 month')
### Interface name strings to ignore
$config['bad_if'] = array("null", "virtual-", "unrouted", "eobc", "mpls", "sl0", "lp0", "faith0",
"-atm layer", "-atm subif", "-shdsl", "-adsl", "-aal5", "-atm",
@@ -99,29 +98,6 @@ $config['bad_if'] = array("null", "virtual-", "unrouted", "eobc", "mpls", "sl0",
$config['ignore_mount'] = array("/kern", "/mnt/cdrom", "/dev", "/dev/pts", "/proc/bus/usb");
### entPhysicalVendorType rewrites
$entPhysicalVendorTypes = array (
'cevC7xxxIo1feTxIsl' => 'C7200-IO-FE-MII',
'cevChassis7140Dualfe' => 'C7140-2FE',
'cevChassis7204' => "C7204",
'cevChassis7204Vxr' => 'C7204VXR',
'cevChassis7206' => 'C7206',
'cevChassis7206Vxr' => 'C7206VXR',
'cevCpu7200Npe200' => 'NPE-200',
'cevCpu7200Npe225' => 'NPE-225',
'cevCpu7200Npe300' => 'NPE-300',
'cevCpu7200Npe400' => 'NPE-400',
'cevCpu7200Npeg1' => 'NPE-G1',
'cevCpu7200Npeg2' => 'NPE-G2',
'cevPa1feTxIsl' => 'PA-FE-TX-ISL',
'cevPa2feTxI82543' => 'PA-2FE-TX',
'cevPa8e' => 'PA-8E',
'cevPaA8tX21' => 'PA-8T-X21',
'cevMGBIC1000BaseLX' => '1000BaseLX GBIC',
'cevPort10GigBaseLR' => '10GigBaseLR');
### Style Options
$list_colour_a = "#ffffff";

View File

@@ -1,13 +1,11 @@
<?
$descr = $_POST['descr'];
$apache = $_POST['apache'];
$temp = $_POST['temp'];
$ignore = $_POST['ignore'];
$type = $_POST['type'];
$disabled = $_POST['disabled'];
$sql = "UPDATE `devices` SET `purpose` = '$descr', `apache` = '$apache', `type` = '$type', `ignore` = '$ignore', `disabled` = '$disabled' WHERE `device_id` = '$_GET[id]'";
$sql = "UPDATE `devices` SET `purpose` = '$descr', `type` = '$type', `ignore` = '$ignore', `disabled` = '$disabled' WHERE `device_id` = '$_GET[id]'";
$query = mysql_query($sql);
$rows_updated = mysql_affected_rows();

View File

@@ -10,7 +10,7 @@ if($_POST['addsrv']) {
}
}
if ($handle = opendir($config['installdir'] . "/includes/services/")) {
if ($handle = opendir($config['install_dir'] . "/includes/services/")) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && !strstr($file, ".")) {
$servicesform .= "<option value='$file'>$file</option>";

View File

@@ -101,8 +101,17 @@ foreach($nodes as $node) {
$mouseover = "onmouseover=\"return overlib('<img src=\'graph.php?host=$node&from=$week&to=$now&width=400&height=120&type=cpu\'>');\"
onmouseout=\"return nd();\"";
if(hoststatus($node)) { $statimg = "<img align=absmiddle src=images/16/lightbulb.png alt='Host Up'>"; $box_bg = "#ffffaa"; }
else { $statimg = "<img align=absmiddle src=images/16/lightbulb_off.png alt='Host Down'>"; $box_bg = "#ffaaaa"; }
if(hoststatus($node)) {
$statimg = "<img align=absmiddle src=images/16/lightbulb.png alt='Host Up'>";
$background_image = "images/boxbgorange.png";
$background_color = "#ddffdd";
} else {
$statimg = "<img align=absmiddle src=images/16/lightbulb_off.png alt='Host Down'>";
$background_image = "images/boxbgpink.png";
$background_color = "#ffdddd";
}
if($ints || $services) { $background_color = "#ffddaa"; }
if($rebooted) { $statimg = "<img align=absmiddle src=images/16/lightning.png alt='Host Rebooted'>"; }
@@ -115,9 +124,10 @@ foreach($nodes as $node) {
$shorthost = $first;
if(strlen($first.".".$second) < 16) { $shorthost = $first.".".$second; }
$device['device_id'] = $node;
$errorboxes .= "<div style='float: left; padding: 5px; width: 124px; height: 100px; background: $box_bg; margin: 4px;'>
<center><strong>".$shorthost."</strong><br />";
$errorboxes .= "<div style='border: solid 2px #D0D0D0; float: left; padding: 5px; width: 120px; height: 100px; background: $background_color; margin: 4px;'>
<center><strong>".generatedevicelink($device, $shorthost)."</strong><br />";
if(hoststatus($node)) {$errorboxes .= " <span class=body-date-1>".formatuptime($uptime, short)."</span> <br />";
} else { $errorboxes .= " <span class=body-date-1>Unreachable</span> <br />"; }

View File

@@ -57,19 +57,11 @@ if($device['disabled']) { echo("checked=checked"); }
echo("/></td>
<td width='300'><div align='right'>Ignore</div></td>
<td width='300'><input name='ignore' type='checkbox' id='disable' value='1'");
if($device['ignore']) { echo("checked=checked"); }
if($device['ignore']) { echo("checked=checked"); }
echo("/></td>
</tr>
<tr>
<td width='300'><div align='right'>Apache</div></td>
<td width='300'><label>
<input name='apache' type='checkbox' id='apache' value='1'");
</tr>");
if($device['apache']) {echo("checked=checked");}
echo("/>
</label></td>
</tr>
echo("
</table>
<input type='submit' name='Submit' value='Save' />
<label><br />