changes (though i remember not what)

git-svn-id: http://www.observium.org/svn/observer/trunk@2687 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-10-17 10:33:06 +00:00
parent e5493703c4
commit 7ca62bbe04
3 changed files with 22 additions and 6 deletions

View File

@ -39,7 +39,7 @@ if (isset($_GET['device'])) { $where = "WHERE device_id = ".mres($_GET['device']
if (isset($_GET['format']) && preg_match("/^[a-z]*$/", $_GET['format']))
{
$map = 'digraph G { sep=0.01; size="12,5.5"; pack=100; bgcolor=transparent; splines=true; overlap=scale; concentrate=0; epsilon=0.001; rankdir=0;
$map = 'digraph G { bgcolor=transparent; splines=true; overlap=scale; concentrate=0; epsilon=0.001; rankdir=LR;
node [ fontname="helvetica", fontstyle=bold, style=filled, color=white, fillcolor=lightgrey, overlap=false];
edge [ bgcolor=white, fontname="helvetica", fontstyle=bold, arrowhead=dot, arrowtail=dot];
graph [bgcolor=transparent];
@ -176,7 +176,8 @@ if (isset($_GET['format']) && preg_match("/^[a-z]*$/", $_GET['format']))
if ($links > 30) ### Unflatten if there are more than 10 links. beyond that it gets messy
{
$maptool = $config['unflatten'] . ' -f -l 5 | ' . $config['sfdp'] . ' -Gpack -Gcharset=latin1 | '.$config['dot'];
# $maptool = $config['unflatten'] . ' -f -l 5 | ' . $config['sfdp'] . ' -Gpack -Gcharset=latin1 | '.$config['dot'];
$maptool = $config['neato'];
} else {
$maptool = $config['dot'];
}
@ -185,7 +186,7 @@ if (isset($_GET['format']) && preg_match("/^[a-z]*$/", $_GET['format']))
{
# $maptool = $config['unflatten'] . ' -f -l 5 | ' . $config['sfdp'] . ' -Gpack -Goverlap=prism -Gcharset=latin1 | dot';
# $maptool = $config['sfdp'] . ' -Gpack -Goverlap=prism -Gcharset=latin1 -Gsize=20,20';
$maptool = $config['neato'];
$maptool = $config['dot'];
}
$descriptorspec = array(0 => array("pipe", "r"),1 => array("pipe", "w") );

View File

@ -27,7 +27,7 @@ foreach (dbFetchRows("SELECT `device_id`,`hostname` FROM `devices` GROUP BY `hos
?>
</select>
<br />
<input type="hostname" name="hostname" id="hostname" title="Hostname" style='width: 180px;' <?php if (strlen($vars['hostname_text'])) {echo('value="'.$vars['hostname'].'"');} ?> />
<input type="hostname" name="hostname" id="hostname" title="Hostname" style='width: 180px;' <?php if (strlen($vars['hostname'])) {echo('value="'.$vars['hostname'].'"');} ?> />
</td>
<td width="120">
<select name="state" id="state" style="width: 100px;">
@ -72,7 +72,10 @@ foreach (dbFetchRows("SELECT `ifType` FROM `ports` GROUP BY `ifType` ORDER BY `i
<select name="port_descr_type" id="port_descr_type" style="width: 150px;">
<option value="">All Port Types</option>
<?php
foreach (dbFetchRows("SELECT `port_descr_type` FROM `ports` GROUP BY `port_descr_type` ORDER BY `port_descr_type`") as $data)
$ports = dbFetchRows("SELECT `port_descr_type` FROM `ports` GROUP BY `port_descr_type` ORDER BY `port_descr_type`");
$total = count($ports);
echo("Total: $total");
foreach ($ports as $data)
{
if ($data['port_descr_type'])
{

View File

@ -7,9 +7,16 @@ echo("<tr class=tablehead><td></td><th>Device</a></th><th>Interface</th><th>Spee
$row = 1;
$ports_disabled = 0; $ports_down = 0; $ports_up = 0; $ports_total = 0;
foreach ($ports as $port)
{
if ($port['ifAdminStatus'] == "down") { $ports_disabled++;
} elseif ($port['ifAdminStatus'] == "up" && $port['ifOperStatus']== "down") { $ports_down++;
} elseif ($port['ifAdminStatus'] == "up" && $port['ifOperStatus']== "up") { $ports_up++; }
$ports_total++;
if (port_permitted($port['interface_id'], $port['device_id']))
{
@ -17,6 +24,8 @@ foreach ($ports as $port)
$speed = humanspeed($port['ifSpeed']);
$type = humanmedia($port['ifType']);
$ifclass = ifclass($port['ifOperStatus'], $port['ifAdminStatus']);
if ($port['in_errors'] > 0 || $port['out_errors'] > 0)
{
@ -30,7 +39,7 @@ foreach ($ports as $port)
echo("<tr bgcolor=$row_colour>
<td width=5></td>
<td width=200 class=list-bold><a href='" . generate_device_url($port) . "'>".$port['hostname']."</a></td>
<td width=150 class=list-bold><a href='" . generate_port_url($port) . "'>".fixIfName($port['label'])." $error_img</td>
<td width=150 class=list-bold><a class='".$ifclass."'href='" . generate_port_url($port) . "'>".fixIfName($port['label'])." $error_img</td>
<td width=110 >$speed</td>
<td width=110 class=green>".$port['in_rate']."</td>
<td width=110 class=blue>".$port['out_rate']."</td>
@ -44,4 +53,7 @@ foreach ($ports as $port)
echo("</table>");
echo("Ports: $ports_total ( Up $ports_up | Down $ports_down | Disabled $ports_disabled )");
?>