mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 00:24:21 +02:00
syntaxer run
git-svn-id: http://www.observium.org/svn/observer/trunk@3117 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -227,7 +227,6 @@ if (device_permitted($vars['device']) || $check_device == $vars['device'])
|
||||
</li>');
|
||||
}
|
||||
|
||||
|
||||
if ($_SESSION['userlevel'] >= "5" && dbFetchCell("SELECT COUNT(*) FROM links AS L, ports AS I WHERE I.device_id = '".$device['device_id']."' AND I.interface_id = L.local_interface_id"))
|
||||
{
|
||||
$discovery_links = TRUE;
|
||||
|
||||
@@ -25,7 +25,7 @@ foreach (dbFetchRows("SELECT * FROM `applications` WHERE `device_id` = ?", array
|
||||
}
|
||||
$link_add = array('app'=>$app['app_type']);
|
||||
$text = ucfirst($app['app_type']);
|
||||
if(!empty($app['app_instance']))
|
||||
if (!empty($app['app_instance']))
|
||||
{
|
||||
$text .= "(".$app['app_instance'].")";
|
||||
$link_add['instance'] = $app['app_id'];
|
||||
|
||||
@@ -6,7 +6,7 @@ $graphs = array('memcached_bits' => 'Traffic',
|
||||
'memcached_commands' => 'Commands',
|
||||
'memcached_data' => 'Data Size',
|
||||
'memcached_items' => 'Items',
|
||||
'memcached_uptime' => 'Uptime',
|
||||
'memcached_uptime' => 'Uptime',
|
||||
'memcached_threads' => 'Threads',
|
||||
|
||||
);
|
||||
|
||||
@@ -19,7 +19,7 @@ $sep = "";
|
||||
|
||||
foreach (dbFetchRows("SELECT * FROM munin_plugins WHERE device_id = ? ORDER BY mplug_category, mplug_type", array($device['device_id'])) as $mplug)
|
||||
{
|
||||
# if(strlen($mplug['mplug_category']) == 0) { $mplug['mplug_category'] = "general"; } else { }
|
||||
# if (strlen($mplug['mplug_category']) == 0) { $mplug['mplug_category'] = "general"; } else { }
|
||||
$graph_enable[$mplug['mplug_category']][$mplug['mplug_type']]['id'] = $mplug['mplug_id'];
|
||||
$graph_enable[$mplug['mplug_category']][$mplug['mplug_type']]['title'] = $mplug['mplug_title'];
|
||||
}
|
||||
@@ -31,7 +31,7 @@ foreach (dbFetchRows("SELECT * FROM device_graphs WHERE device_id = ? ORDER BY g
|
||||
}
|
||||
|
||||
#foreach ($config['graph_sections'] as $section)
|
||||
foreach($graph_enable as $section => $nothing)
|
||||
foreach ($graph_enable as $section => $nothing)
|
||||
{
|
||||
if (isset($graph_enable) && is_array($graph_enable[$section]))
|
||||
{
|
||||
@@ -57,11 +57,11 @@ print_optionbar_end();
|
||||
$graph_enable = $graph_enable[$vars['group']];
|
||||
|
||||
#foreach ($config['graph_types']['device'] as $graph => $entry)
|
||||
foreach($graph_enable as $graph => $entry)
|
||||
foreach ($graph_enable as $graph => $entry)
|
||||
{
|
||||
if ($graph_enable[$graph])
|
||||
{
|
||||
if(is_numeric($entry['id']))
|
||||
if (is_numeric($entry['id']))
|
||||
{
|
||||
$graph_title = $entry['title'];
|
||||
$graph_array['type'] = "munin_graph";
|
||||
@@ -70,6 +70,7 @@ foreach($graph_enable as $graph => $entry)
|
||||
$graph_title = $config['graph_types']['device'][$graph]['descr'];
|
||||
$graph_array['type'] = "device_" . $graph;
|
||||
}
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,9 @@ if ($ports['down']) { $ports_colour = $warn_colour_a; } else { $ports_colour = $
|
||||
echo("<table width=100% cellspacing=0 cellpadding=0><tr><td style='width: 50%; vertical-align: top;>");
|
||||
|
||||
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
|
||||
include("includes/dev-overview-data.inc.php");
|
||||
|
||||
echo("</div>");
|
||||
|
||||
include("overview/ports.inc.php");
|
||||
|
||||
@@ -14,7 +14,7 @@ if (count($sensors))
|
||||
$sensor['sensor_current'] = $memcache->get('sensor-'.$sensor['sensor_id'].'-value');
|
||||
}
|
||||
|
||||
if(empty($sensor['sensor_current']))
|
||||
if (empty($sensor['sensor_current']))
|
||||
{
|
||||
$sensor['sensor_current'] = "NaN";
|
||||
}
|
||||
|
||||
@@ -7,14 +7,13 @@ $port = dbFetchRow("SELECT * FROM `ports` WHERE `interface_id` = ?", array($vars
|
||||
if ($config['memcached']['enable'])
|
||||
{
|
||||
$oids = array('ifInOctets', 'ifOutOctets', 'ifInUcastPkts', 'ifOutUcastPkts', 'ifInErrors', 'ifOutErrors');
|
||||
foreach($oids as $oid)
|
||||
foreach ($oids as $oid)
|
||||
{
|
||||
$port[$oid.'_rate'] = $memcache->get('port-'.$port['interface_id'].'-'.$oid.'_rate');
|
||||
if($debug) { echo("MC[".$oid."->".$port[$oid.'_rate']."]"); }
|
||||
if ($debug) { echo("MC[".$oid."->".$port[$oid.'_rate']."]"); }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$port_details = 1;
|
||||
|
||||
$hostname = $device['hostname'];
|
||||
|
||||
@@ -70,8 +70,7 @@ if ($vars['view'] == 'minigraphs')
|
||||
echo("<div style='display: block; clear: both; margin: auto; min-height: 500px;'>");
|
||||
unset ($seperator);
|
||||
|
||||
## FIX THIS. UGLY.
|
||||
|
||||
## FIXME - FIX THIS. UGLY.
|
||||
foreach (dbFetchRows("select * from ports WHERE device_id = ? ORDER BY ifIndex", array($device['device_id'])) as $port)
|
||||
{
|
||||
echo("<div style='display: block; padding: 3px; margin: 3px; min-width: 183px; max-width:183px; min-height:90px; max-height:90px; text-align: center; float: left; background-color: #e9e9e9;'>
|
||||
@@ -107,19 +106,18 @@ if ($vars['view'] == 'minigraphs')
|
||||
|
||||
foreach ($ports as $port)
|
||||
{
|
||||
|
||||
if ($config['memcached']['enable'])
|
||||
{
|
||||
$oids = array('ifInOctets', 'ifOutOctets', 'ifInUcastPkts', 'ifOutUcastPkts', 'ifInErrors', 'ifOutErrors');
|
||||
foreach($oids as $oid)
|
||||
{
|
||||
$port[$oid.'_rate'] = $memcache->get('port-'.$port['interface_id'].'-'.$oid.'_rate');
|
||||
if($debug) { echo("MC[".$oid."->".$port[$oid.'_rate']."]"); }
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
$oids = array('ifInOctets', 'ifOutOctets', 'ifInUcastPkts', 'ifOutUcastPkts', 'ifInErrors', 'ifOutErrors');
|
||||
foreach ($oids as $oid)
|
||||
{
|
||||
$port[$oid.'_rate'] = $memcache->get('port-'.$port['interface_id'].'-'.$oid.'_rate');
|
||||
if ($debug) { echo("MC[".$oid."->".$port[$oid.'_rate']."]"); }
|
||||
}
|
||||
}
|
||||
|
||||
include("includes/print-interface.inc.php");
|
||||
|
||||
$i++;
|
||||
}
|
||||
echo("</table></div>");
|
||||
|
||||
@@ -10,7 +10,7 @@ if (!$vars['view']) { $vars['view'] = "basic"; }
|
||||
$sep = "";
|
||||
foreach ($menu_options as $option => $text)
|
||||
{
|
||||
if(empty($vars['view'])) { $vars['view'] = $option; }
|
||||
if (empty($vars['view'])) { $vars['view'] = $option; }
|
||||
echo($sep);
|
||||
if ($vars['view'] == $option) { echo("<span class='pagemenu-selected'>"); }
|
||||
echo(generate_link($text, $vars, array('view'=>$option)));
|
||||
|
||||
@@ -31,9 +31,9 @@ foreach (dbFetchRows($sql, $param) as $sensor)
|
||||
$sensor['sensor_current'] = $memcache->get('sensor-'.$sensor['sensor_id'].'-value');
|
||||
}
|
||||
|
||||
if(empty($sensor['sensor_current']))
|
||||
{
|
||||
$sensor['sensor_current'] = "NaN";
|
||||
if (empty($sensor['sensor_current']))
|
||||
{
|
||||
$sensor['sensor_current'] = "NaN";
|
||||
} else {
|
||||
if ($sensor['sensor_current'] >= $sensor['sensor_limit']) { $alert = '<img src="images/16/flag_red.png" alt="alert" />'; } else { $alert = ""; }
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ foreach (dbFetchRows("SELECT D.device_id AS device_id, `hostname` FROM `ipv4_mac
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td width="200" style="padding: 1px;">Search by
|
||||
<td width="200" style="padding: 1px;">Search by
|
||||
<select name="searchby" id="searchby">
|
||||
<option value="mac" <?php if ($_POST['searchby'] != "ip") { echo("selected"); } ?> >MAC Address</option>
|
||||
<option value="ip" <?php if ($_POST['searchby'] == "ip") { echo("selected"); } ?> >IP Address</option>
|
||||
@@ -70,22 +70,21 @@ foreach (dbFetchRows($query, $param) as $entry)
|
||||
{
|
||||
$error_img = generate_port_link($entry,"<img src='images/16/chart_curve_error.png' alt='Interface Errors' border=0>",errors);
|
||||
} else { $error_img = ""; }
|
||||
|
||||
$arp_host = dbFetchRow("SELECT * FROM ipv4_addresses AS A, ports AS I, devices AS D WHERE A.ipv4_address = ? AND I.interface_id = A.interface_id AND D.device_id = I.device_id", array($entry['ipv4_address']));
|
||||
|
||||
$arp_host = dbFetchRow("SELECT * FROM ipv4_addresses AS A, ports AS I, devices AS D WHERE A.ipv4_address = ? AND I.interface_id = A.interface_id AND D.device_id = I.device_id", array($entry['ipv4_address']));
|
||||
if ($arp_host) { $arp_name = generate_device_link($arp_host); } else { unset($arp_name); }
|
||||
if ($arp_host) { $arp_if = generate_port_link($arp_host); } else { unset($arp_if); }
|
||||
if ($arp_host['device_id'] == $entry['device_id']) { $arp_name = "Localhost"; }
|
||||
if ($arp_host['interface_id'] == $entry['interface_id']) { $arp_if = "Local port"; }
|
||||
|
||||
|
||||
echo('<tr class="search">
|
||||
<td width="160">' . formatMac($entry['mac_address']) . '</td>
|
||||
<td width="140">' . $entry['ipv4_address'] . '</td>
|
||||
<td width="200" class="list-bold">' . generate_device_link($entry) . '</td>
|
||||
<td width="200" class="list-bold">' . generate_device_link($entry) . '</td>
|
||||
<td class="list-bold">' . generate_port_link($entry, makeshortif(fixifname($entry['ifDescr']))) . ' ' . $error_img . '</td>
|
||||
<td width="200">'.$arp_name.'</td>
|
||||
<td width="200">'.$arp_name.'</td>
|
||||
<td class="list-bold">'.$arp_if.'</td>
|
||||
</tr>');
|
||||
</tr>');
|
||||
}
|
||||
|
||||
unset($ignore);
|
||||
|
||||
@@ -14,7 +14,7 @@ if (!$vars['view']) { $vars['view'] = "basic"; }
|
||||
$sep = "";
|
||||
foreach ($menu_options as $option => $text)
|
||||
{
|
||||
if(empty($vars['view'])) { $vars['view'] = $option; }
|
||||
if (empty($vars['view'])) { $vars['view'] = $option; }
|
||||
echo($sep);
|
||||
if ($vars['view'] == $option) { echo("<span class='pagemenu-selected'>"); }
|
||||
echo(generate_link($text, $vars, array('view'=>$option)));
|
||||
|
||||
Reference in New Issue
Block a user