/// -> //

git-svn-id: http://www.observium.org/svn/observer/trunk@3240 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2012-05-25 12:24:34 +00:00
parent cacf913a55
commit b273e04241
247 changed files with 716 additions and 716 deletions
@@ -49,7 +49,7 @@ function adduser($username, $password, $level, $email = "", $realname = "", $can
function user_exists($username)
{
/// FIXME this doesn't seem right? (adama)
// FIXME this doesn't seem right? (adama)
return dbFetchCell("SELECT * FROM `users` WHERE `username` = ?", array($username));
}
+1 -1
View File
@@ -43,7 +43,7 @@ function authenticate($username,$password)
}
else
{
/// FIXME return a warning that LDAP couldn't connect?
// FIXME return a warning that LDAP couldn't connect?
}
return 0;
+1 -1
View File
@@ -502,7 +502,7 @@ function collectd_draw_rrd($host, $plugin, $pinst = null, $type, $tinst = null,
$has_min = true;
}
/// Build legend. This may not work for all RRDs, i don't know :)
// Build legend. This may not work for all RRDs, i don't know :)
if ($has_avg)
$graph[] = "COMMENT: Last";
if ($has_min)
+1 -1
View File
@@ -189,7 +189,7 @@ function generate_graph_popup($graph_array)
{
global $config;
/// Take $graph_array and print day,week,month,year graps in overlib, hovered over graph
// Take $graph_array and print day,week,month,year graps in overlib, hovered over graph
$original_from = $graph_array['from'];
+1 -1
View File
@@ -2972,7 +2972,7 @@ class GeSHi {
* @access private
*/
function indent(&$result) {
/// Replace tabs with the correct number of spaces
// Replace tabs with the correct number of spaces
if (false !== strpos($result, "\t")) {
$lines = explode("\n", $result);
$result = null;//Save memory while we process the lines individually
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
/// Authorises bill viewing and sets $ports as reference to mysql query containing ports for this bill
// Authorises bill viewing and sets $ports as reference to mysql query containing ports for this bill
include("../includes/billing.php");
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
/// Generate a list of ports and then call the multi_bits grapher to generate from the list
// Generate a list of ports and then call the multi_bits grapher to generate from the list
$i = 0;
@@ -1,6 +1,6 @@
<?php
/// Cycle through dot3stats OIDs and build list of RRAs to pass to multi simplex grapher
// Cycle through dot3stats OIDs and build list of RRAs to pass to multi simplex grapher
$oids = array('drop', 'punt', 'hostpunt');
$i = 0;
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
/// FIXME - wtfbbq
// FIXME - wtfbbq
if ($_SESSION['userlevel'] >= "5" || $auth)
{
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
/// Generate a list of ports and then call the multi_bits grapher to generate from the list
// 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($vars['id'])) as $port)
{
+2 -2
View File
@@ -1,6 +1,6 @@
<?php
/// Generate a list of ports and then call the multi_bits grapher to generate from the list
// Generate a list of ports and then call the multi_bits grapher to generate from the list
$ds_in = "INOCTETS";
$ds_out = "OUTOCTETS";
@@ -32,7 +32,7 @@ foreach (dbFetchRows("SELECT * FROM `ports` WHERE `device_id` = ?", array($devic
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/port-" . safename($port['ifIndex'] . ".rrd");
if ($ignore != 1 && is_file($rrd_filename))
{
$port = ifLabel($port); /// Fix Labels! ARGH. This needs to be in the bloody database!
$port = ifLabel($port); // Fix Labels! ARGH. This needs to be in the bloody database!
$rrd_filenames[] = $rrd_filename;
$rrd_list[$i]['filename'] = $rrd_filename;
+1 -1
View File
@@ -10,7 +10,7 @@ $rrd_options .= " COMMENT:'".str_pad($unit_long,$descr_len)." Cur Min
foreach (dbFetchRows("SELECT * FROM `sensors` WHERE `sensor_class` = ? AND `device_id` = ? ORDER BY `sensor_index`", array($class, $device['device_id'])) as $sensor)
{
/// FIXME generic colour function
// FIXME generic colour function
switch ($iter)
{
case "1":
+1 -1
View File
@@ -2,7 +2,7 @@
include("includes/graphs/common.inc.php");
/// FIXME - THIS IS BROKEN
// FIXME - THIS IS BROKEN
$sla = dbFetchRow("SELECT * FROM `slas` WHERE `sla_id` = ?", array($vars['id']));
$device = device_by_id_cache($sla['device_id']);
@@ -1,8 +1,8 @@
<?php
/// Dear Tobias. You write in Perl, this makes me hate you forever.
/// This is my translation of Smokeping's graphing.
/// Thanks to Bill Fenner for Perl->Human translation:>
// Dear Tobias. You write in Perl, this makes me hate you forever.
// This is my translation of Smokeping's graphing.
// Thanks to Bill Fenner for Perl->Human translation:>
$scale_min = 0;
$scale_rigid = TRUE;
@@ -45,7 +45,7 @@ foreach ($smokeping_files[$direction][$device['hostname']] as $source => $filena
$rrd_options .= " CDEF:dm$i=median$i";
# $rrd_options .= " CDEF:dm$i=median$i,0,".$max->{$start}.",LIMIT";
/// start emulate Smokeping::calc_stddev
// start emulate Smokeping::calc_stddev
foreach (range(1, $pings) as $p)
{
$rrd_options .= " DEF:pin".$i."p".$p."=".$filename.":ping".$p.":AVERAGE";
@@ -1,8 +1,8 @@
<?php
/// Dear Tobias. You write in Perl, this makes me hate you forever.
/// This is my translation of Smokeping's graphing.
/// Thanks to Bill Fenner for Perl->Human translation:>
// Dear Tobias. You write in Perl, this makes me hate you forever.
// This is my translation of Smokeping's graphing.
// Thanks to Bill Fenner for Perl->Human translation:>
$scale_min = 0;
$scale_rigid = TRUE;
@@ -22,7 +22,7 @@ if($width > "500")
$descr_len = 12 + round(($width - 275) / 8);
}
/// FIXME str_pad really needs a "limit to length" so we can rid of all the substrs all over the code to limit the length as below...
// FIXME str_pad really needs a "limit to length" so we can rid of all the substrs all over the code to limit the length as below...
if($width > "500")
{
$rrd_options .= " COMMENT:'".substr(str_pad($unit_text, $descr_len+5),0,$descr_len+5)." RTT Loss SDev RTT\:SDev\l'";
@@ -47,7 +47,7 @@ foreach ($smokeping_files[$direction][$device['hostname']] as $source => $filena
# $rrd_options .= " CDEF:dm$i=median$i";
# $rrd_options .= " CDEF:dm$i=median$i,0,".$max->{$start}.",LIMIT";
/// start emulate Smokeping::calc_stddev
// start emulate Smokeping::calc_stddev
foreach (range(1, $pings) as $p)
{
$rrd_options .= " DEF:pin".$i."p".$p."=".$filename.":ping".$p.":AVERAGE";
+1 -1
View File
@@ -10,7 +10,7 @@ $rrd_options .= " COMMENT:' Size Used %age\\l'";
foreach (dbFetchRows("SELECT * FROM storage where device_id = ?", array($device['device_id'])) as $storage)
{
/// FIXME generic colour function
// FIXME generic colour function
if ($iter=="1") { $colour="CC0000"; } elseif ($iter=="2") { $colour="008C00"; } elseif ($iter=="3") { $colour="4096EE"; }
elseif ($iter=="4") { $colour="73880A"; } elseif ($iter=="5") { $colour="D01F3C"; } elseif ($iter=="6") { $colour="36393D"; }
elseif ($iter=="7") { $colour="FF0084"; $iter = "0"; }
+1 -1
View File
@@ -12,7 +12,7 @@ foreach (dbFetchRows("SELECT * FROM toner where device_id = ?", array($device['d
if ($colour['left'] == NULL)
{
/// FIXME generic colour function
// FIXME generic colour function
switch ($iter)
{
case "1":
+2 -2
View File
@@ -1,7 +1,7 @@
<?php
/// Draw generic bits graph
/// args: ds_in, ds_out, rrd_filename, bg, legend, from, to, width, height, inverse, previous
// Draw generic bits graph
// args: ds_in, ds_out, rrd_filename, bg, legend, from, to, width, height, inverse, previous
include("includes/graphs/common.inc.php");
+2 -2
View File
@@ -1,7 +1,7 @@
<?php
/// Draw generic bits graph
/// args: ds_in, ds_out, rrd_filename, bg, legend, from, to, width, height, inverse, $percentile
// Draw generic bits graph
// args: ds_in, ds_out, rrd_filename, bg, legend, from, to, width, height, inverse, $percentile
include("includes/graphs/common.inc.php");
@@ -1,7 +1,7 @@
<?php
/// Draws aggregate bits graph from multiple RRDs
/// Variables : colour_[line|area]_[in|out], rrd_filenames
// Draws aggregate bits graph from multiple RRDs
// Variables : colour_[line|area]_[in|out], rrd_filenames
include("includes/graphs/common.inc.php");
@@ -39,7 +39,7 @@ foreach ($rrd_list as $rrd)
$descr = rrdtool_escape($rrd['descr'], $descr_len) . " In";
}
$descr_out = rrdtool_escape($rrd['descr_out'], $descr_len) . " Out";
$descr = str_replace("'", "", $descr); /// FIXME does this mean ' should be filtered in rrdtool_escape? probably...
$descr = str_replace("'", "", $descr); // FIXME does this mean ' should be filtered in rrdtool_escape? probably...
$descr_out = str_replace("'", "", $descr_out);
$rrd_options .= " DEF:".$in.$i."=".$rrd['filename'].":".$ds_in.":AVERAGE ";
@@ -1,7 +1,7 @@
<?php
/// Draws aggregate bits graph from multiple RRDs
/// Variables : colour_[line|area]_[in|out], rrd_filenames
// Draws aggregate bits graph from multiple RRDs
// Variables : colour_[line|area]_[in|out], rrd_filenames
include("includes/graphs/common.inc.php");
@@ -39,7 +39,7 @@ foreach ($rrd_list as $rrd)
$descr = rrdtool_escape($rrd['descr'], $descr_len) . " In";
}
$descr_out = rrdtool_escape($rrd['descr_out'], $descr_len) . " Out";
$descr = str_replace("'", "", $descr); /// FIXME does this mean ' should be filtered in rrdtool_escape? probably...
$descr = str_replace("'", "", $descr); // FIXME does this mean ' should be filtered in rrdtool_escape? probably...
$descr_out = str_replace("'", "", $descr_out);
$rrd_options .= " DEF:".$in.$i."=".$rrd['filename'].":".$ds_in.":AVERAGE ";
@@ -7,7 +7,7 @@ $units_descr = substr(str_pad($units_descr, 18),0,18);
if($format == "octets" || $format == "bytes")
{
$units = "Bps";
$format = "bits"; /// FIXME bits? or bytes?
$format = "bits"; // FIXME bits? or bytes?
} else {
$units = "bps";
$format = "bits";
@@ -4,7 +4,7 @@ include("includes/graphs/common.inc.php");
if($width > "500")
{
$descr_len = 24; /// FIXME may even be more imo?
$descr_len = 24; // FIXME may even be more imo?
} else {
$descr_len = 12;
$descr_len += round(($width - 250) / 8);
@@ -62,13 +62,13 @@ foreach ($rrd_list as $i => $rrd)
$plusX = ",+";
}
/// Suppress totalling?
// Suppress totalling?
if (!$nototal)
{
$rrd_options .= " VDEF:tot".$rrd['ds'].$i."=".$rrd['ds'].$i.",TOTAL";
}
/// This this not the first entry?
// This this not the first entry?
if ($i) { $stack="STACK"; }
# if we've been passed a multiplier we must make a CDEF based on it!
$g_defname = $rrd['ds'];
@@ -79,7 +79,7 @@ foreach ($rrd_list as $i => $rrd)
$rrd_options .= " CDEF:" . $g_defname . $i . "min=" . $rrd['ds'] . $i . "min," . $multiplier . ",*";
$rrd_options .= " CDEF:" . $g_defname . $i . "max=" . $rrd['ds'] . $i . "max," . $multiplier . ",*";
/// If we've been passed a divider (divisor!) we make a CDEF for it.
// If we've been passed a divider (divisor!) we make a CDEF for it.
} elseif (is_numeric($divider))
{
$g_defname = $rrd['ds'] . "_cdef";
@@ -88,7 +88,7 @@ foreach ($rrd_list as $i => $rrd)
$rrd_options .= " CDEF:" . $g_defname . $i . "max=" . $rrd['ds'] . $i . "max," . $divider . ",/";
}
/// Are our text values related to te multiplier/divisor or not?
// Are our text values related to te multiplier/divisor or not?
if (isset($text_orig) && $text_orig)
{
$t_defname = $rrd['ds'];
+2 -2
View File
@@ -5,8 +5,8 @@ if($config['old_graphs'])
include("includes/graphs/old_generic_simplex.inc.php");
} else {
/// Draw generic bits graph
/// args: ds_in, ds_out, rrd_filename, bg, legend, from, to, width, height, inverse, percentile
// Draw generic bits graph
// args: ds_in, ds_out, rrd_filename, bg, legend, from, to, width, height, inverse, percentile
include("includes/graphs/common.inc.php");
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
/// Generate a list of ports and then call the multi_bits grapher to generate from the list
// Generate a list of ports and then call the multi_bits grapher to generate from the list
$i=0;
+4 -4
View File
@@ -16,7 +16,7 @@ if(is_numeric($vars['device']))
$device = device_by_name($vars['device']);
}
/// FIXME -- remove these
// FIXME -- remove these
$width = $vars['width'];
$height = $vars['height'];
@@ -43,7 +43,7 @@ if (is_file($config['install_dir'] . "/html/includes/graphs/$type/$subtype.inc.p
if (isset($config['allow_unauth_graphs']) && $config['allow_unauth_graphs'])
{
$auth = "1"; /// hardcode auth for all with config function
$auth = "1"; // hardcode auth for all with config function
}
if (isset($config['allow_unauth_graphs_cidr']) && count($config['allow_unauth_graphs_cidr']) > 0)
@@ -109,12 +109,12 @@ function graph_error($string)
if ($error_msg) {
/// We have an error :(
// We have an error :(
graph_error($graph_error);
} elseif (!$auth) {
/// We are unauthenticated :(
// We are unauthenticated :(
if ($width < 200)
{
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
/// Generate a list of ports and then call the multi_bits grapher to generate from the list
// Generate a list of ports and then call the multi_bits grapher to generate from the list
$ds_in = "INOCTETS";
$ds_out = "OUTOCTETS";
@@ -1,7 +1,7 @@
<?php
/// Draw generic bits graph
/// args: ds_in, ds_out, rrd_filename, bg, legend, from, to, width, height, inverse, percentile
// Draw generic bits graph
// args: ds_in, ds_out, rrd_filename, bg, legend, from, to, width, height, inverse, percentile
include("includes/graphs/common.inc.php");
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
/// Cycle through dot3stats OIDs and build list of RRAs to pass to multi simplex grapher
// Cycle through dot3stats OIDs and build list of RRAs to pass to multi simplex grapher
$oids = array('dot3StatsAlignmentErrors', 'dot3StatsFCSErrors', 'dot3StatsSingleCollisionFrames', 'dot3StatsMultipleCollisionFrames',
'dot3StatsSQETestErrors', 'dot3StatsDeferredTransmissions', 'dot3StatsLateCollisions', 'dot3StatsExcessiveCollisions',
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
/// FIXME uhh..
// FIXME uhh..
if (1)
{
# $rrd_list[1]['filename'] = $config['rrd_dir'] . "/" . $device['hostname'] . "/port-" . safename($port['ifIndex'] . ".rrd");
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
/// Generate a list of ports and then call the multi_bits grapher to generate from the list
// 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)
@@ -1,6 +1,6 @@
<?php
/// Generate a list of ports and then call the multi_bits grapher to generate from the list
// Generate a list of ports and then call the multi_bits grapher to generate from the list
$device = device_by_id_cache($id);
+1 -1
View File
@@ -8,7 +8,7 @@ if (is_numeric($vars['id']))
{
$device = device_by_id_cache($sensor['device_id']);
/// This doesn't quite work for all yet.
// This doesn't quite work for all yet.
#$rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename($sensor['sensor_class']."-" . $sensor['sensor_type'] . "-".$sensor['sensor_index'].".rrd");
$rrd_filename = get_sensor_rrd($device, $sensor);
+1 -1
View File
@@ -8,7 +8,7 @@ if (is_numeric($vars['id']))
{
$device = device_by_id_cache($service['device_id']);
/// This doesn't quite work for all yet.
// This doesn't quite work for all yet.
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("service-" . $service['service_type'] . "-" . $service['service_id'] . ".rrd");
$title = generate_device_link($device);
+4 -4
View File
@@ -2,9 +2,9 @@
$src = device_by_id_cache($_GET['src']);
/// Dear Tobias. You write in Perl, this makes me hate you forever.
/// This is my translation of Smokeping's graphing.
/// Thanks to Bill Fenner for Perl->Human translation:>
// Dear Tobias. You write in Perl, this makes me hate you forever.
// This is my translation of Smokeping's graphing.
// Thanks to Bill Fenner for Perl->Human translation:>
$scale_min = 0;
$scale_rigid = TRUE;
@@ -60,7 +60,7 @@ if($src['hostname'] == $config['own_hostname'])
$rrd_options .= " CDEF:dm$i=median$i";
# $rrd_options .= " CDEF:dm$i=median$i,0,".$max->{$start}.",LIMIT";
/// start emulate Smokeping::calc_stddev
// start emulate Smokeping::calc_stddev
foreach (range(1, $pings) as $p)
{
$rrd_options .= " DEF:pin".$i."p".$p."=".$filename.":ping".$p.":AVERAGE";
+4 -4
View File
@@ -2,9 +2,9 @@
$dest = device_by_id_cache($_GET['dest']);
/// Dear Tobias. You write in Perl, this makes me hate you forever.
/// This is my translation of Smokeping's graphing.
/// Thanks to Bill Fenner for Perl->Human translation:>
// Dear Tobias. You write in Perl, this makes me hate you forever.
// This is my translation of Smokeping's graphing.
// Thanks to Bill Fenner for Perl->Human translation:>
$scale_min = 0;
$scale_rigid = TRUE;
@@ -60,7 +60,7 @@ if($device['hostname'] == $config['own_hostname'])
$rrd_options .= " CDEF:dm$i=median$i";
# $rrd_options .= " CDEF:dm$i=median$i,0,".$max->{$start}.",LIMIT";
/// start emulate Smokeping::calc_stddev
// start emulate Smokeping::calc_stddev
foreach (range(1, $pings) as $p)
{
$rrd_options .= " DEF:pin".$i."p".$p."=".$filename.":ping".$p.":AVERAGE";
+1 -1
View File
@@ -54,5 +54,5 @@ if (isset($_SESSION['authenticated']) && $_SESSION['authenticated'])
</div>
</div>
<!-- ///// end of gumax-header ///// -->
<!-- //// end of gumax-header //// -->
+1 -1
View File
@@ -3,7 +3,7 @@
if(empty($graph_array['type'])) { $graph_array['type'] = $graph_type; }
if(empty($graph_array['device'])) { $graph_array['device'] = $device['device_id']; }
/// FIXME not css alternating yet
// FIXME not css alternating yet
if (!is_integer($g_i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
echo('<div style="background-color: '.$row_colour.';">');
+1 -1
View File
@@ -144,7 +144,7 @@ if (strpos($port['label'], "oopback") === false && !$graph_type)
unset($br);
if ($port_details)
{ /// Show which other devices are on the same subnet as this interface
{ // Show which other devices are on the same subnet as this interface
foreach (dbFetchRows("SELECT `ipv4_network_id` FROM `ipv4_addresses` WHERE `port_id` = ? AND `ipv4_address` NOT LIKE '127.%'", array($port['port_id'])) as $net)
{
$ipv4_network_id = $net['ipv4_network_id'];
+5 -5
View File
@@ -1,6 +1,6 @@
<?php
/// FIXME - this could do with some performance improvements, i think. possible rearranging some tables and setting flags at poller time (nothing changes outside of then anyways)
// FIXME - this could do with some performance improvements, i think. possible rearranging some tables and setting flags at poller time (nothing changes outside of then anyways)
$service_alerts = dbFetchCell("SELECT COUNT(service_id) FROM services WHERE service_status = '0'");
$if_alerts = dbFetchCell("SELECT COUNT(port_id) FROM `ports` WHERE `ifOperStatus` = 'down' AND `ifAdminStatus` = 'up' AND `ignore` = '0'");
@@ -320,7 +320,7 @@ $(document).ready(function() {
<?php
/// FIXME does not check user permissions...
// FIXME does not check user permissions...
foreach (dbFetchRows("SELECT sensor_class,COUNT(sensor_id) AS c FROM sensors GROUP BY sensor_class ORDER BY sensor_class ") as $row)
{
$used_sensors[$row['sensor_class']] = $row['c'];
@@ -458,7 +458,7 @@ if ($_SESSION['userlevel'] >= '5' && ($routing_count['bgp']+$routing_count['ospf
$separator++;
}
/// BGP Sessions
// BGP Sessions
if ($_SESSION['userlevel'] >= '5' && $routing_count['bgp'])
{
if ($separator)
@@ -474,7 +474,7 @@ if ($_SESSION['userlevel'] >= '5' && ($routing_count['bgp']+$routing_count['ospf
<li><a href="routing/protocol=bgp/type=internal/graph=NULL/"><img src="images/16/brick_link.png" border="0" align="absmiddle" /> BGP Internal</a></li>');
}
/// Do Alerts at the bottom
// Do Alerts at the bottom
if ($bgp_alerts)
{
echo('
@@ -511,7 +511,7 @@ if ($packages)
<?php
} # if ($packages)
/// Custom menubar entries.
// Custom menubar entries.
if(is_file("includes/print-menubar-custom.inc.php"))
{
include("includes/print-menubar-custom.inc.php");
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
/// FIXME queries such as the one below should probably go into index.php?
// FIXME queries such as the one below should probably go into index.php?
foreach (dbFetchRows("SELECT * FROM `devices` ORDER BY `hostname`") as $device)
{