syntaxer run

git-svn-id: http://www.observium.org/svn/observer/trunk@2642 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-10-04 09:10:21 +00:00
parent 9e12148dd3
commit 2dc8b807e9
46 changed files with 94 additions and 95 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ function generate_url($vars, $new_vars = array())
$url = $vars['page']."/";
unset($vars['page']);
foreach($vars as $var => $value)
foreach ($vars as $var => $value)
{
if ($value != "" && strstr($var, "opt") === FALSE)
{
@@ -465,7 +465,7 @@ function foldersize($path)
$files = scandir($path);
$total_files = 0;
foreach($files as $t)
foreach ($files as $t)
{
if (is_dir(rtrim($path, '/') . '/' . $t))
{
@@ -1,21 +1,21 @@
<?php
$nototal = 1;
$nototal = 1;
$ds_in = "msg_recv";
$ds_out = "msg_sent";
$ds_in = "msg_recv";
$ds_out = "msg_sent";
$graph_titel .= "::messages";
$unit_text = "Messages/sec";
$graph_titel .= "::messages";
$unit_text = "Messages/sec";
$colour_line_in = "008800FF";
$colour_line_out = "000088FF";
$colour_area_in = "CEFFCE66";
$colour_area_out = "CECEFF66";
$colour_area_in_max = "CC88CC";
$colour_area_out_max = "FFEFAA";
$colour_line_in = "008800FF";
$colour_line_out = "000088FF";
$colour_area_in = "CEFFCE66";
$colour_area_out = "CECEFF66";
$colour_area_in_max = "CC88CC";
$colour_area_out_max = "FFEFAA";
$mailscanner_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mailscannerV2-" . $app['app_id'] . ".rrd";
$mailscanner_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mailscannerV2-" . $app['app_id'] . ".rrd";
if (is_file($mailscanner_rrd))
{
+1 -1
View File
@@ -2,7 +2,7 @@
## Generate a list of ports and then call the multi_bits grapher to generate from the list
$i=0;
foreach(dbFetchRows("SELECT * FROM `ports` AS I, `devices` AS D WHERE `port_descr_type` = 'cust' AND `port_descr_descr` = ? AND D.device_id = I.device_id", array($id)) as $port)
foreach (dbFetchRows("SELECT * FROM `ports` AS I, `devices` AS D WHERE `port_descr_type` = 'cust' AND `port_descr_descr` = ? AND D.device_id = I.device_id", array($id)) as $port)
{
if (is_file($config['rrd_dir'] . "/" . $port['hostname'] . "/port-" . safename($port['ifIndex'] . ".rrd")))
{
+1 -1
View File
@@ -9,7 +9,7 @@ $rrd_options .= " -u 100 -l 0 -E -b 1024 ";
$iter = "1"; $i=1;
$rrd_options .= " COMMENT:' Min Cur Max\\n'";
foreach(dbFetchRows("SELECT * FROM `mempools` where `device_id` = ?", array($id)) as $mempool)
foreach (dbFetchRows("SELECT * FROM `mempools` where `device_id` = ?", array($id)) as $mempool)
{
# FIXME generic colour function
if ($iter=="1") { $colour="CC0000"; } elseif ($iter=="2") { $colour="008C00"; } elseif ($iter=="3") { $colour="4096EE"; }
@@ -17,7 +17,7 @@ $stats = array('icmpInMsgs' => '00cc00',
$i=0;
foreach($stats as $stat => $colour)
foreach ($stats as $stat => $colour)
{
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
@@ -17,7 +17,7 @@ $stats = array('icmpInSrcQuenchs' => array(),
$i=0;
foreach($stats as $stat => $array)
foreach ($stats as $stat => $array)
{
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
@@ -14,7 +14,7 @@ $stats = array('ipForwDatagrams' => array(),
'ipOutNoRoutes' => array());
$i=0;
foreach($stats as $stat => $array)
foreach ($stats as $stat => $array)
{
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
@@ -14,7 +14,7 @@ $stats = array('snmpInTraps',
'snmpOutSetRequests');
$i=0;
foreach($stats as $stat)
foreach ($stats as $stat)
{
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
@@ -9,7 +9,7 @@ $stats = array('snmpInPkts',
'snmpOutPkts');
$i=0;
foreach($stats as $stat)
foreach ($stats as $stat)
{
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
@@ -8,7 +8,7 @@ $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/netstats-tcp.
$stats = array('tcpInSegs','tcpOutSegs','tcpActiveOpens','tcpPassiveOpens','tcpAttemptFails','tcpEstabResets','tcpRetransSegs');
$i=0;
foreach($stats as $stat)
foreach ($stats as $stat)
{
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
@@ -8,7 +8,7 @@ $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/netstats-udp.
$stats = array('udpInDatagrams','udpOutDatagrams','udpInErrors','udpNoPorts');
$i=0;
foreach($stats as $stat)
foreach ($stats as $stat)
{
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
@@ -31,7 +31,7 @@ if($width > "500")
$rrd_options .= " COMMENT:'".substr(str_pad($unit_text, $descr_len+5),0,$descr_len+5)." RTT Loss SDev RTT\:SDev\l'";
}
foreach($smokeping_files[$direction][$device['hostname']] as $source => $filename)
foreach ($smokeping_files[$direction][$device['hostname']] as $source => $filename)
{
if (!isset($config['graph_colours'][$colourset][$iter])) { $iter = 0; }
@@ -48,7 +48,7 @@ foreach($smokeping_files[$direction][$device['hostname']] as $source => $filenam
# $rrd_options .= " CDEF:dm$i=median$i,0,".$max->{$start}.",LIMIT";
/// start emulate Smokeping::calc_stddev
foreach(range(1, $pings) as $p)
foreach (range(1, $pings) as $p)
{
$rrd_options .= " DEF:pin".$i."p".$p."=".$filename.":ping".$p.":AVERAGE";
$rrd_options .= " CDEF:p".$i."p".$p."=pin".$i."p".$p.",UN,0,pin".$i."p".$p.",IF";
@@ -56,7 +56,7 @@ foreach($smokeping_files[$direction][$device['hostname']] as $source => $filenam
unset($pings_options, $m_options, $sdev_options);
foreach(range(2, $pings) as $p)
foreach (range(2, $pings) as $p)
{
$pings_options .= ",p".$i."p".$p.",UN,+";
$m_options .= ",p".$i."p".$p.",+";
+1 -1
View File
@@ -3,7 +3,7 @@
## Generate a list of ports and then call the multi_bits grapher to generate from the list
$i=0;
foreach(dbFetchRows("SELECT * FROM `ports` WHERE `device_id` = ? AND `pagpGroupIfIndex` = ?", array($port['device_id'], $port['ifIndex'])) as $int)
foreach (dbFetchRows("SELECT * FROM `ports` WHERE `device_id` = ? AND `pagpGroupIfIndex` = ?", array($port['device_id'], $port['ifIndex'])) as $int)
{
if (is_file($config['rrd_dir'] . "/" . $hostname . "/port-" . safename($int['ifIndex'] . ".rrd")))
{
+6 -6
View File
@@ -125,7 +125,7 @@ echo("</td>");
echo("<td width=375 valign=top class=interface-desc>");
if (strpos($port['label'], "oopback") === false && !$graph_type)
{
foreach(dbFetchRows("SELECT * FROM `links` AS L, `ports` AS I, `devices` AS D WHERE L.local_interface_id = ? AND L.remote_interface_id = I.interface_id AND I.device_id = D.device_id", array($if_id)) as $link)
foreach (dbFetchRows("SELECT * FROM `links` AS L, `ports` AS I, `devices` AS D WHERE L.local_interface_id = ? AND L.remote_interface_id = I.interface_id AND I.device_id = D.device_id", array($if_id)) as $link)
{
# echo("<img src='images/16/connect.png' align=absmiddle alt='Directly Connected' /> " . generate_port_link($link, makeshortif($link['label'])) . " on " . generate_device_link($link, shorthost($link['hostname'])) . "</a><br />");
# $br = "<br />";
@@ -145,7 +145,7 @@ if (strpos($port['label'], "oopback") === false && !$graph_type)
AND A.ipv4_network_id = ? AND D.device_id = I.device_id
AND D.device_id != ?";
$array = array($net['ipv4_network_id'], $device['device_id']);
foreach(dbFetchRows($sql, $array) AS $new)
foreach (dbFetchRows($sql, $array) AS $new)
{
echo($new['ipv4_network_id']);
$this_ifid = $new['interface_id'];
@@ -166,7 +166,7 @@ if (strpos($port['label'], "oopback") === false && !$graph_type)
AND D.device_id != ? AND A.ipv6_origin != 'linklayer' AND A.ipv6_origin != 'wellknown'";
$array = array($net['ipv6_network_id'], $device['device_id']);
foreach(dbFetchRows($sql, $array) AS $new)
foreach (dbFetchRows($sql, $array) AS $new)
{
echo($new['ipv6_network_id']);
$this_ifid = $new['interface_id'];
@@ -213,7 +213,7 @@ if ($port_details)
$br = "<br />";
}
foreach(dbFetchRows("SELECT * FROM `ports` WHERE `pagpGroupIfIndex` = ? and `device_id` = ?", array($port['ifIndex'], $device['device_id'])) as $member)
foreach (dbFetchRows("SELECT * FROM `ports` WHERE `pagpGroupIfIndex` = ? and `device_id` = ?", array($port['ifIndex'], $device['device_id'])) as $member)
{
echo("$br<img src='images/16/brick_link.png' align=absmiddle> <strong>" . generate_port_link($member) . " (PAgP)</strong>");
$br = "<br />";
@@ -226,7 +226,7 @@ if ($port_details)
$br = "<br />";
}
foreach(dbFetchRows("SELECT * FROM `ports_stack` WHERE `interface_id_low` = ? and `device_id` = ?", array($port['ifIndex'], $device['device_id'])) as $higher_if)
foreach (dbFetchRows("SELECT * FROM `ports_stack` WHERE `interface_id_low` = ? and `device_id` = ?", array($port['ifIndex'], $device['device_id'])) as $higher_if)
{
if ($higher_if['interface_id_high'])
{
@@ -236,7 +236,7 @@ if ($port_details)
}
}
foreach(dbFetchRows("SELECT * FROM `ports_stack` WHERE `interface_id_high` = ? and `device_id` = ?", array($port['ifIndex'], $device['device_id'])) as $lower_if)
foreach (dbFetchRows("SELECT * FROM `ports_stack` WHERE `interface_id_high` = ? and `device_id` = ?", array($port['ifIndex'], $device['device_id'])) as $lower_if)
{
if ($lower_if['interface_id_low'])
{
+2 -2
View File
@@ -9,13 +9,13 @@ foreach (dbFetchRows("SELECT * FROM `devices` ORDER BY `hostname`") as $device)
$device['real_location'] = $device['location'];
$device['location'] = get_dev_attrib($device,'override_sysLocation_string');
}
$devices['count']++;
$cache['devices']['hostname'][$device['hostname']] = $device['device_id'];
$cache['devices']['id'][$device['device_id']] = $device;
}
if($_SESSION['userlevel'] >= 5)
{
$devices['up'] = dbFetchCell("SELECT COUNT(*) FROM devices WHERE status = '1' AND `ignore` = '0'");