syntaxer run

git-svn-id: http://www.observium.org/svn/observer/trunk@2969 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2012-04-05 16:48:06 +00:00
parent 2b6581f25d
commit 866c352c5f
6 changed files with 13 additions and 14 deletions

View File

@ -38,6 +38,6 @@ echo(' <td>' . formatUptime($device['uptime'], 'short') . ' <br />');
if (get_dev_attrib($device,'override_sysLocation_bool')) { $device['location'] = get_dev_attrib($device,'override_sysLocation_string'); } if (get_dev_attrib($device,'override_sysLocation_bool')) { $device['location'] = get_dev_attrib($device,'override_sysLocation_string'); }
echo(' ' . truncate($device['location'],32, '') . '</td>'); echo(' ' . truncate($device['location'],32, '') . '</td>');
echo (' </tr>'); echo(' </tr>');
?> ?>

View File

@ -44,11 +44,11 @@ echo(' <tr class="'.$class.'" bgcolor="' . $bg . '" onmouseover="this.style.bac
<br />' . $device['sysName'] . '</td>' <br />' . $device['sysName'] . '</td>'
); );
echo ('<td width="55">'); echo('<td width="55">');
if ($port_count) { echo(' <img src="images/icons/port.png" align=absmiddle /> '.$port_count); } if ($port_count) { echo(' <img src="images/icons/port.png" align=absmiddle /> '.$port_count); }
echo('<br />'); echo('<br />');
if ($sensor_count) { echo(' <img src="images/icons/sensors.png" align=absmiddle /> '.$sensor_count); } if ($sensor_count) { echo(' <img src="images/icons/sensors.png" align=absmiddle /> '.$sensor_count); }
echo ('</td>'); echo('</td>');
echo(' <td class="paddedcell">' . $device['hardware'] . '<br />' . $device['features'] . '</td>'); echo(' <td class="paddedcell">' . $device['hardware'] . '<br />' . $device['features'] . '</td>');
echo(' <td class="paddedcell">' . $device['os_text'] . '<br />' . $device['version'] . '</td>'); echo(' <td class="paddedcell">' . $device['os_text'] . '<br />' . $device['version'] . '</td>');
echo(' <td class="paddedcell">' . formatUptime($device['uptime'], 'short') . ' <br />'); echo(' <td class="paddedcell">' . formatUptime($device['uptime'], 'short') . ' <br />');
@ -56,6 +56,6 @@ echo(' <td class="paddedcell">' . formatUptime($device['uptime'], 'short') .
if (get_dev_attrib($device,'override_sysLocation_bool')) { $device['location'] = get_dev_attrib($device,'override_sysLocation_string'); } if (get_dev_attrib($device,'override_sysLocation_bool')) { $device['location'] = get_dev_attrib($device,'override_sysLocation_string'); }
echo(' ' . truncate($device['location'],32, '') . '</td>'); echo(' ' . truncate($device['location'],32, '') . '</td>');
echo (' </tr>'); echo(' </tr>');
?> ?>

View File

@ -92,9 +92,9 @@ if ($device['os'] == "ios" || $device['os'] == "iosxe")
echo('<p class=box-desc><span class=purple><a title="'); echo('<p class=box-desc><span class=purple><a title="');
$vlans = dbFetchRows("SELECT * FROM `ports_vlans` AS PV, vlans AS V WHERE PV.`interface_id` ='".$port['interface_id']."' and PV.`device_id` = '".$device['device_id']."' AND V.`vlan_vlan` = PV.vlan AND V.device_id = PV.device_id"); $vlans = dbFetchRows("SELECT * FROM `ports_vlans` AS PV, vlans AS V WHERE PV.`interface_id` ='".$port['interface_id']."' and PV.`device_id` = '".$device['device_id']."' AND V.`vlan_vlan` = PV.vlan AND V.device_id = PV.device_id");
foreach($vlans as $vlan) foreach ($vlans as $vlan)
{ {
if($vlan['state'] == "blocking") { $class="red"; } elseif ($vlan['state'] == "forwarding" ) { $class="green"; } else { $class = "none"; } if ($vlan['state'] == "blocking") { $class="red"; } elseif ($vlan['state'] == "forwarding" ) { $class="green"; } else { $class = "none"; }
echo("<b class=".$class.">".$vlan['vlan'] ."</b> ".$vlan['vlan_descr']."<br />"); echo("<b class=".$class.">".$vlan['vlan'] ."</b> ".$vlan['vlan_descr']."<br />");
} }
echo('">'.$port['ifTrunk'].'</a></span></p>'); echo('">'.$port['ifTrunk'].'</a></span></p>');

View File

@ -346,7 +346,7 @@ foreach (array('fanspeed','humidity','temperature') as $item)
{ {
if ($menu_sensors[$item]) if ($menu_sensors[$item])
{ {
echo ('<li><a href="health/metric='.$item.'/"><img src="images/icons/'.$item.'.png" border="0" align="absmiddle" /> '.ucfirst($item).'</a></li>'); echo('<li><a href="health/metric='.$item.'/"><img src="images/icons/'.$item.'.png" border="0" align="absmiddle" /> '.ucfirst($item).'</a></li>');
unset($menu_sensors[$item]);$sep++; unset($menu_sensors[$item]);$sep++;
} }
} }
@ -361,7 +361,7 @@ foreach (array('current','frequency','power','voltage') as $item)
{ {
if ($menu_sensors[$item]) if ($menu_sensors[$item])
{ {
echo ('<li><a href="health/metric='.$item.'/"><img src="images/icons/'.$item.'.png" border="0" align="absmiddle" /> '.ucfirst($item).'</a></li>'); echo('<li><a href="health/metric='.$item.'/"><img src="images/icons/'.$item.'.png" border="0" align="absmiddle" /> '.ucfirst($item).'</a></li>');
unset($menu_sensors[$item]);$sep++; unset($menu_sensors[$item]);$sep++;
} }
} }
@ -374,7 +374,7 @@ if ($sep && array_keys($menu_sensors))
foreach (array_keys($menu_sensors) as $item) foreach (array_keys($menu_sensors) as $item)
{ {
echo ('<li><a href="health/metric='.$item.'/"><img src="images/icons/'.$item.'.png" border="0" align="absmiddle" /> '.ucfirst($item).'</a></li>'); echo('<li><a href="health/metric='.$item.'/"><img src="images/icons/'.$item.'.png" border="0" align="absmiddle" /> '.ucfirst($item).'</a></li>');
unset($menu_sensors[$item]);$sep++; unset($menu_sensors[$item]);$sep++;
} }
@ -456,7 +456,6 @@ if ($_SESSION['userlevel'] >= '5' && ($routing_count['bgp']+$routing_count['ospf
<?php <?php
} }
$packages = dbFetchCell("SELECT COUNT(package_id) from `packages`"); $packages = dbFetchCell("SELECT COUNT(package_id) from `packages`");
if ($packages) if ($packages)

View File

@ -10,12 +10,12 @@ echo("<td class=list-bold>");
$vlan_ports = array(); $vlan_ports = array();
$otherports = dbFetchRows("SELECT * FROM `ports_vlans` AS V, `ports` as P WHERE V.`device_id` = ? AND V.`vlan` = ? AND P.interface_id = V.interface_id", array($device['device_id'], $vlan['vlan_vlan'])); $otherports = dbFetchRows("SELECT * FROM `ports_vlans` AS V, `ports` as P WHERE V.`device_id` = ? AND V.`vlan` = ? AND P.interface_id = V.interface_id", array($device['device_id'], $vlan['vlan_vlan']));
foreach($otherports as $otherport) foreach ($otherports as $otherport)
{ {
$vlan_ports[$otherport[ifIndex]] = $otherport; $vlan_ports[$otherport[ifIndex]] = $otherport;
} }
$otherports = dbFetchRows("SELECT * FROM ports WHERE `device_id` = ? AND `ifVlan` = ?", array($device['device_id'], $vlan['vlan_vlan'])); $otherports = dbFetchRows("SELECT * FROM ports WHERE `device_id` = ? AND `ifVlan` = ?", array($device['device_id'], $vlan['vlan_vlan']));
foreach($otherports as $otherport) foreach ($otherports as $otherport)
{ {
$vlan_ports[$otherport[ifIndex]] = array_merge($otherport, array('untagged' => '1')); $vlan_ports[$otherport[ifIndex]] = array_merge($otherport, array('untagged' => '1'));
} }
@ -42,7 +42,7 @@ foreach ($vlan_ports as $port)
{ {
echo($vlan['port_sep'] . generate_port_link($port, makeshortif($port['label']))); echo($vlan['port_sep'] . generate_port_link($port, makeshortif($port['label'])));
$vlan['port_sep'] = ", "; $vlan['port_sep'] = ", ";
if($port['untagged']) { echo("(U)"); } if ($port['untagged']) { echo("(U)"); }
} }
} }

View File

@ -14,7 +14,7 @@ foreach (dbFetchRows("SELECT * FROM `devices` ORDER BY `hostname`") as $device)
$cache['devices']['hostname'][$device['hostname']] = $device['device_id']; $cache['devices']['hostname'][$device['hostname']] = $device['device_id'];
$cache['devices']['id'][$device['device_id']] = $device; $cache['devices']['id'][$device['device_id']] = $device;
$cache['device_types'][$device['type']]++; $cache['device_types'][$device['type']]++;
} }