From d864ce234fe9974b8d7acb00cc28d13b87a03d31 Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Tue, 20 Sep 2011 09:55:11 +0000 Subject: [PATCH] kill a whole bunch of trailing spaces git-svn-id: http://www.observium.org/svn/observer/trunk@2516 61d68cd4-352d-0410-923a-c4978735b2b8 --- addhost.php | 2 +- check-services.php | 4 +- html/billing-graph.php | 4 +- html/graph-realtime.php | 10 ++-- html/includes/authentication/mysql.inc.php | 2 +- html/includes/collectd/definitions.php | 12 ++--- html/includes/functions.inc.php | 6 +-- html/includes/geshi/docs/geshi-doc.html.gz | Bin 79021 -> 79011 bytes html/includes/geshi/docs/geshi-doc.txt.gz | Bin 35832 -> 35829 bytes html/includes/geshi/geshi/ios.php | 8 +-- .../application/apache_scoreboard.inc.php | 2 +- .../application/mysql_network_traffic.inc.php | 2 +- html/includes/graphs/common.inc.php | 2 +- .../graphs/device/netstat_icmp.inc.php | 2 +- .../graphs/device/nfsen_common.inc.php | 4 +- .../graphs/device/screenos_sessions.inc.php | 2 +- html/includes/graphs/device/ucd_io.inc.php | 2 +- .../graphs/device/ucd_swap_io.inc.php | 2 +- .../generic_multi_simplex_seperated.inc.php | 2 +- html/includes/graphs/graph.inc.php | 10 ++-- .../graphs/macaccounting/auth.inc.php | 4 +- .../graphs/multiport/bits_separate.inc.php | 2 +- html/includes/graphs/port/nupkts.inc.php | 2 +- .../graphs/sensor/temperature.inc.php | 2 +- html/includes/graphs/storage/usage.inc.php | 2 +- html/includes/hostbox-basic.inc.php | 14 +++--- html/includes/hostbox.inc.php | 14 +++--- html/includes/print-interface.inc.php | 8 +-- html/includes/print-menubar.php | 32 ++++++------ html/includes/service-delete.inc.php | 2 +- html/index.php | 18 +++---- html/pages/about.inc.php | 2 +- html/pages/adduser.inc.php | 4 +- html/pages/bill.inc.php | 2 +- html/pages/bill/actions.inc.php | 10 ++-- html/pages/device.inc.php | 6 +-- html/pages/device/edit/apps.inc.php | 5 -- html/pages/device/edit/modules.inc.php | 4 +- html/pages/device/edit/snmp.inc.php | 2 +- html/pages/device/graphs.inc.php | 6 +-- html/pages/device/health/diskio.inc.php | 2 +- html/pages/device/nfsen.inc.php | 2 +- html/pages/device/port/realtime.inc.php | 2 +- html/pages/device/ports/neighbours.inc.php | 2 +- html/pages/device/routing/cef.inc.php | 2 +- html/pages/device/showconfig.inc.php | 26 +++++----- html/pages/device/vlans.inc.php | 2 +- html/pages/devices.inc.php | 6 +-- html/pages/front/default.php | 2 +- html/pages/front/demo.php | 10 ++-- html/pages/front/example2.php | 2 +- html/pages/front/jt.php | 4 +- html/pages/front/traffic.php | 4 +- html/pages/graphs.inc.php | 4 +- html/pages/health.inc.php | 10 ++-- html/pages/iftype.inc.php | 2 +- html/pages/inventory.inc.php | 2 +- html/pages/ports.inc.php | 6 +-- html/pages/pseudowires.inc.php | 2 +- html/pages/routing/bgp.inc.php | 2 +- html/pages/routing/overview.inc.php | 2 +- html/pages/routing/vrf.inc.php | 4 +- html/pages/search/mac.inc.php | 14 +++--- html/pages/services.inc.php | 4 +- includes/billing.php | 2 +- includes/common.php | 4 +- includes/console_colour.php | 46 +++++++++--------- includes/dbFacile.php | 10 ++-- includes/defaults.inc.php | 34 ++++++------- includes/discovery/cisco-cef.inc.php | 6 +-- includes/discovery/functions.inc.php | 6 +-- includes/discovery/humidity/netbotz.inc.php | 2 +- includes/discovery/libvirt-vminfo.inc.php | 6 +-- .../discovery/temperatures/netbotz.inc.php | 2 +- includes/polling/cipsec-tunnels.inc.php | 2 +- includes/polling/cisco-cef.inc.php | 2 +- includes/polling/functions.inc.php | 10 ++-- includes/polling/ipmi.inc.php | 2 +- includes/polling/junose-atm-vp.inc.php | 2 +- includes/polling/os/sentry3.inc.php | 2 +- includes/polling/ports.inc.php | 2 +- includes/polling/toner.inc.php | 2 +- includes/polling/wifi.inc.php | 2 +- includes/rewrites.php | 4 +- includes/rrdtool.inc.php | 2 +- includes/services.inc.php | 4 +- includes/services/dns/check.inc | 8 +-- includes/services/ftp/check.inc | 8 +-- includes/services/http/check.inc | 8 +-- includes/services/imap/check.inc | 8 +-- includes/services/mysql/check.inc | 8 +-- includes/services/pop/check.inc | 8 +-- includes/services/simap/check.inc | 8 +-- includes/services/smtp/check.inc | 8 +-- includes/services/spop/check.inc | 8 +-- includes/services/ssh/check.inc | 8 +-- includes/services/telnet/check.inc | 8 +-- includes/syslog.php | 8 +-- irc.php | 8 +-- poll-billing.php | 4 +- poller.php | 10 ++-- upgrade-scripts/fix-port-rrd.php | 30 ++++++------ upgrade-scripts/fix-sensor-rrd.php | 18 +++---- 103 files changed, 326 insertions(+), 331 deletions(-) diff --git a/addhost.php b/addhost.php index 8afe81619..8b0583522 100755 --- a/addhost.php +++ b/addhost.php @@ -53,7 +53,7 @@ if (isset($argv[1]) && $argv[1]) echo("Added device ".$device['hostname']." (".$device['device_id'].")\n"); } -} else { +} else { print Console_Color::convert(" Observium v".$config['version']." Add Host Tool diff --git a/check-services.php b/check-services.php index 3172c170b..b9e619ac6 100755 --- a/check-services.php +++ b/check-services.php @@ -29,7 +29,7 @@ foreach (dbFetchRows("SELECT * FROM `devices` AS D, `services` AS S WHERE S.devi if ($service_status != $status) { $update['service_changed'] = time(); - + if ($service['sysContact']) { $email = $service['sysContact']; } else { $email = $config['email_default']; } if ($status == "1") { @@ -47,7 +47,7 @@ foreach (dbFetchRows("SELECT * FROM `devices` AS D, `services` AS S WHERE S.devi $update = array_merge(array('service_status' => $status, 'service_message' => $check, 'service_checked' => time()), $update); dbUpdate($update, 'services', '`service_id` = ?', array($service['service_id'])); - unset($update); + unset($update); } else { $status = "0"; diff --git a/html/billing-graph.php b/html/billing-graph.php index 5a1f93e8e..12b6776d8 100755 --- a/html/billing-graph.php +++ b/html/billing-graph.php @@ -152,7 +152,7 @@ $graph->xaxis->SetTitleMargin(30); $graph->xaxis->title->Set($type); $graph->yaxis->title->Set($yaxis); -function TimeCallback($aVal) { +function TimeCallback($aVal) { global $dur; if ($dur < 172800) @@ -161,7 +161,7 @@ function TimeCallback($aVal) { } elseif ($dur < 604800) { return Date('D',$aVal); } else { - return Date('j M',$aVal); + return Date('j M',$aVal); } } diff --git a/html/graph-realtime.php b/html/graph-realtime.php index e120d1990..7dc052d1f 100755 --- a/html/graph-realtime.php +++ b/html/graph-realtime.php @@ -1,11 +1,11 @@ , Manuel Kasper and Jonathan Watt . All rights reserved. - + */ include_once("../includes/defaults.inc.php"); @@ -184,7 +184,7 @@ function fetch_data() { function plot_data(obj) { // Show datetimelegend var now = new Date(); - var datetime = (now.getMonth()+1) + "/" + now.getDate() + "/" + now.getFullYear() + ' ' + + var datetime = (now.getMonth()+1) + "/" + now.getDate() + "/" + now.getFullYear() + ' ' + LZ(now.getHours()) + ":" + LZ(now.getMinutes()) + ":" + LZ(now.getSeconds()); SVGDoc.getElementById('datetime').firstChild.data = datetime; @@ -210,7 +210,7 @@ function plot_data(obj) { last_ugmt = ugmt; last_ifin = ifin; last_ifout = ifout; - + switch (plot_in.length) { case 0: SVGDoc.getElementById("collect_initial").setAttributeNS(null, 'visibility', 'visible'); @@ -283,7 +283,7 @@ function plot_data(obj) { rmax *= 1.25; else rmax *= 2; - + if (i == 8) rmax *= 1.024; } diff --git a/html/includes/authentication/mysql.inc.php b/html/includes/authentication/mysql.inc.php index 7f39ec19b..3ea373e23 100644 --- a/html/includes/authentication/mysql.inc.php +++ b/html/includes/authentication/mysql.inc.php @@ -30,7 +30,7 @@ function passwordscanchange($username="") * By default allow the password to be modified, unless the existing * user is explicitly prohibited to do so. */ - + if (empty($username) || !user_exists($username)) { return 1; diff --git a/html/includes/collectd/definitions.php b/html/includes/collectd/definitions.php index de188ee6b..a3a227775 100644 --- a/html/includes/collectd/definitions.php +++ b/html/includes/collectd/definitions.php @@ -505,7 +505,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) { 'GPRINT:temp_max:MAX:%4.1lf%%', 'GPRINT:temp_avg:LAST:%4.1lf%%\l'); $GraphDefs['if_errors'] = array( - #'-v', 'Errors/s', + #'-v', 'Errors/s', '--units=si', 'DEF:tx_min={file}:tx:MIN', 'DEF:tx_avg={file}:tx:AVERAGE', @@ -551,7 +551,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) { 'GPRINT:max:MAX:%5.1lf%s', 'GPRINT:avg:LAST:%5.1lf%s\l'); $GraphDefs['if_dropped'] = array( - #'-v', 'Packets/s', + #'-v', 'Packets/s', '--units=si', 'DEF:tx_min={file}:tx:MIN', 'DEF:tx_avg={file}:tx:AVERAGE', @@ -734,7 +734,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) { 'GPRINT:spam:LAST:%4.1lf', 'HRULE:0#000000'); $GraphDefs['memory'] = array( - '-b', '1024', + '-b', '1024', #'-v', 'Bytes', 'DEF:avg={file}:value:AVERAGE', 'DEF:min={file}:value:MIN', @@ -1290,7 +1290,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) { 'GPRINT:max:MAX:%9.3lf', 'GPRINT:avg:LAST:%9.3lf\l'); $GraphDefs['swap'] = array( - #'-v', 'Bytes', + #'-v', 'Bytes', '-b', '1024', 'DEF:avg={file}:value:AVERAGE', 'DEF:min={file}:value:MIN', @@ -1396,7 +1396,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) { 'GPRINT:s_max:MAX:%5.2lf%s', 'GPRINT:s_avg:LAST:%5.2lf%s'); $GraphDefs['if_octets'] = array( - #'-v', 'Bits/s', + #'-v', 'Bits/s', '--units=si', 'DEF:out_min_raw={file}:tx:MIN', 'DEF:out_avg_raw={file}:tx:AVERAGE', @@ -1755,7 +1755,7 @@ function meta_graph_memory($host, $plugin, $plugin_instance, $type, $type_instan $opts['title'] = $title; $opts['number_format'] = '%5.1lf%s'; $opts['rrd_opts'] = array('-b', '1024', 'COMMENT:Bytes Cur Min Ave Max\l'); - + # BYTES diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index 2f9454567..3b781c394 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -39,7 +39,7 @@ function rrdtool_graph($graph_file, $options) // proc_close in order to avoid a deadlock $return_value = proc_close($process); - if($debug) + if($debug) { echo("

"); if($debug) { echo("graph $graph_file $options"); } @@ -415,7 +415,7 @@ function generate_port_thumbnail($args) function print_optionbar_start ($height = 0, $width = 0, $marginbottom = 5) { echo(" -

"); } @@ -443,7 +443,7 @@ function overlibprint($text) function humanmedia($media) { - array_preg_replace($rewrite_iftype, $media); + array_preg_replace($rewrite_iftype, $media); return $media; } diff --git a/html/includes/geshi/docs/geshi-doc.html.gz b/html/includes/geshi/docs/geshi-doc.html.gz index f779cd1e99a9d6dfbc99b5182ca89e5fcb855760..12413168a4c130e768e91d9b2bccba8e85603277 100644 GIT binary patch delta 49 zcmV-10M7rd=>((c1hDNPv+f}>7PBEZ2?Db#I%g-7lVR+$fMVqXvu0)l3bSi)M3J|! H0Rj6mBL)>F delta 68 zcmZ4dl4b2nmJM$e8F@FqRWuS~WY{ck!O6tPy;;L5U7eA0a)06*pjdU%Q)Zx8LK+Jf Vke5>6GLcbX`wB+J-$qQF3;-U^6=47X diff --git a/html/includes/geshi/docs/geshi-doc.txt.gz b/html/includes/geshi/docs/geshi-doc.txt.gz index 0eb5675e85d1444ef382fda75b3c7d11a1f2e726..8b95874d81679702422d59c887978bcaff6fc356 100644 GIT binary patch delta 18 acmew{o$2dzrVUqeH($-&DLc8pI|Be>N(u1* delta 24 gcmex5o$1GPrVUqe85K5P$=xZ-$UC{WJA;t{0FoOD9smFU diff --git a/html/includes/geshi/geshi/ios.php b/html/includes/geshi/geshi/ios.php index 6e809e26f..dc6ccc508 100755 --- a/html/includes/geshi/geshi/ios.php +++ b/html/includes/geshi/geshi/ios.php @@ -9,7 +9,7 @@ $language_data = array ( 'OOLANG' => false, 'NUMBERS' => GESHI_NUMBER_OCT_PREFIX | GESHI_NUMBER_HEX_PREFIX, 'KEYWORDS' => array( - 1 => array( + 1 => array( 'no', 'shutdown' ), # 2 => array( @@ -32,7 +32,7 @@ $language_data = array ( # 'isis', 'ospf', 'eigrp', 'rip', 'igrp', 'bgp', 'ipv4', 'unicast', 'multicast', 'ipv6', 'connected', 'static', 'subnets', 'tcl' # ), # 4 => array( -# 'point-to-point', 'aal5snap', 'rj45', 'auto', 'full', 'half', 'precedence', 'percent', 'datetime', 'msec', 'locatime', 'summer-time', 'md5', 'wait-for-bgp', 'wide', +# 'point-to-point', 'aal5snap', 'rj45', 'auto', 'full', 'half', 'precedence', 'percent', 'datetime', 'msec', 'locatime', 'summer-time', 'md5', 'wait-for-bgp', 'wide', # 'level-1', 'level-2', 'log-neighbor-changes', 'directed-request', 'password-encryption', 'common', 'origin-as', 'bgp-nexthop', 'random-detect', 'localtime', 'sso', 'stm-1', # 'dot1q', 'isl', 'new-model', 'always', 'summary-only', 'freeze', 'global', 'forwarded', 'access', 'trunk', 'edge', 'transparent' # ), @@ -108,7 +108,7 @@ $language_data = array ( GESHI_REPLACE => '\\2', GESHI_BEFORE => '\\1 ' ), - + ), 'STYLES' => array( @@ -163,7 +163,7 @@ $language_data = array ( 2 => '', 3 => '' ) - + ) diff --git a/html/includes/graphs/application/apache_scoreboard.inc.php b/html/includes/graphs/application/apache_scoreboard.inc.php index 7d9d51650..ebabfba98 100755 --- a/html/includes/graphs/application/apache_scoreboard.inc.php +++ b/html/includes/graphs/application/apache_scoreboard.inc.php @@ -61,6 +61,6 @@ $rrd_options .= 'GPRINT:i:MAX:"%6.2lf %s\n" '; $rrd_options .= 'AREA:j#FF4105FF:"Idle ":STACK '; $rrd_options .= 'GPRINT:j:LAST:"%6.2lf %s" '; $rrd_options .= 'GPRINT:j:AVERAGE:"%6.2lf %s" '; -$rrd_options .= 'GPRINT:j:MAX:"%6.2lf %s\n"'; +$rrd_options .= 'GPRINT:j:MAX:"%6.2lf %s\n"'; ?> diff --git a/html/includes/graphs/application/mysql_network_traffic.inc.php b/html/includes/graphs/application/mysql_network_traffic.inc.php index 00c4440be..08835450d 100644 --- a/html/includes/graphs/application/mysql_network_traffic.inc.php +++ b/html/includes/graphs/application/mysql_network_traffic.inc.php @@ -9,7 +9,7 @@ if (is_file($mysql_rrd)) $rrd_filename = $mysql_rrd; } -$rrd_options .= ' -b 1024 '; +$rrd_options .= ' -b 1024 '; $rrd_options .= ' DEF:a='.$rrd_filename.':BRd:AVERAGE '; $rrd_options .= ' DEF:b='.$rrd_filename.':BSt:AVERAGE '; $rrd_options .= ' CDEF:c=a,-1,* '; diff --git a/html/includes/graphs/common.inc.php b/html/includes/graphs/common.inc.php index fd60e10b8..bc1742389 100644 --- a/html/includes/graphs/common.inc.php +++ b/html/includes/graphs/common.inc.php @@ -23,7 +23,7 @@ if ($_GET['bg']) { $rrd_options .= " -c CANVAS#" . mres($_GET['bg']) . " "; } #$rrd_options .= " -c BACK#FFFFFF"; -if ($height < "99") { $rrd_options .= " --only-graph"; } +if ($height < "99") { $rrd_options .= " --only-graph"; } if ($width <= "300") { $rrd_options .= " --font LEGEND:7:" . $config['mono_font'] . " --font AXIS:6:" . $config['mono_font']; } else { $rrd_options .= " --font LEGEND:8:" . $config['mono_font'] . " --font AXIS:7:" . $config['mono_font']; } diff --git a/html/includes/graphs/device/netstat_icmp.inc.php b/html/includes/graphs/device/netstat_icmp.inc.php index 6caa7ac06..3ea622ab5 100644 --- a/html/includes/graphs/device/netstat_icmp.inc.php +++ b/html/includes/graphs/device/netstat_icmp.inc.php @@ -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; diff --git a/html/includes/graphs/device/nfsen_common.inc.php b/html/includes/graphs/device/nfsen_common.inc.php index 4c941a607..3e4d59b0f 100644 --- a/html/includes/graphs/device/nfsen_common.inc.php +++ b/html/includes/graphs/device/nfsen_common.inc.php @@ -5,7 +5,7 @@ $device = device_by_id_cache($id); if (!is_array($config['nfsen_rrds'])) { $config['nfsen_rrds'] = array($config['nfsen_rrds']); } foreach ( $config['nfsen_rrds'] as $nfsenrrds ) -{ +{ if ($configs[strlen($nfsenrrds)-1] != '/') { $nfsenrrds .= '/'; } # convert dots in filename to underscores @@ -16,7 +16,7 @@ foreach ( $config['nfsen_rrds'] as $nfsenrrds ) if (is_file($nfsenrrds . $nfsen_filename . ".rrd")) { - $rrd_filename = $nfsenrrds . $nfsen_filename . ".rrd"; + $rrd_filename = $nfsenrrds . $nfsen_filename . ".rrd"; $flowtypes = array('tcp', 'udp', 'icmp', 'other'); diff --git a/html/includes/graphs/device/screenos_sessions.inc.php b/html/includes/graphs/device/screenos_sessions.inc.php index 04fe44ac5..0e67d22cb 100644 --- a/html/includes/graphs/device/screenos_sessions.inc.php +++ b/html/includes/graphs/device/screenos_sessions.inc.php @@ -18,7 +18,7 @@ $rrd_list[2]['filename'] = $file; $rrd_list[2]['descr'] = "Failed"; $rrd_list[2]['rra'] = "failed"; -if ($_GET['debug']) { print_r($rrd_list); } +if ($_GET['debug']) { print_r($rrd_list); } $colours = "mixed"; $nototal = 1; diff --git a/html/includes/graphs/device/ucd_io.inc.php b/html/includes/graphs/device/ucd_io.inc.php index c657e1e0f..d6486be66 100644 --- a/html/includes/graphs/device/ucd_io.inc.php +++ b/html/includes/graphs/device/ucd_io.inc.php @@ -1,7 +1,7 @@ $rrd) $g_defname = $rrd['rra'] . "_cdef"; $rrd_options .= " CDEF:" . $g_defname . $i . "=" . $rrd['rra'] . $i . "," . $multiplier . ",*"; $rrd_options .= " CDEF:" . $g_defname . $i . "max=" . $rrd['rra'] . $i . "max," . $multiplier . ",*"; - + ## If we've been passed a divider (divisor!) we make a CDEF for it. } elseif (is_numeric($divider)) { diff --git a/html/includes/graphs/graph.inc.php b/html/includes/graphs/graph.inc.php index c2a53e4df..5ea8d6c5c 100644 --- a/html/includes/graphs/graph.inc.php +++ b/html/includes/graphs/graph.inc.php @@ -40,10 +40,10 @@ if (isset($config['allow_unauth_graphs']) && $config['allow_unauth_graphs']) { $auth = "1"; ## hardcode auth for all with config function } else { - if (!$_SESSION['authenticated']) - { - graph_error("Session not authenticated"); - exit; + if (!$_SESSION['authenticated']) + { + graph_error("Session not authenticated"); + exit; } } @@ -120,7 +120,7 @@ function graph_error($string) if ($error_msg) { graph_error($graph_error); } elseif (!$auth) { - + if ($width < 200) { graph_error("No Auth"); diff --git a/html/includes/graphs/macaccounting/auth.inc.php b/html/includes/graphs/macaccounting/auth.inc.php index 603715eea..50f892587 100644 --- a/html/includes/graphs/macaccounting/auth.inc.php +++ b/html/includes/graphs/macaccounting/auth.inc.php @@ -21,8 +21,8 @@ if (is_numeric($id)) if(is_file($config['rrd_dir'] . "/" . $acc['hostname'] . "/" . safename("cip-" . $acc['ifIndex'] . "-" . $acc['mac'] . ".rrd"))) { if($debug) { echo("exists"); } - $rrd_filename = $config['rrd_dir'] . "/" . $acc['hostname'] . "/" . safename("cip-" . $acc['ifIndex'] . "-" . $acc['mac'] . ".rrd"); - $port = get_port_by_id($acc['interface_id']); + $rrd_filename = $config['rrd_dir'] . "/" . $acc['hostname'] . "/" . safename("cip-" . $acc['ifIndex'] . "-" . $acc['mac'] . ".rrd"); + $port = get_port_by_id($acc['interface_id']); $device = device_by_id_cache($port['device_id']); $title = generate_device_link($device); $title .= " :: Port ".generate_port_link($port); diff --git a/html/includes/graphs/multiport/bits_separate.inc.php b/html/includes/graphs/multiport/bits_separate.inc.php index 05cfe4bfc..c9d522013 100644 --- a/html/includes/graphs/multiport/bits_separate.inc.php +++ b/html/includes/graphs/multiport/bits_separate.inc.php @@ -5,7 +5,7 @@ $i = 0; foreach (explode(",", $id) as $ifid) { $port = dbFetchRow("SELECT * FROM `ports` AS I, devices as D WHERE I.interface_id = ? AND I.device_id = D.device_id", array($ifid)); - if (is_file($config['rrd_dir'] . "/" . $port['hostname'] . "/port-" . safename($port['ifIndex'] . ".rrd"))) + if (is_file($config['rrd_dir'] . "/" . $port['hostname'] . "/port-" . safename($port['ifIndex'] . ".rrd"))) { $rrd_list[$i]['filename'] = $config['rrd_dir'] . "/" . $port['hostname'] . "/port-" . safename($port['ifIndex'] . ".rrd"); $rrd_list[$i]['descr'] = $port['hostname'] . " " . $port['ifDescr']; diff --git a/html/includes/graphs/port/nupkts.inc.php b/html/includes/graphs/port/nupkts.inc.php index d33738b03..4628b4082 100644 --- a/html/includes/graphs/port/nupkts.inc.php +++ b/html/includes/graphs/port/nupkts.inc.php @@ -38,7 +38,7 @@ if (1) include("includes/graphs/generic_multi_seperated.inc.php"); } -elseif (is_file($config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename($port['ifIndex'] . ".rrd"))) +elseif (is_file($config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename($port['ifIndex'] . ".rrd"))) { $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename($port['ifIndex'] . ".rrd"); diff --git a/html/includes/graphs/sensor/temperature.inc.php b/html/includes/graphs/sensor/temperature.inc.php index ea34c3eb0..a2a38b836 100644 --- a/html/includes/graphs/sensor/temperature.inc.php +++ b/html/includes/graphs/sensor/temperature.inc.php @@ -23,7 +23,7 @@ $rrd_options .= " AREA:sensor_min#ffffffff"; # $rrd_options .= " AREA:sensorcold#CCCCFF"; # $rrd_options .= " LINE1:sensor#cc0000:'" . str_replace(':','\:',str_replace('\*','*',quotemeta($sensor['sensor_descr_fixed'])))."'"; # Ugly hack :( -$rrd_options .= " LINE1.5:sensor#cc0000:'" . $sensor['sensor_descr_fixed']."'"; +$rrd_options .= " LINE1.5:sensor#cc0000:'" . $sensor['sensor_descr_fixed']."'"; # $rrd_options .= " LINE1.5:sensorwarm#660000"; $rrd_options .= " GPRINT:sensor_min:MIN:%4.1lfC"; $rrd_options .= " GPRINT:sensor:LAST:%4.1lfC"; diff --git a/html/includes/graphs/storage/usage.inc.php b/html/includes/graphs/storage/usage.inc.php index feba9d11c..715908439 100644 --- a/html/includes/graphs/storage/usage.inc.php +++ b/html/includes/graphs/storage/usage.inc.php @@ -13,7 +13,7 @@ $rrd_options .= " COMMENT:' Size Free % Used\\n'"; $hostname = gethostbyid($storage['device_id']); -$colour="CC0000"; +$colour="CC0000"; $colour_area="ffaaaa"; $descr = substr(str_pad($storage[storage_descr], 12),0,12); diff --git a/html/includes/hostbox-basic.inc.php b/html/includes/hostbox-basic.inc.php index 7ffa0137d..c21dc3ca4 100644 --- a/html/includes/hostbox-basic.inc.php +++ b/html/includes/hostbox-basic.inc.php @@ -2,18 +2,18 @@ if ($bg == $list_colour_b) { $bg = $list_colour_a; } else { $bg = $list_colour_b; } -if ($device['status'] == '0') +if ($device['status'] == '0') { - $class = "list-device-down"; -} else { + $class = "list-device-down"; +} else { $class = "list-device"; } -if ($device['ignore'] == '1') +if ($device['ignore'] == '1') { $class = "list-device-ignored"; - if ($device['status'] == '1') - { - $class = "list-device-ignored-up"; + if ($device['status'] == '1') + { + $class = "list-device-ignored-up"; } } if ($device['disabled'] == '1') diff --git a/html/includes/hostbox.inc.php b/html/includes/hostbox.inc.php index 8e91369c7..d08b9b2fc 100644 --- a/html/includes/hostbox.inc.php +++ b/html/includes/hostbox.inc.php @@ -2,18 +2,18 @@ if ($bg == $list_colour_b) { $bg = $list_colour_a; } else { $bg = $list_colour_b; } -if ($device['status'] == '0') +if ($device['status'] == '0') { - $class = "list-device-down"; -} else { + $class = "list-device-down"; +} else { $class = "list-device"; } -if ($device['ignore'] == '1') +if ($device['ignore'] == '1') { $class = "list-device-ignored"; - if ($device['status'] == '1') - { - $class = "list-device-ignored-up"; + if ($device['status'] == '1') + { + $class = "list-device-ignored-up"; } } if ($device['disabled'] == '1') diff --git a/html/includes/print-interface.inc.php b/html/includes/print-interface.inc.php index 3ad386e76..3f28947c3 100644 --- a/html/includes/print-interface.inc.php +++ b/html/includes/print-interface.inc.php @@ -9,7 +9,7 @@ $if_id = $port['interface_id']; $port = ifLabel($port); -if($int_colour) +if($int_colour) { $row_colour = $int_colour; } else { @@ -40,7 +40,7 @@ unset ($break); if ($port_details) { - foreach (dbFetchRows("SELECT * FROM `ipv4_addresses` WHERE `interface_id` = ?", array($port['interface_id'])) as $ip) + foreach (dbFetchRows("SELECT * FROM `ipv4_addresses` WHERE `interface_id` = ?", array($port['interface_id'])) as $ip) { echo("$break ".$ip['ipv4_address']."/".$ip['ipv4_prefixlen'].""); $break = "
"; @@ -202,7 +202,7 @@ foreach (dbFetchRows("SELECT * FROM `pseudowires` WHERE `interface_id` = ?", arr #`interface_id`,`peer_device_id`,`peer_ldp_id`,`cpwVcID`,`cpwOid` $pw_peer_dev = dbFetchRow("SELECT * FROM `devices` WHERE `device_id` = ?", array($pseudowire['peer_device_id'])); $pw_peer_int = dbFetchRow("SELECT * FROM `ports` AS I, pseudowires AS P WHERE I.device_id = ? AND P.cpwVcID = ? AND P.interface_id = I.interface_id", array($pseudowire['peer_device_id'], $pseudowire['cpwVcID'])); - + $pw_peer_int = ifNameDescr($pw_peer_int); echo("$br " . generate_port_link($pw_peer_int, makeshortif($pw_peer_int['label'])) ." on ". generate_device_link($pw_peer_dev, shorthost($pw_peer_dev['hostname'])) . ""); $br = "
"; @@ -223,7 +223,7 @@ if ($port['pagpGroupIfIndex'] && $port['pagpGroupIfIndex'] != $port['ifIndex']) 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']) + if($higher_if['interface_id_high']) { $this_port = get_port_by_index_cache($device['device_id'], $higher_if['interface_id_high']); echo("$br " . generate_port_link($this_port) . ""); diff --git a/html/includes/print-menubar.php b/html/includes/print-menubar.php index 517da4506..f9674ae99 100644 --- a/html/includes/print-menubar.php +++ b/html/includes/print-menubar.php @@ -61,10 +61,10 @@ foreach (dbFetchRows("SELECT * FROM `devices`") as $device)
- + - +
  • Devices - -
    + +
    - -
    - -
  • + + + + Ports - + @@ -212,7 +212,7 @@ if ($config['page_refresh']) { echo(""); print_r($_GET); diff --git a/html/pages/about.inc.php b/html/pages/about.inc.php index 574e06765..452763976 100644 --- a/html/pages/about.inc.php +++ b/html/pages/about.inc.php @@ -155,7 +155,7 @@ print_optionbar_end(); Facebook

    - +

    Observium is a Free, Open project. Please donate to support continued development.

    diff --git a/html/pages/adduser.inc.php b/html/pages/adduser.inc.php index cb3128d23..d85caa0bd 100644 --- a/html/pages/adduser.inc.php +++ b/html/pages/adduser.inc.php @@ -18,13 +18,13 @@ else { if (!user_exists($_POST['new_username'])) { - + if (isset($_POST['can_modify_passwd'])) { $_POST['can_modify_passwd'] = 1; } else { $_POST['can_modify_passwd'] = 0; } - + # FIXME: missing email field here on the form if (adduser($_POST['new_username'], $_POST['new_password'], $_POST['new_level'], '', $_POST['realname'], $_POST['can_modify_passwd'])) { diff --git a/html/pages/bill.inc.php b/html/pages/bill.inc.php index 6cd86b898..cac7dbf87 100644 --- a/html/pages/bill.inc.php +++ b/html/pages/bill.inc.php @@ -61,7 +61,7 @@ if (bill_permitted($bill_id)) $unixfrom = dbFetchCell("SELECT UNIX_TIMESTAMP('$datefrom')"); $unixto = dbFetchCell("SELECT UNIX_TIMESTAMP('$dateto')"); - $unix_prev_from = dbFetchCell("SELECT UNIX_TIMESTAMP('$lastfrom')"); + $unix_prev_from = dbFetchCell("SELECT UNIX_TIMESTAMP('$lastfrom')"); $unix_prev_to = dbFetchCell("SELECT UNIX_TIMESTAMP('$lastto')"); echo("

    diff --git a/html/pages/bill/actions.inc.php b/html/pages/bill/actions.inc.php index 94e02478d..93f1ebd8c 100644 --- a/html/pages/bill/actions.inc.php +++ b/html/pages/bill/actions.inc.php @@ -18,18 +18,18 @@ if ($_POST['action'] == "delete_bill" && $_POST['confirm'] == "confirm") echo(""); } -if ($_POST['action'] == "add_bill_port") -{ +if ($_POST['action'] == "add_bill_port") +{ dbInsert(array('bill_id' => $_POST['bill_id'], 'port_id' => $_POST['interface_id']), 'bill_ports'); } -if ($_POST['action'] == "delete_bill_port") -{ +if ($_POST['action'] == "delete_bill_port") +{ dbDelete('bill_ports', "`bill_id` = ? AND `port_id` = ?", array($bill_id, $_POST['interface_id'])); } if ($_POST['action'] == "update_bill") { - if (dbUpdate(array('bill_name' => $_POST['bill_name'], 'bill_day' => $_POST['bill_day'], 'bill_gb' => $_POST['bill_gb'], + if (dbUpdate(array('bill_name' => $_POST['bill_name'], 'bill_day' => $_POST['bill_day'], 'bill_gb' => $_POST['bill_gb'], 'bill_cdr' => $_POST['bill_cdr'], 'bill_type' => $_POST['bill_type']), 'bills', '`bill_id` = ?', array($bill_id))) { print_message("Bill Properties Updated"); diff --git a/html/pages/device.inc.php b/html/pages/device.inc.php index aeed76973..d7f7764df 100644 --- a/html/pages/device.inc.php +++ b/html/pages/device.inc.php @@ -117,7 +117,7 @@ if (device_permitted($vars['device']) || $check_device == $vars['device']) $device_routing_count['bgp'] = dbFetchCell("SELECT COUNT(*) FROM `bgpPeers` WHERE `device_id` = ?", array($device['device_id'])); if ($device_routing_count['bgp']) { $routing_tabs[] = 'bgp'; } - + $device_routing_count['ospf'] = dbFetchCell("SELECT COUNT(*) FROM `ospf_ports` WHERE `device_id` = ?", array($device['device_id'])); if ($device_routing_count['ospf']) { $routing_tabs[] = 'ospf'; } @@ -127,7 +127,7 @@ if (device_permitted($vars['device']) || $check_device == $vars['device']) $device_routing_count['vrf'] = @dbFetchCell("SELECT COUNT(*) FROM `vrfs` WHERE `device_id` = ?", array($device['device_id'])); if($device_routing_count['vrf']) { $routing_tabs[] = 'vrf'; } - if (is_array($routing_tabs)) + if (is_array($routing_tabs)) { echo('
  • @@ -219,7 +219,7 @@ if (device_permitted($vars['device']) || $check_device == $vars['device']) } if ($config['nfsen_enable']) - { + { if (!is_array($config['nfsen_rrds'])) { $config['nfsen_rrds'] = array($config['nfsen_rrds']); } foreach ($config['nfsen_rrds'] as $nfsenrrds) { diff --git a/html/pages/device/edit/apps.inc.php b/html/pages/device/edit/apps.inc.php index 63e2ab571..c8bb3c01c 100644 --- a/html/pages/device/edit/apps.inc.php +++ b/html/pages/device/edit/apps.inc.php @@ -1,10 +1,5 @@ $_POST['community'], 'snmpver' => $_POST['snmpver'], 'port' => $_POST['port']); if ($_POST['timeout']) { $update['timeout'] = $_POST['timeout']; } else { $update['timeout'] = array(NULL); } if ($_POST['retries']) { $update['retries'] = $_POST['retries']; } else { $update['retries'] = array(NULL); } - + $rows_updated = dbUpdate($update, 'devices', '`device_id` = ?',array($device['device_id'])); if ($rows_updated > 0) diff --git a/html/pages/device/graphs.inc.php b/html/pages/device/graphs.inc.php index 77ae29e57..c9d13383f 100644 --- a/html/pages/device/graphs.inc.php +++ b/html/pages/device/graphs.inc.php @@ -37,9 +37,9 @@ foreach ($config['graph_sections'] as $section) echo(generate_link(ucfirst($type),$link_array,array('group'=>$type))); - if ($vars['group'] == $type) - { - echo(""); + if ($vars['group'] == $type) + { + echo(""); } $sep = " | "; } diff --git a/html/pages/device/health/diskio.inc.php b/html/pages/device/health/diskio.inc.php index d58fcabbf..0fac6fbbd 100644 --- a/html/pages/device/health/diskio.inc.php +++ b/html/pages/device/health/diskio.inc.php @@ -23,7 +23,7 @@ foreach (dbFetchRows("SELECT * FROM `ucd_diskio` WHERE device_id = ? ORDER BY di $graph_array_zoom['height'] = "125"; $graph_array_zoom['from'] = $config['time']['twoday']; $graph_array_zoom['to'] = $config['time']['now']; - + echo(""); echo(overlib_link($fs_url, $drive['diskio_descr'], generate_graph_tag($graph_array_zoom), NULL)); diff --git a/html/pages/device/nfsen.inc.php b/html/pages/device/nfsen.inc.php index 95303f480..68ed31dfc 100644 --- a/html/pages/device/nfsen.inc.php +++ b/html/pages/device/nfsen.inc.php @@ -7,7 +7,7 @@ $datas = array( ); foreach ($datas as $name=>$type) -{ +{ $graph_title = $name; $graph_type = "device_".$type; include("includes/print-device-graph.php"); diff --git a/html/pages/device/port/realtime.inc.php b/html/pages/device/port/realtime.inc.php index 9627721bf..9bfc63389 100644 --- a/html/pages/device/port/realtime.inc.php +++ b/html/pages/device/port/realtime.inc.php @@ -14,7 +14,7 @@ print_optionbar_start(); echo("Polling Interval: "); -foreach(array(0.25, 1, 2, 5, 15, 60) as $interval) +foreach(array(0.25, 1, 2, 5, 15, 60) as $interval) { echo($thinger); if ($vars['interval'] == $interval) { echo(""); } diff --git a/html/pages/device/ports/neighbours.inc.php b/html/pages/device/ports/neighbours.inc.php index ebcee1189..0240176ac 100644 --- a/html/pages/device/ports/neighbours.inc.php +++ b/html/pages/device/ports/neighbours.inc.php @@ -18,7 +18,7 @@ foreach(dbFetchRows("SELECT * FROM links AS L, ports AS I WHERE I.device_id = ? echo(''); echo(''.generate_port_link($neighbour).'
    '.$neighbour['ifAlias'].''); - if(is_numeric($neighbour['remote_interface_id']) && $neighbour['remote_interface_id']) + if(is_numeric($neighbour['remote_interface_id']) && $neighbour['remote_interface_id']) { $remote_port = get_port_by_id($neighbour['remote_interface_id']); $remote_device = device_by_id_cache($remote_port['device_id']); diff --git a/html/pages/device/routing/cef.inc.php b/html/pages/device/routing/cef.inc.php index 39250cc94..b832f9984 100644 --- a/html/pages/device/routing/cef.inc.php +++ b/html/pages/device/routing/cef.inc.php @@ -48,7 +48,7 @@ foreach (dbFetchRows("SELECT * FROM `cef_switching` WHERE `device_id` = ? ORDER $interval = $cef['updated'] - $cef['updated_prev']; - if(!$entity['entPhysicalModelName'] && $entity['entPhysicalContainedIn']) + if(!$entity['entPhysicalModelName'] && $entity['entPhysicalContainedIn']) { $parent_entity = dbFetchRow("SELECT * FROM `entPhysical` WHERE device_id = ? AND `entPhysicalIndex` = ?", array($device['device_id'], $entity['entPhysicalContainedIn'])); $entity_descr = $entity['entPhysicalName'] . " (" . $parent_entity['entPhysicalModelName'] .")"; diff --git a/html/pages/device/showconfig.inc.php b/html/pages/device/showconfig.inc.php index ec8ebf742..4f8865517 100644 --- a/html/pages/device/showconfig.inc.php +++ b/html/pages/device/showconfig.inc.php @@ -4,7 +4,7 @@ include("includes/geshi/geshi.php"); if ($_SESSION['userlevel'] >= "7") { - + if (!is_array($config['rancid_configs'])) { $config['rancid_configs'] = array($config['rancid_configs']); } foreach ($config['rancid_configs'] as $configs) @@ -12,13 +12,13 @@ if ($_SESSION['userlevel'] >= "7") if ($configs[strlen($configs)-1] != '/') { $configs .= '/'; } if (is_file($configs . $device['hostname'])) { $file = $configs . $device['hostname']; } } - + echo('
    '); print_optionbar_start('', ''); echo("Config » "); - + if (!$_GET['optc']) { echo(''); echo(" Latest"); @@ -26,29 +26,29 @@ if ($_SESSION['userlevel'] >= "7") } else { echo(" Latest"); } - + if (function_exists('svn_log')) { - + $sep = " | "; $svnlogs = svn_log($file, SVN_REVISION_HEAD, NULL, 5); $revlist = array(); - + foreach ($svnlogs as $svnlog) { - + echo($sep); $revlist[] = $svnlog["rev"]; - + if ($_GET['optc'] == $svnlog["rev"]) { echo(''); } - + echo(" r" . $svnlog["rev"] ." ". date("d M H:i", strtotime($svnlog["date"])) . ""); if ($_GET['optc'] == $svnlog["rev"]) { echo(""); } - + $sep = " | "; } } - + print_optionbar_end(); - + if (function_exists('svn_log') && in_array($_GET['optc'], $revlist)) { list($diff, $errors) = svn_diff($file, $_GET['optc']-1, $file, $_GET['optc']); if (!$diff) { @@ -59,7 +59,7 @@ if ($_SESSION['userlevel'] >= "7") fclose($diff); fclose($errors); } - + } else { $fh = fopen($file, 'r') or die("Can't open file"); $text = fread($fh, filesize($file)); diff --git a/html/pages/device/vlans.inc.php b/html/pages/device/vlans.inc.php index 2a79e331b..4e89dece2 100644 --- a/html/pages/device/vlans.inc.php +++ b/html/pages/device/vlans.inc.php @@ -9,7 +9,7 @@ echo(" Bits | Packets | NU Packets | - Errors + Errors "); print_optionbar_end(); diff --git a/html/pages/devices.inc.php b/html/pages/devices.inc.php index aaf03e58f..db7d192ef 100644 --- a/html/pages/devices.inc.php +++ b/html/pages/devices.inc.php @@ -130,7 +130,7 @@ foreach(dbFetch('SELECT `type` FROM `devices` AS D WHERE 1 GROUP BY `type` ORDER - Update URL | + Update URL | Reset
    @@ -141,7 +141,7 @@ foreach(dbFetch('SELECT `type` FROM `devices` AS D WHERE 1 GROUP BY `type` ORDER
    - $text) ?> - | + | Graphs » diff --git a/html/pages/front/default.php b/html/pages/front/default.php index d6c3254a6..1a151899d 100644 --- a/html/pages/front/default.php +++ b/html/pages/front/default.php @@ -82,7 +82,7 @@ if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $c { $sql = mysql_query("SELECT * FROM `devices` AS D WHERE D.status = '1' AND D.uptime < '" . $config['uptime_warning'] . "' AND D.ignore = 0"); } else { - $sql = mysql_query("SELECT * FROM `devices` AS D, devices_perms AS P WHERE D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' AND D.status = '1' AND D.uptime < '" . + $sql = mysql_query("SELECT * FROM `devices` AS D, devices_perms AS P WHERE D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' AND D.status = '1' AND D.uptime < '" . $config['uptime_warning'] . "' AND D.ignore = 0"); } diff --git a/html/pages/front/demo.php b/html/pages/front/demo.php index 4a06c718f..bb9719cc4 100644 --- a/html/pages/front/demo.php +++ b/html/pages/front/demo.php @@ -7,11 +7,11 @@ echo(""); -$dev_list = array('6' => 'Central Fileserver', - '7' => 'NE61 Fileserver', +$dev_list = array('6' => 'Central Fileserver', + '7' => 'NE61 Fileserver', '34' => 'DE56 Fileserver'); -foreach($dev_list as $device_id => $descr) +foreach($dev_list as $device_id => $descr) { echo("
    "); @@ -139,9 +139,9 @@ while ($peer = mysql_fetch_array($sql)) } } -if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0) +if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0) { - $sql = mysql_query("SELECT * FROM devices_attribs AS A, `devices` AS D WHERE + $sql = mysql_query("SELECT * FROM devices_attribs AS A, `devices` AS D WHERE A.attrib_value < '" . $config['uptime_warning'] . "' AND A.attrib_type = 'uptime' AND A.device_id = D.device_id AND ignore = '0' AND disabled = '0'"); while ($device = mysql_fetch_array($sql)) { diff --git a/html/pages/front/example2.php b/html/pages/front/example2.php index b260ba7c3..dd5d8daf9 100644 --- a/html/pages/front/example2.php +++ b/html/pages/front/example2.php @@ -74,7 +74,7 @@ while ($peer = mysql_fetch_assoc($sql)){ } -if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0) +if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0) { $sql = mysql_query("SELECT * FROM `devices` AS D, devices_attribs AS A WHERE A.device_id = D.device_id AND A.attrib_type = 'uptime' AND A.attrib_value < '" . $config['uptime_warning'] . "'"); while ($device = mysql_fetch_assoc($sql)){ diff --git a/html/pages/front/jt.php b/html/pages/front/jt.php index 8ee15dcde..1c7beb4f4 100644 --- a/html/pages/front/jt.php +++ b/html/pages/front/jt.php @@ -7,7 +7,7 @@ $nodes = array(); $uptimesql = ""; -if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0) +if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0) { $uptimesql = " AND A.attrib_value < '" . $config['uptime_warning'] . "'"; } @@ -79,7 +79,7 @@ while ($peer = mysql_fetch_assoc($sql)){ } } -if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0) +if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0) { $sql = mysql_query("SELECT * FROM devices_attribs AS A, `devices` AS D WHERE A.attrib_value < '" . $config['uptime_warning'] . "' AND A.attrib_type = 'uptime' AND A.device_id = D.device_id AND ignore = '0' AND disabled = '0'"); while ($device = mysql_fetch_assoc($sql)){ diff --git a/html/pages/front/traffic.php b/html/pages/front/traffic.php index 1065f26b8..36ba7ad96 100644 --- a/html/pages/front/traffic.php +++ b/html/pages/front/traffic.php @@ -7,7 +7,7 @@ $nodes = array(); $param = array(); $uptimesql = ""; -if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0) +if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0) { $uptimesql = " AND A.attrib_value < ?"; $param = array($config['uptime_warning']); @@ -79,7 +79,7 @@ foreach (dbFetchRows("SELECT * FROM `devices` AS D, bgpPeers AS B WHERE bgpPeerA } } -if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0) +if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0) { foreach (dbFetchRows("SELECT * FROM devices_attribs AS A, `devices` AS D WHERE A.attrib_value < ? AND A.attrib_type = 'uptime' AND A.device_id = D.device_id AND ignore = '0' AND disabled = '0'", array($config['uptime_warning'])) as $device){ if (device_permitted($device['device_id']) && $device['attrib_value'] < $config['uptime_warning'] && $device['attrib_type'] == "uptime") { diff --git a/html/pages/graphs.inc.php b/html/pages/graphs.inc.php index aa7d1cc75..ac334f42a 100644 --- a/html/pages/graphs.inc.php +++ b/html/pages/graphs.inc.php @@ -8,7 +8,7 @@ if($_SESSION['widescreen']) { $graph_width=1700; $thumb_width=180; -} else { +} else { $graph_width=1075; $thumb_width=113; } @@ -79,7 +79,7 @@ if (!$auth) $graph_array['height'] = "300"; $graph_array['width'] = $graph_width; - + echo generate_graph_js_state($graph_array); echo("
    "); diff --git a/html/pages/health.inc.php b/html/pages/health.inc.php index 5baa083cc..0b739b22b 100644 --- a/html/pages/health.inc.php +++ b/html/pages/health.inc.php @@ -39,7 +39,7 @@ foreach ($datas as $texttype) echo($sep); if ($vars['metric'] == $metric) { - echo(""); + echo(""); } echo(generate_link($type_text[$metric],$link_array,array('metric'=> $metric, 'view' => $vars['view']))); @@ -72,16 +72,16 @@ if ($vars['view'] != "graphs") echo(generate_link("No Graphs",$link_array,array('metric'=> $vars['metric'], 'view' => "detail"))); -if ($vars['view'] != "graphs") -{ - echo(''); +if ($vars['view'] != "graphs") +{ + echo(''); } echo('
    '); print_optionbar_end(); -if (in_array($vars['metric'],array_keys($used_sensors)) +if (in_array($vars['metric'],array_keys($used_sensors)) || $vars['metric'] == 'processor' || $vars['metric'] == 'storage' || $vars['metric'] == 'mempool') diff --git a/html/pages/iftype.inc.php b/html/pages/iftype.inc.php index 6f8e43c28..91eec7a49 100644 --- a/html/pages/iftype.inc.php +++ b/html/pages/iftype.inc.php @@ -9,7 +9,7 @@ foreach (explode(",", $vars['type']) as $type) { $type_where .= " $or `port_descr_type` = ?"; $or = "OR"; - $type_param[] = $type; + $type_param[] = $type; } $type_where .= ") "; diff --git a/html/pages/inventory.inc.php b/html/pages/inventory.inc.php index af2c26e31..cdfb21a93 100644 --- a/html/pages/inventory.inc.php +++ b/html/pages/inventory.inc.php @@ -58,7 +58,7 @@ if ($_SESSION['userlevel'] >= '5') if (isset($_POST['string']) && strlen($_POST['string'])) { $sql .= " AND E.entPhysicalDescr LIKE ?"; - $param[] = "%".$_POST['string']."%"; + $param[] = "%".$_POST['string']."%"; } if (isset($_POST['device_string']) && strlen($_POST['device_string'])) diff --git a/html/pages/ports.inc.php b/html/pages/ports.inc.php index 2ea5e2872..b1effa6de 100644 --- a/html/pages/ports.inc.php +++ b/html/pages/ports.inc.php @@ -163,9 +163,9 @@ foreach ($menu_options as $option => $text) } ?> - | + | -Graphs » +Graphs » $text) echo('
    '); ?> - Update URL | + Update URL | = '5') { +if ($_SESSION['userlevel'] >= '5') { if(!isset($_GET['optb'])) { $_GET['optb'] = "all"; } if(!isset($_GET['optc'])) { $_GET['optc'] = "basic"; } @@ -36,7 +36,7 @@ if ($_SESSION['userlevel'] >= '5') { if ($_GET['opta'] == "vrf" && $_GET['optc'] == "errors") { echo(""); } echo('Errors'); if ($_GET['opta'] == "vrf" && $_GET['optc'] == "errors") { echo(""); } - + echo(" )"); print_optionbar_end(); diff --git a/html/pages/search/mac.inc.php b/html/pages/search/mac.inc.php index 336e0a4ee..608e77f44 100644 --- a/html/pages/search/mac.inc.php +++ b/html/pages/search/mac.inc.php @@ -43,14 +43,14 @@ $query = "SELECT * FROM `ports` AS P, `devices` AS D WHERE P.device_id = D.devic $query .= "AND `ifPhysAddress` LIKE ?"; $param = array("%".str_replace(':','',mres($_POST['address']))."%"); -if (is_numeric($_POST['device_id'])) -{ - $query .= " AND I.device_id = ?"; - $param[] = $_POST['device_id']; +if (is_numeric($_POST['device_id'])) +{ + $query .= " AND I.device_id = ?"; + $param[] = $_POST['device_id']; } -if ($_POST['interface']) -{ - $query .= " AND I.ifDescr LIKE ?"; +if ($_POST['interface']) +{ + $query .= " AND I.ifDescr LIKE ?"; $param[] = $_POST['interface']; } $query .= " ORDER BY P.ifPhysAddress"; diff --git a/html/pages/services.inc.php b/html/pages/services.inc.php index 49bbb4c3e..291eda598 100644 --- a/html/pages/services.inc.php +++ b/html/pages/services.inc.php @@ -1,4 +1,4 @@ -= '5') } } unset ($samehost); - } + } echo("
    "); diff --git a/includes/billing.php b/includes/billing.php index 0d222ac00..432a7345c 100644 --- a/includes/billing.php +++ b/includes/billing.php @@ -50,7 +50,7 @@ function getDates($dayofmonth) { $lastmonth = 10; $lastyear = $year - 1; - } elseif ($lastmonth == 0) + } elseif ($lastmonth == 0) { $lastmonth = 11; $lastyear = $year - 1; diff --git a/includes/common.php b/includes/common.php index b96e32a55..dcfeed252 100644 --- a/includes/common.php +++ b/includes/common.php @@ -3,7 +3,7 @@ ## Common Functions function isCli() { - + if(php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR'])) { return true; } else { @@ -66,7 +66,7 @@ function get_sensor_rrd($device, $sensor) global $config; # For IPMI, sensors tend to change order, and there is no index, so we prefer to use the description as key here. - if ($config['os'][$device['os']]['sensor_descr'] || $sensor['poller_type'] == "ipmi") + if ($config['os'][$device['os']]['sensor_descr'] || $sensor['poller_type'] == "ipmi") { $rrd_file = $config['rrd_dir']."/".$device['hostname']."/".safename("sensor-".$sensor['sensor_class']."-".$sensor['sensor_type']."-".$sensor['sensor_descr'] . ".rrd"); } else { diff --git a/includes/console_colour.php b/includes/console_colour.php index d054154f6..87a653f1a 100644 --- a/includes/console_colour.php +++ b/includes/console_colour.php @@ -3,25 +3,25 @@ * Color.php * * PHP version 4 - * + * * Copyright (c) 2007 Stefan Walk * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in + * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * @category Console @@ -68,11 +68,11 @@ $GLOBALS['_CONSOLE_COLOR_CODES'] = array ( ) ); - + /** * A simple class to use ANSI Colorcodes. * - * Of all the functions, you probably only want to use convert() and escape(). + * Of all the functions, you probably only want to use convert() and escape(). * They are easier to use. However, if you want to access colorcodes more * directly, look into the other functions. * @@ -87,14 +87,14 @@ class Console_Color /** * Returns an ANSI-Controlcode - * + * * Takes 1 to 3 Arguments: either 1 to 3 strings containing the name of the * FG Color, style and BG color, or one array with the indices color, style * or background. * * @param mixed $color Optional. * Either a string with the name of the foreground - * color, or an array with the indices 'color', + * color, or an array with the indices 'color', * 'style', 'background' and corresponding names as * values. * @param string $style Optional name of the style @@ -150,7 +150,7 @@ class Console_Color $colors = &$GLOBALS['_CONSOLE_COLOR_CODES']; return "\033[".$colors['color'][$name].'m'; } - + /** * Returns a style controlcode * @@ -164,7 +164,7 @@ class Console_Color $colors = &$GLOBALS['_CONSOLE_COLOR_CODES']; return "\033[".$colors['style'][$name].'m'; } - + /** * Returns a BG color controlcode * @@ -183,7 +183,7 @@ class Console_Color * Converts colorcodes in the format %y (for yellow) into ansi-control * codes. The conversion table is: ('bold' meaning 'light' on some * terminals). It's almost the same conversion table irssi uses. - *
     
    +     * 
          *                  text      text            background
          *      ------------------------------------------------
          *      %k %K %0    black     dark grey       black
    @@ -273,13 +273,13 @@ class Console_Color
     
         /**
          * Escapes % so they don't get interpreted as color codes
    -     * 
    +     *
          * @param string $string String to escape
          *
          * @access public
          * @return string
          */
    -    function escape($string) 
    +    function escape($string)
         {
             return str_replace('%', '%%', $string);
         }
    @@ -292,7 +292,7 @@ class Console_Color
          * @acess public
          * @return string
          */
    -    function strip($string) 
    +    function strip($string)
         {
             return preg_replace('/\033\[[\d;]+m/', '', $string);
         }
    diff --git a/includes/dbFacile.php b/includes/dbFacile.php
    index 7e8db8058..2c1d7e791 100644
    --- a/includes/dbFacile.php
    +++ b/includes/dbFacile.php
    @@ -7,7 +7,7 @@ This code is covered by the MIT license http://en.wikipedia.org/wiki/MIT_License
     
     By Alan Szlosek from http://www.greaterscope.net/projects/dbFacile
     
    -The non-OO version of dbFacile. It's a bit simplistic, but gives you the 
    +The non-OO version of dbFacile. It's a bit simplistic, but gives you the
     really useful bits in non-class form.
     
     Usage
    @@ -177,7 +177,7 @@ function dbFetchRows($sql, $parameters = array()) {
             $db_stats['fetchrows']++;
     
     	// no records, thus return empty array
    -	// which should evaluate to false, and will prevent foreach notices/warnings 
    +	// which should evaluate to false, and will prevent foreach notices/warnings
     	return array();
     }
     /*
    @@ -318,7 +318,7 @@ function dbMakeQuery($sql, $parameters) {
     				if($test == '?') {
     					$query .= array_shift($questionParams);
     				} else {
    -					$query .= $namedParams[ $test ]; 
    +					$query .= $namedParams[ $test ];
     				}
     			}
     		}
    @@ -339,7 +339,7 @@ function dbPrepareData($data) {
     				$value = array_shift($value);
     			}
     			// it's not right to worry about invalid fields in this method because we may be operating on fields
    -			// that are aliases, or part of other tables through joins 
    +			// that are aliases, or part of other tables through joins
     			//if(!in_array($key, $columns)) // skip invalid fields
     			//	continue;
     			if($escape) {
    @@ -384,7 +384,7 @@ function dbRollbackTransaction() {
     class dbIterator implements Iterator {
     	private $result;
     	private $i;
    -	
    +
     	public function __construct($r) {
     		$this->result = $r;
     		$this->i = 0;
    diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php
    index 3ee4f4720..1fdba781b 100644
    --- a/includes/defaults.inc.php
    +++ b/includes/defaults.inc.php
    @@ -116,7 +116,7 @@ $warn_colour_b = "#ffcccc";
     #$config['graph_colours']['blues']   = array("b5d7ff","6eb7ff","0064ff","0082ff","0019d5","0016cb","00007d"); ## Cold Blues
     
     $config['graph_colours']['mixed']   = array('CC0000','008C00','4096EE','73880A','D01F3C','36393D','FF0084');
    -$config['graph_colours']['oranges'] = array('E43C00','E74B00','EB5B00','EF6A00','F37900','F78800','FB9700','FFA700');	
    +$config['graph_colours']['oranges'] = array('E43C00','E74B00','EB5B00','EF6A00','F37900','F78800','FB9700','FFA700');
     $config['graph_colours']['greens']  = array('B6D14B','91B13C','6D912D','48721E','24520F','003300');
     $config['graph_colours']['pinks']   = array('D0558F','B34773','943A57','792C38','5C1F1E','401F10');
     $config['graph_colours']['blues']   = array('A0A0E5','8080BD','606096','40406F','202048','000033');
    @@ -193,22 +193,22 @@ $config['bad_if'][] = "-shdsl";
     $config['bad_if'][] = "-aal5";
     $config['bad_if'][] = "-atm";
     $config['bad_if'][] = "container";
    -$config['bad_if'][] = "async"; 
    -$config['bad_if'][] = "plip"; 
    -$config['bad_if'][] = "-physical"; 
    -$config['bad_if'][] = "-signalling"; 
    -$config['bad_if'][] = "container"; 
    -$config['bad_if'][] = "unrouted"; 
    -$config['bad_if'][] = "bri"; 
    -$config['bad_if'][] = "-bearer"; 
    -$config['bad_if'][] = "bluetooth"; 
    -$config['bad_if'][] = "isatap"; 
    -$config['bad_if'][] = "ras"; 
    -$config['bad_if'][] = "qos"; 
    -$config['bad_if'][] = "sonet/sdh"; 
    -$config['bad_if'][] = "span rp"; 
    -$config['bad_if'][] = "span sp"; 
    -$config['bad_if'][] = "sslvpn"; 
    +$config['bad_if'][] = "async";
    +$config['bad_if'][] = "plip";
    +$config['bad_if'][] = "-physical";
    +$config['bad_if'][] = "-signalling";
    +$config['bad_if'][] = "container";
    +$config['bad_if'][] = "unrouted";
    +$config['bad_if'][] = "bri";
    +$config['bad_if'][] = "-bearer";
    +$config['bad_if'][] = "bluetooth";
    +$config['bad_if'][] = "isatap";
    +$config['bad_if'][] = "ras";
    +$config['bad_if'][] = "qos";
    +$config['bad_if'][] = "sonet/sdh";
    +$config['bad_if'][] = "span rp";
    +$config['bad_if'][] = "span sp";
    +$config['bad_if'][] = "sslvpn";
     $config['bad_if'][] = "pppoe-";
     
     $config['bad_if_regexp'][] = "/serial[0-9]:/";
    diff --git a/includes/discovery/cisco-cef.inc.php b/includes/discovery/cisco-cef.inc.php
    index f3f54d95b..d2bd51bb8 100755
    --- a/includes/discovery/cisco-cef.inc.php
    +++ b/includes/discovery/cisco-cef.inc.php
    @@ -8,7 +8,7 @@ if ($debug) { print_r($cefs); }
     
     if (is_array($cefs))
     {
    -  if (!is_array($entity_array)) 
    +  if (!is_array($entity_array))
       {
         echo("Caching OIDs: ");
         $entity_array = array();
    @@ -31,10 +31,10 @@ if (is_array($cefs))
             echo(" | |-".$path.": ".$path_name['cefSwitchingPath']."\n");
     
     
    -        if(mysql_result(mysql_query("SELECT COUNT(*) FROM `cef` WHERE `device_id` = '".$device['device_id']."' AND `entPhysicalIndex` = '".$entity."' 
    +        if(mysql_result(mysql_query("SELECT COUNT(*) FROM `cef` WHERE `device_id` = '".$device['device_id']."' AND `entPhysicalIndex` = '".$entity."'
                                          AND `afi` = '".$afi."' AND `cef_index` = '".$path."'"),0) != "1")
             {
    -	  $sql = "INSERT INTO `cef` (`device_id`, `entPhysicalIndex`, `afi`, `cef_index`, `cef_path`) 
    +	  $sql = "INSERT INTO `cef` (`device_id`, `entPhysicalIndex`, `afi`, `cef_index`, `cef_path`)
                       VALUES ('".$device['device_id']."', '".$entity."', '".$afi."', '".$path."', '".$path_name['cefSwitchingPath']."')";
     	  mysql_query($sql);
               echo("+");
    diff --git a/includes/discovery/functions.inc.php b/includes/discovery/functions.inc.php
    index 511f82e2a..85d2db532 100644
    --- a/includes/discovery/functions.inc.php
    +++ b/includes/discovery/functions.inc.php
    @@ -124,7 +124,7 @@ function discover_sensor(&$valid, $class, $device, $oid, $index, $type, $descr,
         if (!$low_limit)  { $low_limit  = sensor_low_limit($class, $current); }
     
         $insert = array('poller_type' => $poller_type, 'sensor_class' => $class, 'device_id' => $device['device_id'], 'sensor_oid' => $oid, 'sensor_index' => $index, 'sensor_type' => $type, 'sensor_descr' => $descr,
    -                    'sensor_divisor' => $divisor, 'sensor_multiplier' => $multiplier, 'sensor_limit' => $high_limit, 'sensor_limit_warn' => $warn_limit, 'sensor_limit_low' => $low_limit, 
    +                    'sensor_divisor' => $divisor, 'sensor_multiplier' => $multiplier, 'sensor_limit' => $high_limit, 'sensor_limit_warn' => $warn_limit, 'sensor_limit_low' => $low_limit,
                         'sensor_limit_low_warn' => $low_warn_limit, 'sensor_current' => $current, 'entPhysicalIndex' => $entPhysicalIndex, 'entPhysicalIndex_measured' => $entPhysicalIndex_measured );
     
         $inserted = dbInsert($insert, 'sensors');
    @@ -300,7 +300,7 @@ function discover_link($local_interface_id, $protocol, $remote_interface_id, $re
     {
       global $config, $debug, $link_exists;
     
    -  if (dbFetchCell("SELECT COUNT(*) FROM `links` WHERE `remote_hostname` = ? AND `local_interface_id` = ? AND `protocol` = ? AND `remote_port` = ?", 
    +  if (dbFetchCell("SELECT COUNT(*) FROM `links` WHERE `remote_hostname` = ? AND `local_interface_id` = ? AND `protocol` = ? AND `remote_port` = ?",
                       array($remote_hostname, $local_interface_id, $protocol, $remote_port)) == "0")
       {
     
    @@ -335,7 +335,7 @@ function discover_storage(&$valid, $device, $index, $type, $mib, $descr, $size,
         $storage = dbFetchRow("SELECT * FROM `storage` WHERE `storage_index` = ? AND `device_id` = ? AND `storage_mib` = ?", array($index, $device['device_id'], $mib));
         if ($storage === FALSE || !count($storage))
         {
    -      $insert = dbInsert(array('device_id' => $device['device_id'], 'storage_descr' => $descr, 'storage_index' => $index, 'storage_mib' => $mib, 'storage_type' => $type, 
    +      $insert = dbInsert(array('device_id' => $device['device_id'], 'storage_descr' => $descr, 'storage_index' => $index, 'storage_mib' => $mib, 'storage_type' => $type,
                                    'storage_units' => $units, 'storage_size' => $size, 'storage_used' => $used), 'storage');
           if ($debug) { mysql_error(); }
           echo("+");
    diff --git a/includes/discovery/humidity/netbotz.inc.php b/includes/discovery/humidity/netbotz.inc.php
    index 1902a4d82..938386327 100644
    --- a/includes/discovery/humidity/netbotz.inc.php
    +++ b/includes/discovery/humidity/netbotz.inc.php
    @@ -5,7 +5,7 @@ if ($device['os'] == 'netbotz')
       $oids = snmp_walk($device, ".1.3.6.1.4.1.5528.100.4.1.2.1.4", "-Osqn", "");
       if ($debug) { echo($oids."\n"); }
       $oids = trim($oids);
    -  if ($oids) 
    +  if ($oids)
       {
         echo("Netbotz ");
         foreach (explode("\n", $oids) as $data)
    diff --git a/includes/discovery/libvirt-vminfo.inc.php b/includes/discovery/libvirt-vminfo.inc.php
    index dac57b90c..7291caed3 100755
    --- a/includes/discovery/libvirt-vminfo.inc.php
    +++ b/includes/discovery/libvirt-vminfo.inc.php
    @@ -22,7 +22,7 @@ if ($config['enable_libvirt'] == '1' && $device['os'] == "linux" )
         {
           $uri = $method.'://' . $device['hostname'];
         }
    -    
    +
         if (strstr($method,'ssh') && !$ssh_ok)
         {
           # Check if we are using SSH if we can log in without password - without blocking the discovery
    @@ -31,7 +31,7 @@ if ($config['enable_libvirt'] == '1' && $device['os'] == "linux" )
           if ($ret != 255) { $ssh_ok = 1; }
         }
     
    -    if ($ssh_ok || !strstr($method,'ssh'))	
    +    if ($ssh_ok || !strstr($method,'ssh'))
         {
           # Fetch virtual machine list
           unset($domlist);
    @@ -107,7 +107,7 @@ if ($config['enable_libvirt'] == '1' && $device['os'] == "linux" )
             }
           }
         }
    -    
    +
         # If we found VMs, don't cycle the other protocols anymore.
         if (count($libvirt_vmlist)) { break; }
       }
    diff --git a/includes/discovery/temperatures/netbotz.inc.php b/includes/discovery/temperatures/netbotz.inc.php
    index 309a135c8..5191246f6 100644
    --- a/includes/discovery/temperatures/netbotz.inc.php
    +++ b/includes/discovery/temperatures/netbotz.inc.php
    @@ -22,7 +22,7 @@ if ($device['os'] == "netbotz")
           {
             discover_sensor($valid['sensor'], 'temperature', $device, $temperature_oid, $temperature_id, 'netbotz', $descr, '1', '1', NULL, NULL, NULL, NULL, $temperature);
           }
    -    } 
    +    }
       }
     }
     
    diff --git a/includes/polling/cipsec-tunnels.inc.php b/includes/polling/cipsec-tunnels.inc.php
    index ac8a66a4f..6bbe48a86 100644
    --- a/includes/polling/cipsec-tunnels.inc.php
    +++ b/includes/polling/cipsec-tunnels.inc.php
    @@ -53,7 +53,7 @@ foreach($ipsec_array as $index => $tunnel)
         $updated   = dbUpdate($db_update, 'ipsec_tunnels', '`tunnel_id` = ?', array($tunnels[$tunnel['cikeTunRemoteValue']]['tunnel_id']));
       }
     
    -  if (is_numeric($tunnel['cipSecTunHcInOctets']) && is_numeric($tunnel['cipSecTunHcInDecompOctets']) && 
    +  if (is_numeric($tunnel['cipSecTunHcInOctets']) && is_numeric($tunnel['cipSecTunHcInDecompOctets']) &&
             is_numeric($tunnel['cipSecTunHcOutOctets']) && is_numeric($tunnel['cipSecTunHcOutUncompOctets']))
       {
         echo("HC ");
    diff --git a/includes/polling/cisco-cef.inc.php b/includes/polling/cisco-cef.inc.php
    index 44675d2bc..ac2857128 100755
    --- a/includes/polling/cisco-cef.inc.php
    +++ b/includes/polling/cisco-cef.inc.php
    @@ -10,7 +10,7 @@ if ($debug) { print_r($cefs); }
     
     if (is_array($cefs))
     {
    -  if (!is_array($entity_array)) 
    +  if (!is_array($entity_array))
       {
         echo("Caching OIDs: ");
         $entity_array = array();
    diff --git a/includes/polling/functions.inc.php b/includes/polling/functions.inc.php
    index 221a351ac..71b42ba9c 100644
    --- a/includes/polling/functions.inc.php
    +++ b/includes/polling/functions.inc.php
    @@ -9,7 +9,7 @@ function poll_sensor($device, $class, $unit)
         echo("Checking $class " . $sensor['sensor_descr'] . "... ");
     
         if($class == "temperature")
    -    {  
    +    {
           for ($i = 0;$i < 5;$i++) # Try 5 times to get a valid temp reading
           {
             if ($debug) echo("Attempt $i ");
    @@ -32,13 +32,13 @@ function poll_sensor($device, $class, $unit)
     
         #$rrd_file = $config['rrd_dir']."/".$device['hostname']."/".safename("sensor-".$sensor['sensor_class']."-".$sensor['sensor_type']."-".$sensor['sensor_index'] . ".rrd");
     
    -    ## FIXME - sensor name format change 2011/04/26 - remove this in $amount_of_time. 
    +    ## FIXME - sensor name format change 2011/04/26 - remove this in $amount_of_time.
         ## We don't want to reduce performance forever because douchebags don't svn up!
         $old_rrd_file = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("$class-" . $sensor['sensor_descr'] . ".rrd");
         $old_rrd_file_b = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("$class-" . $sensor['sensor_index'] . ".rrd");
    -    if (is_file($old_rrd_file) && is_file($old_rrd_file_b)) 
    -    { 
    -      rename($old_rrd_file, $rrd_file); 
    +    if (is_file($old_rrd_file) && is_file($old_rrd_file_b))
    +    {
    +      rename($old_rrd_file, $rrd_file);
           unlink($old_rrd_file_b);
         } elseif (is_file($old_rrd_file)) {
           rename($old_rrd_file, $rrd_file);
    diff --git a/includes/polling/ipmi.inc.php b/includes/polling/ipmi.inc.php
    index c3b9e4b5b..90478282e 100644
    --- a/includes/polling/ipmi.inc.php
    +++ b/includes/polling/ipmi.inc.php
    @@ -27,7 +27,7 @@ if ($ipmi['host'] = get_dev_attrib($device,'ipmi_hostname'))
     
         $rrd_file = get_sensor_rrd($device, $ipmisensors);
     
    -    ## FIXME - sensor name format change 2011/04/26 - remove this in $amount_of_time. 
    +    ## FIXME - sensor name format change 2011/04/26 - remove this in $amount_of_time.
         ## We don't want to reduce performance forever because douchebags don't svn up!
         $old_rrd_file = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename($ipmisensors['sensor_class'].'-'.$ipmisensors['sensor_type'].'-'.$ipmisensors['sensor_index'] . ".rrd");
     
    diff --git a/includes/polling/junose-atm-vp.inc.php b/includes/polling/junose-atm-vp.inc.php
    index 3e0d4c1ee..3f4a46faa 100755
    --- a/includes/polling/junose-atm-vp.inc.php
    +++ b/includes/polling/junose-atm-vp.inc.php
    @@ -30,7 +30,7 @@ if (count($vp_rows))
         $vp_update .= ":".$t_vp['juniAtmVpStatsInPackets'].":".$t_vp['juniAtmVpStatsOutPackets'];
         $vp_update .= ":".$t_vp['juniAtmVpStatsInPacketOctets'].":".$t_vp['juniAtmVpStatsOutPacketOctets'];
         $vp_update .= ":".$t_vp['juniAtmVpStatsInPacketErrors'].":".$t_vp['juniAtmVpStatsOutPacketErrors'];
    -   
    +
         $rrd  = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("vp-" . $vp['ifIndex'] . "-".$vp['vp_id'].".rrd");
     
         if ($debug) { echo("$rrd "); }
    diff --git a/includes/polling/os/sentry3.inc.php b/includes/polling/os/sentry3.inc.php
    index a177761db..ec8bc5779 100644
    --- a/includes/polling/os/sentry3.inc.php
    +++ b/includes/polling/os/sentry3.inc.php
    @@ -1,6 +1,6 @@
      $port)
           $ports[$port['ifIndex']] = dbFetchRow("SELECT * FROM `ports` WHERE `interface_id` = ?", array($interface_id));
           echo("Adding: ".$port['ifName']."(".$ifIndex.")(".$ports[$port['ifIndex']]['interface_id'].")");
           #print_r($ports);
    -    } elseif ($ports[$ifIndex]['deleted'] == "1") {   
    +    } elseif ($ports[$ifIndex]['deleted'] == "1") {
           dbUpdate(array('deleted' => '0'), 'ports', '`interface_id` = ?', array($ports[$ifIndex]['interface_id']));
           $ports[$ifIndex]['deleted'] = "0";
         }
    diff --git a/includes/polling/toner.inc.php b/includes/polling/toner.inc.php
    index 0c49b3f26..28bda4618 100755
    --- a/includes/polling/toner.inc.php
    +++ b/includes/polling/toner.inc.php
    @@ -36,7 +36,7 @@ if ($config['enable_printers'])
     
         #FIXME should report for toner out... :)
     
    -    # Log toner swap    
    +    # Log toner swap
         if ($tonerperc > $toner['toner_current'])
         {
           log_event('Toner ' . $toner['toner_descr'] . ' was replaced (new level: ' . $tonerperc . '%)', $device, 'toner', $toner['toner_id']);
    diff --git a/includes/polling/wifi.inc.php b/includes/polling/wifi.inc.php
    index 471fb1a8b..53e7a65f2 100644
    --- a/includes/polling/wifi.inc.php
    +++ b/includes/polling/wifi.inc.php
    @@ -45,7 +45,7 @@ if ($device['type'] == 'network' || $device['type'] == 'firewall')
           unset($wirelesscards);
         }
       }
    -  
    +
       if ($device['os'] == 'symbol' AND (stristr($device['hardware'],"AP")))
       {
         echo("Checking Symbol Wireless clients... ");
    diff --git a/includes/rewrites.php b/includes/rewrites.php
    index 158cc3e2b..a2cb21576 100644
    --- a/includes/rewrites.php
    +++ b/includes/rewrites.php
    @@ -303,9 +303,9 @@ $rewrite_extreme_hardware = array (
     '.1.3.6.1.4.1.1916.2.79' => 'Summit X450e-48p',
     '.1.3.6.1.4.1.1916.2.62' => 'Black Diamond 8810',
     '.1.3.6.1.4.1.1916.2.67' => 'SummitStack',
    -'.1.3.6.1.4.1.1916.2.100' => 'Summit x150-24t', 
    +'.1.3.6.1.4.1.1916.2.100' => 'Summit x150-24t',
     '.1.3.6.1.4.1.1916.2.114' => 'Summit x650-24x',
    -'.1.3.6.1.4.1.1916.2.129' => 'NWI-e450a', 
    +'.1.3.6.1.4.1.1916.2.129' => 'NWI-e450a',
     '.1.3.6.1.4.1.1916.2.133' => 'Summit x480-48t',
     '.1.3.6.1.4.1.1916.2.141' => 'Summit x480-48x',
     );
    diff --git a/includes/rrdtool.inc.php b/includes/rrdtool.inc.php
    index 79a91c7ae..1a6038220 100644
    --- a/includes/rrdtool.inc.php
    +++ b/includes/rrdtool.inc.php
    @@ -41,7 +41,7 @@ function rrdtool($command, $file, $options)
       global $config, $debug;
     
       $command = $config['rrdtool'] . " $command $file $options";
    -  if ($config['rrdcached']) 
    +  if ($config['rrdcached'])
       {
         $command .= " --daemon " . $config['rrdcached'];
       }
    diff --git a/includes/services.inc.php b/includes/services.inc.php
    index 6cc546739..e7540b84e 100644
    --- a/includes/services.inc.php
    +++ b/includes/services.inc.php
    @@ -7,10 +7,10 @@ function add_service($device, $service)
     {
       echo("$service ");
     
    -  $insert = array('device_id' => $device['device_id'], 'service_ip' => $device['hostname'], 'service_type' => $service, 
    +  $insert = array('device_id' => $device['device_id'], 'service_ip' => $device['hostname'], 'service_type' => $service,
                       'service_desc' => "auto discovered: $service", 'service_param' => "", 'service_ignore' => "0");
     
    -  return dbInsert($insert, 'services');    
    +  return dbInsert($insert, 'services');
     }
     
     
    diff --git a/includes/services/dns/check.inc b/includes/services/dns/check.inc
    index d8fb11c2c..28fa47993 100644
    --- a/includes/services/dns/check.inc
    +++ b/includes/services/dns/check.inc
    @@ -7,10 +7,10 @@ $check = shell_exec($config['nagios_plugins'] . "/check_dns -H ".$nsquery." -s "
     
     list($check, $time) = split("\|", $check);
     
    -if(strstr($check, "DNS OK: ")) { 
    -  $status = '1'; 
    -} else { 
    -  $status = '0'; 
    +if(strstr($check, "DNS OK: ")) {
    +  $status = '1';
    +} else {
    +  $status = '0';
     }
     
     ?>
    diff --git a/includes/services/ftp/check.inc b/includes/services/ftp/check.inc
    index b5ce241f4..67a8bed09 100644
    --- a/includes/services/ftp/check.inc
    +++ b/includes/services/ftp/check.inc
    @@ -4,10 +4,10 @@ $check = shell_exec($config['nagios_plugins'] . "/check_ftp -H ".$service['hostn
     
     list($check, $time) = split("\|", $check);
     
    -if(strstr($check, "FTP OK - ")) { 
    -  $status = '1'; 
    -} else { 
    -  $status = '0'; 
    +if(strstr($check, "FTP OK - ")) {
    +  $status = '1';
    +} else {
    +  $status = '0';
     }
     
     ?>
    diff --git a/includes/services/http/check.inc b/includes/services/http/check.inc
    index d191b7124..1a686865e 100644
    --- a/includes/services/http/check.inc
    +++ b/includes/services/http/check.inc
    @@ -4,10 +4,10 @@ $check = shell_exec($config['nagios_plugins'] . "/check_http -H ".$service['host
     
     list($check, $time) = split("\|", $check);
     
    -if(strstr($check, "HTTP OK")) { 
    -  $status = '1'; 
    -} else { 
    -  $status = '0'; 
    +if(strstr($check, "HTTP OK")) {
    +  $status = '1';
    +} else {
    +  $status = '0';
     }
     
     ?>
    diff --git a/includes/services/imap/check.inc b/includes/services/imap/check.inc
    index 36dad2ef9..c57d3cdf1 100644
    --- a/includes/services/imap/check.inc
    +++ b/includes/services/imap/check.inc
    @@ -4,10 +4,10 @@ $check = shell_exec($config['nagios_plugins'] . "/check_imap -H ".$service['host
     
     list($check, $time) = split("\|", $check);
     
    -if(strstr($check, "IMAP OK - ")) { 
    -  $status = '1'; 
    -} else { 
    -  $status = '0'; 
    +if(strstr($check, "IMAP OK - ")) {
    +  $status = '1';
    +} else {
    +  $status = '0';
     }
     
     ?>
    diff --git a/includes/services/mysql/check.inc b/includes/services/mysql/check.inc
    index d63f36f9f..93c97199c 100644
    --- a/includes/services/mysql/check.inc
    +++ b/includes/services/mysql/check.inc
    @@ -7,10 +7,10 @@ $check = shell_exec($config['nagios_plugins'] . "/check_mysql -H ".$service['hos
     
     list($check, $time) = split("\|", $check);
     
    -if(strstr($check, "Uptime:")) { 
    -  $status = '1'; 
    -} else { 
    -  $status = '0'; 
    +if(strstr($check, "Uptime:")) {
    +  $status = '1';
    +} else {
    +  $status = '0';
     }
     
     ?>
    diff --git a/includes/services/pop/check.inc b/includes/services/pop/check.inc
    index d88fde414..32db04d15 100644
    --- a/includes/services/pop/check.inc
    +++ b/includes/services/pop/check.inc
    @@ -4,10 +4,10 @@ $check = shell_exec($config['nagios_plugins'] . "/check_pop -H ".$service['hostn
     
     list($check, $time) = split("\|", $check);
     
    -if(strstr($check, "POP OK - ")) { 
    -  $status = '1'; 
    -} else { 
    -  $status = '0'; 
    +if(strstr($check, "POP OK - ")) {
    +  $status = '1';
    +} else {
    +  $status = '0';
     }
     
     ?>
    diff --git a/includes/services/simap/check.inc b/includes/services/simap/check.inc
    index f942b31f3..347fb16b7 100644
    --- a/includes/services/simap/check.inc
    +++ b/includes/services/simap/check.inc
    @@ -4,10 +4,10 @@ $check = shell_exec($config['nagios_plugins'] . "/check_simap -H ".$service['hos
     
     list($check, $time) = split("\|", $check);
     
    -if(strstr($check, "SIMAP OK")) { 
    -  $status = '1'; 
    -} else { 
    -  $status = '0'; 
    +if(strstr($check, "SIMAP OK")) {
    +  $status = '1';
    +} else {
    +  $status = '0';
     }
     
     ?>
    diff --git a/includes/services/smtp/check.inc b/includes/services/smtp/check.inc
    index 385f6cf5e..aa9b7425a 100644
    --- a/includes/services/smtp/check.inc
    +++ b/includes/services/smtp/check.inc
    @@ -4,10 +4,10 @@ $check = shell_exec($config['nagios_plugins'] . "/check_smtp -H ".$service['host
     
     list($check, $time) = split("\|", $check);
     
    -if(strstr($check, "SMTP OK")) { 
    -  $status = '1'; 
    -} else { 
    -  $status = '0'; 
    +if(strstr($check, "SMTP OK")) {
    +  $status = '1';
    +} else {
    +  $status = '0';
     }
     
     ?>
    diff --git a/includes/services/spop/check.inc b/includes/services/spop/check.inc
    index d1888c902..33fe89cb6 100644
    --- a/includes/services/spop/check.inc
    +++ b/includes/services/spop/check.inc
    @@ -4,10 +4,10 @@ $check = shell_exec($config['nagios_plugins'] . "/check_spop -H ".$service['host
     
     list($check, $time) = split("\|", $check);
     
    -if(strstr($check, "SPOP OK")) { 
    -  $status = '1'; 
    -} else { 
    -  $status = '0'; 
    +if(strstr($check, "SPOP OK")) {
    +  $status = '1';
    +} else {
    +  $status = '0';
     }
     
     ?>
    diff --git a/includes/services/ssh/check.inc b/includes/services/ssh/check.inc
    index 348720357..72bf4c2c5 100644
    --- a/includes/services/ssh/check.inc
    +++ b/includes/services/ssh/check.inc
    @@ -4,10 +4,10 @@ $check = shell_exec($config['nagios_plugins'] . "/check_ssh -H ".$service['hostn
     
     list($check, $time) = split("\|", $check);
     
    -if(strstr($check, "SSH OK")) { 
    -  $status = '1'; 
    -} else { 
    -  $status = '0'; 
    +if(strstr($check, "SSH OK")) {
    +  $status = '1';
    +} else {
    +  $status = '0';
     }
     
     ?>
    diff --git a/includes/services/telnet/check.inc b/includes/services/telnet/check.inc
    index 8ac486521..519cecef4 100644
    --- a/includes/services/telnet/check.inc
    +++ b/includes/services/telnet/check.inc
    @@ -6,10 +6,10 @@ $check = shell_exec($config['nagios_plugins'] . "/check_telnet -H ".$service['ho
     
     list($check, $time) = split("\|", $check);
     
    -if(strstr($check, "TCP OK - ")) { 
    -  $status = '1'; 
    -} else { 
    -  $status = '0'; 
    +if(strstr($check, "TCP OK - ")) {
    +  $status = '1';
    +} else {
    +  $status = '0';
     }
     
     ?>
    diff --git a/includes/syslog.php b/includes/syslog.php
    index 37c0497bd..c1ece7873 100755
    --- a/includes/syslog.php
    +++ b/includes/syslog.php
    @@ -16,7 +16,7 @@ function get_cache($host, $value){
             //If failed, try by IP
             if(!is_numeric($dev_cache[$host]['device_id'])) {
               $dev_cache[$host]['device_id'] = dbFetchCell('SELECT `device_id` FROM `ipv4_addresses` AS A, `ports` AS I WHERE A.ipv4_address = ? AND I.interface_id = A.interface_id', array($host));
    -        } 
    +        }
             break;
           case 'os':
             $dev_cache[$host]['os'] = dbFetchCell('SELECT `os` FROM devices WHERE `device_id` = ?', array(get_cache($host, 'device_id')));
    @@ -42,7 +42,7 @@ function process_syslog ($entry, $update) {
           echo('D-'.$bi);
           return $entry;
         }
    -    
    +
       $entry['device_id'] = get_cache($entry['host'], 'device_id');
       if($entry['device_id']) {
         $os = get_cache($entry['host'], 'os');
    @@ -137,7 +137,7 @@ function process_syslog ($entry, $update) {
           dbInsert(
             array(
               'device_id' => $entry['device_id'],
    -          'program' => $entry['program'], 
    +          'program' => $entry['program'],
               'facility' => $entry['facility'],
               'priority' => $entry['priority'],
               'level' => $entry['level'],
    @@ -149,7 +149,7 @@ function process_syslog ($entry, $update) {
           );
         unset($os);
       }
    -  return $entry; 
    +  return $entry;
     }
     
     ?>
    diff --git a/irc.php b/irc.php
    index 2f6a043f3..006882248 100755
    --- a/irc.php
    +++ b/irc.php
    @@ -28,7 +28,7 @@ class observiumbot
     
     
     ###
    -# Get HELP! 
    +# Get HELP!
     ###
       function help_info(&$irc, &$data)
       {
    @@ -46,7 +46,7 @@ mysql_close();
     
     
     ###
    -# Get status on !version 
    +# Get status on !version
     ###
       function version_info(&$irc, &$data)
       {
    @@ -63,7 +63,7 @@ mysql_close();
       }
     
     ###
    -# Get last eventlog entry 
    +# Get last eventlog entry
     ###
       function log_info(&$irc, &$data)
       {
    @@ -200,7 +200,7 @@ echo "LISTDEVICES\n";
     
     
     ###
    -# !status  gives overall status 
    +# !status  gives overall status
     ###
       function status_info(&$irc, &$data)
       {
    diff --git a/poll-billing.php b/poll-billing.php
    index 246a5cf33..1a4f4664a 100755
    --- a/poll-billing.php
    +++ b/poll-billing.php
    @@ -93,8 +93,8 @@ function CollectData($bill_id)
     
       }
     
    -  if($period < "0") { 
    -    logfile("BILLING: negative period! id:$bill_id period:$period delta:$delta in_delta:$in_delta out_delta:$out_delta"); 
    +  if($period < "0") {
    +    logfile("BILLING: negative period! id:$bill_id period:$period delta:$delta in_delta:$in_delta out_delta:$out_delta");
       } else {
         dbInsert(array('bill_id' => $bill_id, 'timestamp' => $now, 'period' => $period, 'delta' => $delta, 'in_delta' => $in_delta, 'out_delta' => $out_delta), 'bill_data');
       }
    diff --git a/poller.php b/poller.php
    index 8c51f4825..63705c54a 100755
    --- a/poller.php
    +++ b/poller.php
    @@ -46,7 +46,7 @@ if (isset($options['i']) && $options['i'] && isset($options['n']))
                   (
                     SELECT @rownum := @rownum +1 AS rownum, `device_id`
                     FROM `devices`
    -                WHERE `disabled` = 0 
    +                WHERE `disabled` = 0
                     ORDER BY `device_id` ASC
                   ) temp
                 WHERE MOD(temp.rownum, '.mres($options['i']).') = '.mres($options['n']).';';
    @@ -121,7 +121,7 @@ function poll_device($device, $options) {
       }
       echo("\n");
     
    -  unset($poll_update); unset($poll_update_query); unset($poll_separator); 
    +  unset($poll_update); unset($poll_update_query); unset($poll_separator);
       $poll_update_array = array();
     
       $host_rrd = $config['rrd_dir'] . "/" . $device['hostname'];
    @@ -209,13 +209,13 @@ if (!$options['m'])
     
         $device_end = utime(); $device_run = $device_end - $device_start; $device_time = substr($device_run, 0, 5);
     
    -    $update_array['last_polled'] = array('NOW()'); 
    +    $update_array['last_polled'] = array('NOW()');
         $update_array['last_polled_timetaken'] = $device_time;
     
         #echo("$device_end - $device_start; $device_time $device_run");
         echo("Polled in $device_time seconds\n");
     
    -    
    +
     
         if ($debug) { echo("Updating " . $device['hostname'] . " - ".print_r($update_array)." \n"); }
     
    @@ -232,7 +232,7 @@ if (!$options['m'])
     
       $poller_end = utime(); $poller_run = $poller_end - $poller_start; $poller_time = substr($poller_run, 0, 5);
     
    -  if ($polled_devices)  
    +  if ($polled_devices)
       {
         dbInsert(array('type' => 'poll', 'doing' => $doing, 'start' => $poller_start, 'duration' => $poller_time, 'devices' => $polled_devices ), 'perf_times');
       }
    diff --git a/upgrade-scripts/fix-port-rrd.php b/upgrade-scripts/fix-port-rrd.php
    index dcea7de52..9862af1b8 100755
    --- a/upgrade-scripts/fix-port-rrd.php
    +++ b/upgrade-scripts/fix-port-rrd.php
    @@ -23,20 +23,20 @@
     			echo(round(($i / $count) * 100, 2) . "%  \r");
     	}
     
    -	function getDirectoryTree( $outerDir, &$files = array()){ 
    +	function getDirectoryTree( $outerDir, &$files = array()){
     
    -		$dirs = array_diff( scandir( $outerDir ), Array( ".", ".." ) ); 
    -    		foreach ( $dirs as $d ){ 
    -        		if (is_dir($outerDir."/".$d)  ){ 
    +		$dirs = array_diff( scandir( $outerDir ), Array( ".", ".." ) );
    +    		foreach ( $dirs as $d ){
    +        		if (is_dir($outerDir."/".$d)  ){
     				getDirectoryTree($outerDir.'/'. $d, $files);
    -        		}else{ 
    +        		}else{
     				if (preg_match('/^[\d]+.rrd$/', $d))
     					array_push($files, preg_replace('/\/+/', '/',  $outerDir.'/'. $d));
     
     			}
    -    		} 
    -  		return $files; 
    -	} 
    +    		}
    +  		return $files;
    +	}
     
     
     	function fixRdd($file){
    @@ -44,7 +44,7 @@
                     global $rrdcached;
     		$fileC = shell_exec( "{$config['rrdtool']} dump $file $rrdcached" );
     
    -#---------------------------------------------------------------------------------------------------------		
    +#---------------------------------------------------------------------------------------------------------
     
     $first = <<
    @@ -125,7 +125,7 @@ $first = << 0 
             
     
    - 
    +
     FIRST;
     
     
    @@ -185,9 +185,9 @@ THIRD;
     
     #---------------------------------------------------------------------------------------------------------
     		if (!preg_match('/DISCARDS/', $fileC)){
    -			$fileC = str_replace('', $first, $fileC);		
    -			$fileC = str_replace('', $second, $fileC);		
    -			$fileC = str_replace('', $third, $fileC);		
    +			$fileC = str_replace('', $first, $fileC);
    +			$fileC = str_replace('', $second, $fileC);
    +			$fileC = str_replace('', $third, $fileC);
     			$tmpfname = tempnam("/tmp", "OBS");
     			file_put_contents($tmpfname, $fileC);
     			@unlink($file);
    @@ -198,9 +198,9 @@ THIRD;
     
     		}
     
    -		
    +
     	}
    -	
    +
     	echo("\n");
     
     ?>
    diff --git a/upgrade-scripts/fix-sensor-rrd.php b/upgrade-scripts/fix-sensor-rrd.php
    index 8d1aca995..df373de71 100755
    --- a/upgrade-scripts/fix-sensor-rrd.php
    +++ b/upgrade-scripts/fix-sensor-rrd.php
    @@ -18,13 +18,13 @@
     			echo(round(($i / $count) * 100, 2) . "%  \r");
     	}
     
    -	function sensor_getDirectoryTree( $outerDir, &$files = array()){ 
    +	function sensor_getDirectoryTree( $outerDir, &$files = array()){
     
    -		$dirs = array_diff( scandir( $outerDir ), Array( ".", ".." ) ); 
    -    		foreach ( $dirs as $d ){ 
    -        		if (is_dir($outerDir."/".$d)  ){ 
    +		$dirs = array_diff( scandir( $outerDir ), Array( ".", ".." ) );
    +    		foreach ( $dirs as $d ){
    +        		if (is_dir($outerDir."/".$d)  ){
     				sensor_getDirectoryTree($outerDir.'/'. $d, $files);
    -        		} else { 
    +        		} else {
     				if ((preg_match('/^fan-.*.rrd$/', $d)) ||
     				     (preg_match('/^current-.*.rrd$/', $d)) ||
     				     (preg_match('/^freq-.*.rrd$/', $d)) ||
    @@ -34,9 +34,9 @@
     					array_push($files, preg_replace('/\/+/', '/',  $outerDir.'/'. $d));
     
     			}
    -    		} 
    -  		return $files; 
    -	} 
    +    		}
    +  		return $files;
    +	}
     
     
     	function sensor_fixRdd($file){
    @@ -72,7 +72,7 @@
     		  rename($file,str_replace('/temp-','/temperature-',$file));
     		}
     	}
    -	
    +
     	echo("\n");
     
     ?>