diff --git a/discovery.php b/discovery.php index 7dc0133bc..e1b2058c5 100755 --- a/discovery.php +++ b/discovery.php @@ -72,7 +72,6 @@ if (isset($options['d'])) # ini_set('error_reporting', 0); } - if (!$where) { echo("-h | Poll single device\n"); @@ -179,7 +178,6 @@ if(!isset($options['q'])) { echo("\n"); } - logfile($string); ?> diff --git a/html/billing-graph.php b/html/billing-graph.php index 5e9c25fef..32826ab18 100755 --- a/html/billing-graph.php +++ b/html/billing-graph.php @@ -184,7 +184,6 @@ $lineplot->SetFillColor("#d5d5d5@0.5"); #$lineplot2->SetColor("#d5d5d5"); #$lineplot2->SetFillColor("#d5d5d5@0.5"); - $lineplot_in = new LinePlot($in_data, $ticks); $lineplot_in->SetLegend("Traffic In"); diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index b299dc41e..efeca9f16 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -5,7 +5,6 @@ function generate_link($text, $vars, $new_vars = array()) return ''.$text.''; } - function generate_url($vars, $new_vars = array()) { @@ -42,7 +41,6 @@ function generate_overlib_content($graph_array, $text) } - function get_percentage_colours($percentage) { diff --git a/html/includes/graphs/application/apache_scoreboard.inc.php b/html/includes/graphs/application/apache_scoreboard.inc.php index d04243c6c..bf9237f4a 100755 --- a/html/includes/graphs/application/apache_scoreboard.inc.php +++ b/html/includes/graphs/application/apache_scoreboard.inc.php @@ -6,7 +6,6 @@ include("includes/graphs/common.inc.php"); $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-apache-".$app['app_id'].".rrd"; - $array = array('sb_reading' => array('descr' => 'Reading', 'colour' => '750F7DFF'), 'sb_writing' => array('descr' => 'Writing', 'colour' => '00FF00FF'), 'sb_wait' => array('descr' => 'Waiting', 'colour' => '4444FFFF'), @@ -19,7 +18,6 @@ $array = array('sb_reading' => array('descr' => 'Reading', 'colour' => '750F7DFF 'sb_idle' => array('descr' => 'Idle', 'colour' => 'FF4105FF'), ); - $i = 0; if (is_file($rrd_filename)) { @@ -39,5 +37,4 @@ $unit_text = "Workers"; include("includes/graphs/generic_multi_simplex_seperated.inc.php"); - ?> diff --git a/html/includes/graphs/bgp/auth.inc.php b/html/includes/graphs/bgp/auth.inc.php index 80ed0913a..6dca0048a 100644 --- a/html/includes/graphs/bgp/auth.inc.php +++ b/html/includes/graphs/bgp/auth.inc.php @@ -15,7 +15,4 @@ if (is_numeric($id)) } } - - - ?> diff --git a/html/includes/graphs/bill/bits.inc.php b/html/includes/graphs/bill/bits.inc.php index 4c95cf625..10b000d13 100644 --- a/html/includes/graphs/bill/bits.inc.php +++ b/html/includes/graphs/bill/bits.inc.php @@ -36,7 +36,6 @@ if($bill['bill_type'] == "cdr") { $custom_graph .= " HRULE:" . $rates['rate_average'] * 1000 * -1 . "#cc0000"; } - include("includes/graphs/generic_multi_bits_separated.inc.php"); ?> diff --git a/html/includes/graphs/common.inc.php b/html/includes/graphs/common.inc.php index 88bf253c8..d4677f596 100644 --- a/html/includes/graphs/common.inc.php +++ b/html/includes/graphs/common.inc.php @@ -10,14 +10,12 @@ if ($_GET['legend'] == "no") { $rrd_options = " -g"; } if ($_GET['title'] == "yes") { $rrd_options .= " --title='".$graph_title."' "; } if (isset($_GET['graph_title'])) { $rrd_options .= " --title='".$_GET['graph_title']."' "; } - #if (!isset($scale_min) && !isset($scale_max)) { $rrd_options .= " --alt-autoscale-max"; } if (isset($scale_min)) { $rrd_options .= " -l $scale_min"; } if (isset($scale_max)) { $rrd_options .= " -u $scale_max"; } if (isset($scale_rigid)) { $rrd_options .= " -r"; } - $rrd_options .= " -E --start ".$from." --end " . $to . " --width ".$width." --height ".$height." "; $rrd_options .= $config['rrdgraph_def_text']; diff --git a/html/includes/graphs/device/collectd.inc.php b/html/includes/graphs/device/collectd.inc.php index e0b748d6f..b6e5e6a3a 100755 --- a/html/includes/graphs/device/collectd.inc.php +++ b/html/includes/graphs/device/collectd.inc.php @@ -108,7 +108,6 @@ function error500($title, $msg) { return error(500, "Not found", $title, $msg); } - /** * Incomplete / invalid request */ @@ -210,7 +209,6 @@ if ($height < "99") { $rrd_cmd .= " --only-graph "; } if ($width <= "300") { $rrd_cmd .= " --font LEGEND:7:" . $config['mono_font'] . " --font AXIS:6:" . $config['mono_font'] . " "; } else { $rrd_cmd .= " --font LEGEND:8:" . $config['mono_font'] . " --font AXIS:7:" . $config['mono_font'] . " "; } - if (isset($_GET['debug'])) { header('Content-Type: text/plain; charset=utf-8'); printf("Would have executed:\n%s\n", $rrd_cmd); diff --git a/html/includes/graphs/device/diskio_bits.inc.php b/html/includes/graphs/device/diskio_bits.inc.php index eb3110fbf..32f61ffe4 100755 --- a/html/includes/graphs/device/diskio_bits.inc.php +++ b/html/includes/graphs/device/diskio_bits.inc.php @@ -14,5 +14,4 @@ include("includes/graphs/device/diskio_common.inc.php"); include("includes/graphs/generic_multi_bits_separated.inc.php"); - ?> diff --git a/html/includes/graphs/device/diskio_common.inc.php b/html/includes/graphs/device/diskio_common.inc.php index e34a678a6..d84aae4fb 100644 --- a/html/includes/graphs/device/diskio_common.inc.php +++ b/html/includes/graphs/device/diskio_common.inc.php @@ -15,5 +15,4 @@ foreach (dbFetchRows("SELECT * FROM `ucd_diskio` AS U, `devices` AS D WHERE D.de } } - ?> diff --git a/html/includes/graphs/device/smokeping_all_common.inc.php b/html/includes/graphs/device/smokeping_all_common.inc.php index 8aefdf0f7..23cf2a4a0 100644 --- a/html/includes/graphs/device/smokeping_all_common.inc.php +++ b/html/includes/graphs/device/smokeping_all_common.inc.php @@ -10,7 +10,6 @@ $scale_rigid = TRUE; include("includes/graphs/common.inc.php"); include("smokeping_common.inc.php"); - $i = 0; $pings = 20; $iter = 0; @@ -23,7 +22,6 @@ if($width > "500") $descr_len = 12 + round(($width - 250) / 8); } - if($width > "500") { $rrd_options .= " COMMENT:'".substr(str_pad($unit_text, $descr_len+5),0,$descr_len+5)." RTT Loss SDev RTT\:SDev\l'"; @@ -87,7 +85,6 @@ foreach ($smokeping_files[$direction][$device['hostname']] as $source => $filena $rrd_options .= " GPRINT:avsd$i:'%5.1lf%Ss'"; $rrd_options .= " GPRINT:avmsr$i:'%5.1lf%s\\l'"; - $i++; } diff --git a/html/includes/graphs/generic_bytes.inc.php b/html/includes/graphs/generic_bytes.inc.php index cf4d5db01..86d979ea1 100644 --- a/html/includes/graphs/generic_bytes.inc.php +++ b/html/includes/graphs/generic_bytes.inc.php @@ -9,7 +9,6 @@ if ($rrd_filename) { $rrd_filename_out = $rrd_filename; $rrd_filename_in = $rrd_ if ($inverse) { $in = 'out'; $out = 'in'; } else { $in = 'in'; $out = 'out'; } - if ($multiplier) { $rrd_options .= " DEF:p".$out."octets=".$rrd_filename_out.":".$ds_out.":AVERAGE"; diff --git a/html/includes/graphs/generic_multi_bits_separated.inc.php b/html/includes/graphs/generic_multi_bits_separated.inc.php index efaeb0997..cf08ef9c8 100644 --- a/html/includes/graphs/generic_multi_bits_separated.inc.php +++ b/html/includes/graphs/generic_multi_bits_separated.inc.php @@ -74,9 +74,6 @@ foreach ($rrd_list as $rrd) $i++; $iter++; } - - - if ($custom_graph) { $rrd_options .= $custom_graph; } $rrd_options .= $rrd_optionsb; diff --git a/html/includes/graphs/generic_multi_line.inc.php b/html/includes/graphs/generic_multi_line.inc.php index 990632f4a..6d401d3b1 100644 --- a/html/includes/graphs/generic_multi_line.inc.php +++ b/html/includes/graphs/generic_multi_line.inc.php @@ -10,7 +10,6 @@ if($width > "500") $descr_len += round(($width - 250) / 8); } - if ($nototal) { $descrlen += "2"; $unitlen += "2";} $unit_text = str_pad(truncate($unit_text,$unitlen),$unitlen); diff --git a/html/includes/graphs/generic_multi_simplex_seperated.inc.php b/html/includes/graphs/generic_multi_simplex_seperated.inc.php index ac29c63a6..d67f457ae 100644 --- a/html/includes/graphs/generic_multi_simplex_seperated.inc.php +++ b/html/includes/graphs/generic_multi_simplex_seperated.inc.php @@ -67,7 +67,6 @@ foreach ($rrd_list as $i => $rrd) $t_defname = $g_defname; } - $rrd_options .= " AREA:".$g_defname.$i."#".$colour.":'".substr(str_pad($rrd['descr'], $descrlen),0,$descrlen)."':$stack"; $rrd_options .= " GPRINT:".$t_defname.$i.":LAST:%6.2lf%s".str_replace("%", "%%", $units).""; $rrd_options .= " GPRINT:".$t_defname.$i."max:MAX:%6.2lf%s".str_replace("%", "%%", $units).""; diff --git a/html/includes/graphs/port/adsl_speed.inc.php b/html/includes/graphs/port/adsl_speed.inc.php index 17dd1b4e2..da0c4b20b 100644 --- a/html/includes/graphs/port/adsl_speed.inc.php +++ b/html/includes/graphs/port/adsl_speed.inc.php @@ -10,7 +10,6 @@ $rrd_list[1]['filename'] = $rrd_filename; $rrd_list[1]['descr'] = "Upstream"; $rrd_list[1]['ds'] = "AtucChanCurrTxRate"; - $unit_text = "Bits/sec"; $units=''; diff --git a/html/includes/header.inc.php b/html/includes/header.inc.php index 05f35aabd..178e4dd07 100644 --- a/html/includes/header.inc.php +++ b/html/includes/header.inc.php @@ -50,5 +50,3 @@ if (isset($_SESSION['authenticated']) && $_SESSION['authenticated']) - - diff --git a/html/includes/hostbox-basic.inc.php b/html/includes/hostbox-basic.inc.php index 11be6edbc..c1d49644b 100644 --- a/html/includes/hostbox-basic.inc.php +++ b/html/includes/hostbox-basic.inc.php @@ -26,7 +26,6 @@ $type = strtolower($device['os']); if ($device['os'] == "ios") { formatCiscoHardware($device, true); } $device['os_text'] = $config['os'][$device['os']]['text']; - echo(' ' . generate_device_link($device) . '' diff --git a/html/includes/print-interface.inc.php b/html/includes/print-interface.inc.php index 61ebb971a..405c7ce74 100644 --- a/html/includes/print-interface.inc.php +++ b/html/includes/print-interface.inc.php @@ -247,7 +247,6 @@ if ($port_details) } } - unset($int_links, $int_links_v6, $int_links_v4, $int_links_phys, $br); echo(""); diff --git a/html/includes/print-menubar.php b/html/includes/print-menubar.php index d541c32cf..5ec1f4c3a 100644 --- a/html/includes/print-menubar.php +++ b/html/includes/print-menubar.php @@ -40,7 +40,6 @@ if (isset($config['enable_bgp']) && $config['enable_bgp']) - @@ -167,7 +166,6 @@ $(document).ready(function() { }); - @@ -207,8 +205,6 @@ if ($config['show_locations']) } ?> - -
  • Ports @@ -308,12 +304,10 @@ $(document).ready(function() { }); -
  • - = '5' && ($routing_count['bgp']+$routing_count['ospf '); } - ## BGP Sessions if ($_SESSION['userlevel'] >= '5' && $routing_count['bgp']) { @@ -437,7 +430,6 @@ if ($_SESSION['userlevel'] >= '5' && ($routing_count['bgp']+$routing_count['ospf '); } - echo(' '); ?> @@ -449,17 +441,14 @@ if ($_SESSION['userlevel'] >= '5' && ($routing_count['bgp']+$routing_count['ospf } ?> - '); } ?> - - - diff --git a/html/includes/print-syslog.inc.php b/html/includes/print-syslog.inc.php index 2f02b8584..84ae43485 100644 --- a/html/includes/print-syslog.inc.php +++ b/html/includes/print-syslog.inc.php @@ -8,7 +8,6 @@ if (device_permitted($entry['device_id'])) echo(" "); - $entry['hostname'] = shorthost($entry['hostname'], 20); if ($_GET['page'] != "device") diff --git a/html/index.php b/html/index.php index 49b603a25..0bb01ddf2 100755 --- a/html/index.php +++ b/html/index.php @@ -95,7 +95,6 @@ foreach ($_POST as $name => $value) $vars[$name] = $value; } - if(strstr($_SERVER['REQUEST_URI'], 'widescreen=yes')) { $_SESSION['widescreen'] = 1; } if(strstr($_SERVER['REQUEST_URI'], 'widescreen=no')) { unset($_SESSION['widescreen']); } @@ -175,7 +174,6 @@ if ($config['page_refresh']) { echo(""); } - if ($_SESSION['authenticated']) { ## Authenticated. Print a page. diff --git a/html/pages/about.inc.php b/html/pages/about.inc.php index 0ef6521e1..e74c3f36a 100644 --- a/html/pages/about.inc.php +++ b/html/pages/about.inc.php @@ -155,7 +155,6 @@ print_optionbar_end(); Facebook

    -

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

    diff --git a/html/pages/bill.inc.php b/html/pages/bill.inc.php index 74bfbb95a..262865353 100644 --- a/html/pages/bill.inc.php +++ b/html/pages/bill.inc.php @@ -210,7 +210,6 @@ if (bill_permitted($bill_id)) $bi .= "&from=" . $unixfrom . "&to=" . $unixto; $bi .= "&width=715&height=200&total=1'>"; - $li = ""; diff --git a/html/pages/bill/delete.inc.php b/html/pages/bill/delete.inc.php index 919d2e975..625f0b08a 100644 --- a/html/pages/bill/delete.inc.php +++ b/html/pages/bill/delete.inc.php @@ -16,8 +16,6 @@ echo(" - - "); ?> diff --git a/html/pages/bill/edit.inc.php b/html/pages/bill/edit.inc.php index c0e960f97..f9db2779e 100644 --- a/html/pages/bill/edit.inc.php +++ b/html/pages/bill/edit.inc.php @@ -111,6 +111,4 @@ echo(" "); - - ?> diff --git a/html/pages/bills.inc.php b/html/pages/bills.inc.php index d24e13c0e..d0b7300f5 100644 --- a/html/pages/bills.inc.php +++ b/html/pages/bills.inc.php @@ -57,7 +57,6 @@ if ($_GET['opta'] == "add") - @@ -65,7 +64,6 @@ if ($_GET['opta'] == "add")
    - diff --git a/html/pages/customers.inc.php b/html/pages/customers.inc.php index a3f63f3f6..9a3b90ce0 100644 --- a/html/pages/customers.inc.php +++ b/html/pages/customers.inc.php @@ -52,7 +52,6 @@ foreach (dbFetchRows("SELECT * FROM `ports` WHERE `port_descr_type` = 'cust' GRO "); - unset($customer_name); } diff --git a/html/pages/device.inc.php b/html/pages/device.inc.php index 2aee5fd04..3ad68db12 100644 --- a/html/pages/device.inc.php +++ b/html/pages/device.inc.php @@ -278,7 +278,6 @@ if (device_permitted($vars['device']) || $check_device == $vars['device']) '); } - if ($_SESSION['userlevel'] >= "7") { echo('
  • diff --git a/html/pages/device/collectd.inc.php b/html/pages/device/collectd.inc.php index ab63d75f8..ff078d0ef 100644 --- a/html/pages/device/collectd.inc.php +++ b/html/pages/device/collectd.inc.php @@ -108,5 +108,4 @@ print_optionbar_end(); } - ?> diff --git a/html/pages/device/edit.inc.php b/html/pages/device/edit.inc.php index d31708d7e..04b53e2a7 100644 --- a/html/pages/device/edit.inc.php +++ b/html/pages/device/edit.inc.php @@ -16,7 +16,6 @@ if ($_SESSION['userlevel'] < '7') $panes['alerts'] = 'Alerts'; $panes['modules'] = 'Modules'; - if ($config['enable_services']) { $panes['services'] = 'Services'; diff --git a/html/pages/device/edit/device.inc.php b/html/pages/device/edit/device.inc.php index b77141916..ee00ee224 100644 --- a/html/pages/device/edit/device.inc.php +++ b/html/pages/device/edit/device.inc.php @@ -52,7 +52,6 @@ $descr = $device['purpose']; $override_sysLocation_bool = get_dev_attrib($device,'override_sysLocation_bool'); $override_sysLocation_string = get_dev_attrib($device,'override_sysLocation_string'); - if ($updated && $update_message) { print_message($update_message); diff --git a/html/pages/device/edit/modules.inc.php b/html/pages/device/edit/modules.inc.php index d93dae89c..1e9ba7ff2 100644 --- a/html/pages/device/edit/modules.inc.php +++ b/html/pages/device/edit/modules.inc.php @@ -52,7 +52,6 @@ foreach ($config['poller_modules'] as $module => $module_status) echo(($module_status ? 'enabled' : 'disabled' )); } - echo(''); echo('
    @@ -61,7 +60,6 @@ foreach ($config['poller_modules'] as $module => $module_status)
    '); - echo(''); $i++; } @@ -89,7 +87,6 @@ foreach ($config['discovery_modules'] as $module => $module_status) echo(($module_status ? 'enabled' : 'disabled' )); } - echo(''); echo('
    @@ -98,14 +95,11 @@ foreach ($config['discovery_modules'] as $module => $module_status)
    '); - echo(''); - $i++; } echo(''); echo(''); - ?> diff --git a/html/pages/device/graphs/laload.inc.php b/html/pages/device/graphs/laload.inc.php index 6eff33c4e..62a2de0c8 100644 --- a/html/pages/device/graphs/laload.inc.php +++ b/html/pages/device/graphs/laload.inc.php @@ -1,4 +1,3 @@ diff --git a/html/pages/device/health/diskio.inc.php b/html/pages/device/health/diskio.inc.php index bb9623e79..534e4dd40 100644 --- a/html/pages/device/health/diskio.inc.php +++ b/html/pages/device/health/diskio.inc.php @@ -24,7 +24,6 @@ foreach (dbFetchRows("SELECT * FROM `ucd_diskio` WHERE device_id = ? ORDER BY di $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)); echo(""); diff --git a/html/pages/device/latency.inc.php b/html/pages/device/latency.inc.php index d26b43728..5d26d870b 100644 --- a/html/pages/device/latency.inc.php +++ b/html/pages/device/latency.inc.php @@ -29,7 +29,6 @@ unset($sep); print_optionbar_end(); - if($vars['view'] == "incoming") { diff --git a/html/pages/device/nfsen.inc.php b/html/pages/device/nfsen.inc.php index 68ed31dfc..1ea3a83a2 100644 --- a/html/pages/device/nfsen.inc.php +++ b/html/pages/device/nfsen.inc.php @@ -13,5 +13,4 @@ foreach ($datas as $name=>$type) include("includes/print-device-graph.php"); } - ?> diff --git a/html/pages/device/overview.inc.php b/html/pages/device/overview.inc.php index 0cd4dbe56..f48303e1a 100644 --- a/html/pages/device/overview.inc.php +++ b/html/pages/device/overview.inc.php @@ -58,7 +58,6 @@ if ($services['total']) echo(""); } - ### FIXME - split this into overview/syslog.inc.php? $syslog = dbFetchRows("SELECT *, DATE_FORMAT(timestamp, '%Y-%m-%d %T') AS date from syslog WHERE device_id = ? ORDER BY timestamp DESC LIMIT 20", array($device['device_id'])); if (count($syslog)) diff --git a/html/pages/device/port.inc.php b/html/pages/device/port.inc.php index 83d34c582..782e52a6c 100644 --- a/html/pages/device/port.inc.php +++ b/html/pages/device/port.inc.php @@ -77,7 +77,6 @@ foreach ($menu_options as $option => $text) } unset($sep); - if (dbFetchCell("SELECT count(*) FROM mac_accounting WHERE interface_id = '".$port['interface_id']."'") > "0" ) { diff --git a/html/pages/device/port/macaccounting.inc.php b/html/pages/device/port/macaccounting.inc.php index 2fb01b806..eadd1f828 100644 --- a/html/pages/device/port/macaccounting.inc.php +++ b/html/pages/device/port/macaccounting.inc.php @@ -29,7 +29,6 @@ if ($vars['subview'] == "top10") if (!isset($vars['period'])) { $vars['period'] = "1day"; } $from = "-" . $vars['period']; - echo("
    @@ -124,7 +123,6 @@ if ($vars['subview'] == "top10") $arp_host = dbFetchRow("SELECT * FROM ipv4_addresses AS A, ports AS I, devices AS D WHERE A.ipv4_address = ? AND I.interface_id = A.interface_id AND D.device_id = I.device_id", array($addy['ipv4_address'])); if ($arp_host) { $arp_name = generate_device_link($arp_host); $arp_name .= " ".generate_port_link($arp_host); } else { unset($arp_if); } - if ($name == $addy['ipv4_address']) { unset ($name); } if (dbFetchCell("SELECT count(*) FROM bgpPeers WHERE device_id = ? AND bgpPeerIdentifier = ?", array($acc['device_id'], $addy['ipv4_address']))) { diff --git a/html/pages/device/ports.inc.php b/html/pages/device/ports.inc.php index c961379d9..2387ca722 100644 --- a/html/pages/device/ports.inc.php +++ b/html/pages/device/ports.inc.php @@ -6,7 +6,6 @@ if ($vars['view'] == 'graphs' || $vars['view'] == 'minigraphs') } if (!$vars['view']) { $vars['view'] = "basic"; } - $link_array = array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'ports'); @@ -26,7 +25,6 @@ if(dbFetchCell("SELECT COUNT(*) FROM `ports` WHERE `ifType` = 'adsl'")) $menu_options['adsl'] = 'ADSL'; } - $sep = ""; foreach ($menu_options as $option => $text) { @@ -114,5 +112,4 @@ if ($vars['view'] == 'minigraphs') echo("
    "); } - ?> diff --git a/html/pages/device/routing/cef.inc.php b/html/pages/device/routing/cef.inc.php index 7a48909d7..1649976a1 100644 --- a/html/pages/device/routing/cef.inc.php +++ b/html/pages/device/routing/cef.inc.php @@ -25,7 +25,6 @@ unset($sep); print_optionbar_end(); - echo('
    '); @@ -56,7 +55,6 @@ foreach (dbFetchRows("SELECT * FROM `cef_switching` WHERE `device_id` = ? ORDER $entity_descr = $entity['entPhysicalName'] . " (" . $entity['entPhysicalModelName'] .")"; } - echo(""); } - $i++; } diff --git a/html/pages/device/routing/ipsec_tunnels.inc.php b/html/pages/device/routing/ipsec_tunnels.inc.php index 617e24d07..8d342ef76 100644 --- a/html/pages/device/routing/ipsec_tunnels.inc.php +++ b/html/pages/device/routing/ipsec_tunnels.inc.php @@ -72,19 +72,14 @@ $graph_array['type'] = $graph_type; include("includes/print-quadgraphs.inc.php"); - echo(" "); } - echo(""); echo(""); - - - $i++; } diff --git a/html/pages/devices.inc.php b/html/pages/devices.inc.php index c252bc0b5..e43d19f2f 100644 --- a/html/pages/devices.inc.php +++ b/html/pages/devices.inc.php @@ -13,7 +13,6 @@ if ($vars['hardware']) { $where .= " AND hardware = ?"; $sql_param[] = $vars[ if ($vars['features']) { $where .= " AND features = ?"; $sql_param[] = $vars['features']; } if ($vars['type']) { $where .= " AND type = ?"; $sql_param[] = $vars['type']; } - if ($vars['location'] == "Unset") { $location_filter = ''; } if ($vars['location']) { $location_filter = $vars['location']; } @@ -219,7 +218,6 @@ foreach ($menu_options as $option => $text) echo('Remove Header'); } - ?> @@ -288,5 +286,4 @@ if($format == "graph") echo("
    ".$entity_descr." ".$cef['afi']." "); @@ -104,7 +102,6 @@ foreach (dbFetchRows("SELECT * FROM `cef_switching` WHERE `device_id` = ? ORDER echo("
    "); } - ?> diff --git a/html/pages/front/demo.php b/html/pages/front/demo.php index 998492eb1..d6d503394 100644 --- a/html/pages/front/demo.php +++ b/html/pages/front/demo.php @@ -1,4 +1,3 @@ -
    @@ -56,7 +55,6 @@ foreach ($dev_list as $device_id => $descr) echo("
    "); - ?> @@ -82,7 +80,6 @@ while ($device = mysql_fetch_array($sql)) { if (!$already) { $nodes[] = $device['device_id']; } } - $sql = mysql_query("SELECT * FROM `devices` WHERE `status` = '0' AND `ignore` = '0'"); while ($device = mysql_fetch_array($sql)) { if (device_permitted($device['device_id'])) { diff --git a/html/pages/front/example2.php b/html/pages/front/example2.php index 3b167566e..4da7cdf75 100644 --- a/html/pages/front/example2.php +++ b/html/pages/front/example2.php @@ -101,13 +101,11 @@ echo(""); while ($entry = mysql_fetch_assoc($query)) { include("includes/print-syslog.inc.php"); } echo("
    "); - echo("
    "); - /// this stuff can be customised to show whatever you want.... if ($_SESSION['userlevel'] >= '5') diff --git a/html/pages/front/jt.php b/html/pages/front/jt.php index afcf180c3..fce32f875 100644 --- a/html/pages/front/jt.php +++ b/html/pages/front/jt.php @@ -27,7 +27,6 @@ while ($device = mysql_fetch_assoc($sql)) { if (!$already) { $nodes[] = $device['device_id']; } } - $sql = mysql_query("SELECT * FROM `devices` WHERE `status` = '0' AND `ignore` = '0'"); while ($device = mysql_fetch_assoc($sql)) { if (device_permitted($device['device_id'])) { @@ -93,7 +92,6 @@ if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $c } } - echo("
    $errorboxes
    @@ -108,13 +106,11 @@ echo(""); while ($entry = mysql_fetch_assoc($query)) { include("includes/print-syslog.inc.php"); } echo("
    "); - echo("
    "); - /// this stuff can be customised to show whatever you want.... if ($_SESSION['userlevel'] >= '5') @@ -136,13 +132,11 @@ if ($_SESSION['userlevel'] >= '5') $seperator = ","; } - $ports['broadband'] = "3294,3295,688,3534"; $ports['wave_broadband'] = "827"; $ports['new_broadband'] = "3659,4149,4121,4108,3676,4135"; - echo("
    "); if ($ports['peering'] && $ports['transit']) { @@ -197,8 +191,6 @@ if ($_SESSION['userlevel'] >= '5') "&from=".$day."&to=".$now."&width=385&height=100&legend=no&inverse=c'>
    "); } - - echo("
    "); if ($ports['broadband']) { @@ -226,7 +218,6 @@ if ($_SESSION['userlevel'] >= '5') echo("
    "); - if ($ports['wave_broadband']) { echo("
    @@ -107,13 +105,11 @@ echo(""); while ($entry = mysql_fetch_assoc($query)) { include("includes/print-syslog.inc.php"); } echo("
    "); - echo("
    "); - /// this stuff can be customised to show whatever you want.... if ($_SESSION['userlevel'] >= '5') @@ -182,7 +178,6 @@ if ($_SESSION['userlevel'] >= '5') "&from=".$day."&to=".$now."&width=155&height=100&legend=no'>
    "); } - if ($ports['core']) { echo("
    '); diff --git a/html/pages/locations.inc.php b/html/pages/locations.inc.php index 31743477c..1ae9bbabf 100644 --- a/html/pages/locations.inc.php +++ b/html/pages/locations.inc.php @@ -76,7 +76,6 @@ foreach (getlocations() as $location) include("includes/print-quadgraphs.inc.php"); - echo(""); } $done = "yes"; diff --git a/html/pages/ports/graph.inc.php b/html/pages/ports/graph.inc.php index 016104b1a..19d8622f7 100644 --- a/html/pages/ports/graph.inc.php +++ b/html/pages/ports/graph.inc.php @@ -9,7 +9,6 @@ foreach ($ports as $port) $port['in_rate'] = formatRates($port['ifInOctets_rate'] * 8); $port['out_rate'] = formatRates($port['ifOutOctets_rate'] * 8); - if ($port['in_errors'] > 0 || $port['out_errors'] > 0) { $error_img = generate_port_link($port,"Interface Errors",errors); diff --git a/html/pages/routing/bgp.inc.php b/html/pages/routing/bgp.inc.php index cc988115f..8fad2c6de 100644 --- a/html/pages/routing/bgp.inc.php +++ b/html/pages/routing/bgp.inc.php @@ -122,12 +122,10 @@ else if ($vars['graph'] == "macaccounting_pkts") { echo(""); } echo(")"); - echo('
    '); print_optionbar_end(); - echo(""); echo(''); @@ -205,7 +203,6 @@ else " . format_si($peer['bgpPeerOutUpdates']) . ""); - unset($invalid); switch ($vars['graph']) { diff --git a/html/pages/routing/overview.inc.php b/html/pages/routing/overview.inc.php index f6c1432b5..9c5959f9f 100644 --- a/html/pages/routing/overview.inc.php +++ b/html/pages/routing/overview.inc.php @@ -22,5 +22,4 @@ } } - ?> diff --git a/includes/billing.php b/includes/billing.php index 432a7345c..8d59ec2be 100644 --- a/includes/billing.php +++ b/includes/billing.php @@ -26,7 +26,6 @@ function getDates($dayofmonth) $lastyear = $year; } - $date_from = $year . $month . $dayofmonth; $date_to = $newyear . $newmonth . $dayofmonth; @@ -58,7 +57,6 @@ function getDates($dayofmonth) $lastyear = $year; } - $date_from = $newyear . $newmonth . $dayofmonth; $date_to = $year . $month . $dayofmonth; @@ -75,7 +73,6 @@ function getDates($dayofmonth) return($return); } - function getValue($host, $port, $id, $inout) { global $config; @@ -177,7 +174,6 @@ function getRates($bill_id,$datefrom,$dateto) $mtot = getTotal($bill_id,$datefrom,$dateto); $ptot = getPeriod($bill_id,$datefrom,$dateto); - $data['rate_95th_in'] = get95thIn($bill_id,$datefrom,$dateto); $data['rate_95th_out'] = get95thOut($bill_id,$datefrom,$dateto); @@ -210,5 +206,4 @@ function getPeriod($bill_id,$datefrom,$dateto) return($ptot); } - ?> diff --git a/includes/common.php b/includes/common.php index 8223b4cba..60b8ef292 100644 --- a/includes/common.php +++ b/includes/common.php @@ -143,7 +143,6 @@ function port_by_id_cache($port_id) return $port; } - function get_port_by_id($port_id) { if (is_numeric($port_id)) diff --git a/includes/console_colour.php b/includes/console_colour.php index 87a653f1a..5dea189ff 100644 --- a/includes/console_colour.php +++ b/includes/console_colour.php @@ -31,7 +31,6 @@ * @link http://pear.php.net/package/Console_Color */ - $GLOBALS['_CONSOLE_COLOR_CODES'] = array ( 'color' => array( 'black' => 30, @@ -68,7 +67,6 @@ $GLOBALS['_CONSOLE_COLOR_CODES'] = array ( ) ); - /** * A simple class to use ANSI Colorcodes. * diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index e328443c4..3774a6790 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -180,7 +180,6 @@ $config['rancid_ignorecomments'] = 0; # Ignore lines starting with # #$config['collectd_dir'] = '/var/lib/collectd/rrd'; #$config['smokeping']['dir'] = "/var/lib/smokeping/"; - # NFSen RRD dir. $config['nfsen_enable'] = 0; #$config['nfsen_split_char'] = "_"; diff --git a/includes/discovery/cisco-cef.inc.php b/includes/discovery/cisco-cef.inc.php index 07f81a16e..1a3c7fd00 100755 --- a/includes/discovery/cisco-cef.inc.php +++ b/includes/discovery/cisco-cef.inc.php @@ -30,7 +30,6 @@ 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."' AND `afi` = '".$afi."' AND `cef_index` = '".$path."'"),0) != "1") { diff --git a/includes/discovery/current.inc.php b/includes/discovery/current.inc.php index 608b98122..ba5e06c52 100644 --- a/includes/discovery/current.inc.php +++ b/includes/discovery/current.inc.php @@ -6,7 +6,6 @@ echo("Current: "); $include_dir = "includes/discovery/current"; include("includes/include-dir.inc.php"); - if ($debug) { print_r($valid['sensor']['current']); } check_valid_sensors($device, 'current', $valid['sensor']); diff --git a/includes/discovery/current/gamatronicups.inc.php b/includes/discovery/current/gamatronicups.inc.php index 9861e54f5..03dad6c25 100644 --- a/includes/discovery/current/gamatronicups.inc.php +++ b/includes/discovery/current/gamatronicups.inc.php @@ -1,7 +1,5 @@ diff --git a/includes/discovery/os/linux.inc.php b/includes/discovery/os/linux.inc.php index 8b15db35a..db3b014a7 100755 --- a/includes/discovery/os/linux.inc.php +++ b/includes/discovery/os/linux.inc.php @@ -4,7 +4,6 @@ if (!$os) { if (preg_match("/^Linux/", $sysDescr)) { $os = "linux"; } - ## Specific Linux-derivatives if ($os == "linux") { diff --git a/includes/discovery/ports.inc.php b/includes/discovery/ports.inc.php index 16692c197..4bebb7cd5 100755 --- a/includes/discovery/ports.inc.php +++ b/includes/discovery/ports.inc.php @@ -4,7 +4,6 @@ echo("Ports : "); - $ports = array(); $ports = snmpwalk_cache_oid($device, "ifDescr", $port_stats, "IF-MIB"); #$ports = snmpwalk_cache_oid($device, "ifName", $port_stats, "IF-MIB"); diff --git a/includes/discovery/processors/procurve.inc.php b/includes/discovery/processors/procurve.inc.php index 43aad036b..2b04d6640 100755 --- a/includes/discovery/processors/procurve.inc.php +++ b/includes/discovery/processors/procurve.inc.php @@ -5,7 +5,6 @@ ## ## STATISTICS-MIB::hpSwitchCpuStat.0 = INTEGER: 10 - if ($device['os'] == "procurve") { echo("Procurve : "); diff --git a/includes/discovery/storage/hrstorage.inc.php b/includes/discovery/storage/hrstorage.inc.php index 7599bd087..6183658f8 100755 --- a/includes/discovery/storage/hrstorage.inc.php +++ b/includes/discovery/storage/hrstorage.inc.php @@ -34,7 +34,6 @@ if (is_array($hrstorage_array)) break; } - foreach ($config['ignore_mount'] as $bi) { if ($bi == $descr) { $deny = 1; if ($debug) echo("$bi == $descr \n"); } } foreach ($config['ignore_mount_string'] as $bi) { if (strpos($descr, $bi) !== FALSE) { $deny = 1; if ($debug) echo("strpos: $descr, $bi \n"); } } foreach ($config['ignore_mount_regexp'] as $bi) { if (preg_match($bi, $descr) > "0") { $deny = 1; if ($debug) echo("preg_match $bi, $descr \n"); } } diff --git a/includes/discovery/temperatures/dell.inc.php b/includes/discovery/temperatures/dell.inc.php index 11fbce220..8f5d327a3 100644 --- a/includes/discovery/temperatures/dell.inc.php +++ b/includes/discovery/temperatures/dell.inc.php @@ -21,5 +21,4 @@ if (strstr($device['hardware'], "Dell")) } } - ?> diff --git a/includes/discovery/voltages/apc.inc.php b/includes/discovery/voltages/apc.inc.php index 63ee63267..8e22d4af6 100644 --- a/includes/discovery/voltages/apc.inc.php +++ b/includes/discovery/voltages/apc.inc.php @@ -1,7 +1,5 @@ $tunnel) "cikeTunLocalName" => "tunnel_name", "cikeTunLocalValue" => "local_addr"); - - if (!is_array($tunnels[$tunnel['cikeTunRemoteValue']])) { $tunnel_id = dbInsert(array('device_id' => $device['device_id'], 'peer_addr' => $tunnel['cikeTunRemoteValue'], 'local_addr' => $tunnel['cikeTunLocalValue'], 'tunnel_name' => $tunnel['cikeTunLocalName']), 'ipsec_tunnels'); diff --git a/includes/polling/cisco-cef.inc.php b/includes/polling/cisco-cef.inc.php index c3cbe0aba..ce62eb065 100755 --- a/includes/polling/cisco-cef.inc.php +++ b/includes/polling/cisco-cef.inc.php @@ -32,7 +32,6 @@ if (is_array($cefs)) { echo(" | |-".$path.": ".$cef_stat['cefSwitchingPath']); - if (dbFetchCell("SELECT COUNT(*) FROM `cef_switching` WHERE `device_id` = ? AND `entPhysicalIndex` = ? AND `afi` = ? AND `cef_index` = ?", array($device['device_id'], $entity, $afi, $path)) != "1") { dbInsert(array('device_id' => $device['device_id'], 'entPhysicalIndex' => $entity, 'afi' => $afi, 'cef_index' => $path, 'cef_path' => $cef_stat['cefSwitchingPath']), 'cef_switching'); diff --git a/includes/polling/mempools/vrp.inc.php b/includes/polling/mempools/vrp.inc.php index a7da24998..64f1611f1 100644 --- a/includes/polling/mempools/vrp.inc.php +++ b/includes/polling/mempools/vrp.inc.php @@ -23,5 +23,4 @@ $mempool['total'] = $entry['hwEntityMemSize']; $mempool['used'] = $entry['hwEntityMemSize'] / 100 * $perc; $mempool['free'] = $entry['hwEntityMemSize'] - $mempool['used']; - ?> diff --git a/includes/polling/ospf.inc.php b/includes/polling/ospf.inc.php index 4ee1551da..7204090a6 100644 --- a/includes/polling/ospf.inc.php +++ b/includes/polling/ospf.inc.php @@ -107,7 +107,6 @@ if ($debug) echo("\n"); } - ### Loop array of entries and update if (is_array($ospf_areas_db)) { @@ -144,7 +143,6 @@ if (is_array($ospf_areas_db)) unset($ospf_areas_db); unset($ospf_areas_poll); - #$ospf_ports = snmpwalk_cache_oid($device, "OSPF-MIB::ospfIfEntry", array(), "OSPF-MIB"); #print_r($ospf_ports); @@ -292,7 +290,6 @@ if (is_array($ospf_nbrs_db)) } } - foreach ($ospf_nbr_oids as $oid) { // Loop the OIDs if ($debug) { echo($ospf_nbr_db[$oid]."|".$ospf_nbr_poll[$oid]."\n"); } diff --git a/includes/polling/ports.inc.php b/includes/polling/ports.inc.php index b1e0ee1de..994240971 100755 --- a/includes/polling/ports.inc.php +++ b/includes/polling/ports.inc.php @@ -134,11 +134,9 @@ foreach ($ports as $port) { /// Check to make sure Port data is cached. $this_port = &$port_stats[$port['ifIndex']]; - #print_r($port); #print_r($this_port); - if ($device['os'] == "vmware" && preg_match("/Device ([a-z0-9]+) at .*/", $this_port['ifDescr'], $matches)) { $this_port['ifDescr'] = $matches[1]; } $polled_period = $polled - $port['poll_time']; @@ -334,7 +332,6 @@ foreach ($ports as $port) /// Do Alcatel Detailed Stats if ($device['os'] == "aos") { include("port-alcatel.inc.php"); } - /// Update Database if (count($port['update'])) { diff --git a/includes/polling/test.inc.php b/includes/polling/test.inc.php index f47a7c6bf..d6a792137 100755 --- a/includes/polling/test.inc.php +++ b/includes/polling/test.inc.php @@ -4,5 +4,4 @@ print_r(snmpwalk_cache_oid ($device, "system", array())); print_r(snmp_cache_oid ("system", $device, array())); - ?> diff --git a/includes/polling/wifi.inc.php b/includes/polling/wifi.inc.php index 53e7a65f2..e8b5c92fb 100644 --- a/includes/polling/wifi.inc.php +++ b/includes/polling/wifi.inc.php @@ -55,7 +55,6 @@ if ($device['type'] == 'network' || $device['type'] == 'firewall') echo(($wificlients1 +0) . " clients on wireless connector, "); } - ##### RRD Filling Code if (isset($wificlients1) && $wificlients1 != "") { diff --git a/includes/rewrites.php b/includes/rewrites.php index 4ded6a893..059d79b08 100644 --- a/includes/rewrites.php +++ b/includes/rewrites.php @@ -833,7 +833,6 @@ $rewrite_ios_features = array( ' ' => ' ', ); - // Specific rewrite functions function makeshortif($if) @@ -864,7 +863,6 @@ function rewrite_fortinet_hardware ($hardware) return ($hardware); } - function rewrite_extreme_hardware ($hardware) { global $rewrite_extreme_hardware; @@ -884,7 +882,6 @@ function rewrite_ftos_hardware ($hardware) return ($hardware); } - function rewrite_ironware_hardware ($hardware) { global $rewrite_ironware_hardware; diff --git a/includes/rrdtool.inc.php b/includes/rrdtool.inc.php index d25a690f4..421e01405 100644 --- a/includes/rrdtool.inc.php +++ b/includes/rrdtool.inc.php @@ -130,8 +130,6 @@ function rrdtool_graph($graph_file, $options) } } - - /** * Generates and pipes a command to rrdtool * diff --git a/includes/services.inc.php b/includes/services.inc.php index e7540b84e..daadf028e 100644 --- a/includes/services.inc.php +++ b/includes/services.inc.php @@ -13,5 +13,4 @@ function add_service($device, $service) return dbInsert($insert, 'services'); } - ?> diff --git a/includes/snmp.inc.php b/includes/snmp.inc.php index 7117b3a24..60f63f76f 100644 --- a/includes/snmp.inc.php +++ b/includes/snmp.inc.php @@ -173,7 +173,6 @@ function snmp_walk($device, $oid, $options = NULL, $mib = NULL, $mibdir = NULL) $device['transport'] = "udp"; } - // php has no bulkwalk functionality, so use binary for this. if ($device['snmpver'] == 'v1' || $config['os'][$device['os']]['nobulk']) { @@ -382,7 +381,6 @@ function snmpwalk_cache_multi_oid($device, $oid, $array, $mib = NULL, $mibdir = return $cache['snmp'][$device['device_id']][$oid]; } - function snmpwalk_cache_double_oid($device, $oid, $array, $mib = NULL, $mibdir = NULL) { $data = snmp_walk($device, $oid, "-OQUs", $mib, $mibdir); @@ -421,8 +419,6 @@ function snmpwalk_cache_triple_oid($device, $oid, $array, $mib = NULL, $mibdir = return $array; } - - function snmpwalk_cache_twopart_oid($device, $oid, $array, $mib = 0) { global $config; diff --git a/includes/snom-graphing.php b/includes/snom-graphing.php index 1057c3feb..981a52fea 100644 --- a/includes/snom-graphing.php +++ b/includes/snom-graphing.php @@ -34,6 +34,4 @@ function callsgraphSNOM ($rrd, $graph, $from, $to, $width, $height, $title, $ver } } - - ?> diff --git a/includes/static-config.php b/includes/static-config.php index a06129bc6..b7e2dfbc0 100644 --- a/includes/static-config.php +++ b/includes/static-config.php @@ -19,7 +19,6 @@ $config['os_group'][$os_group]['over'][0]['text'] = "Processor Usage"; $config['os_group'][$os_group]['over'][1]['graph'] = "device_ucd_memory"; $config['os_group'][$os_group]['over'][1]['text'] = "Memory Usage"; - $os = "generic"; $config['os'][$os]['text'] = "Generic Device"; @@ -42,7 +41,6 @@ $config['os'][$os]['over'][1]['text'] = "Memory Usage"; $config['os'][$os]['over'][2]['graph'] = "device_storage"; $config['os'][$os]['over'][2]['text'] = "Storage Usage"; - $os = "qnap"; $config['os'][$os]['type'] = "server"; $config['os'][$os]['group'] = "unix"; @@ -378,7 +376,6 @@ $config['os'][$os]['icon'] = "citrix"; $config['os'][$os]['over'][0]['graph'] = "device_bits"; $config['os'][$os]['over'][0]['text'] = "Device Traffic"; - $os = "proxim"; $config['os'][$os]['text'] = "Proxim"; $config['os'][$os]['type'] = "network"; @@ -471,7 +468,6 @@ $config['os'][$os]['text'] = "Liebert"; $config['os'][$os]['type'] = "power"; $config['os'][$os]['icon'] = "liebert"; - $os = "engenius"; $config['os'][$os]['type'] = "network"; $config['os'][$os]['text'] = "EnGenius Access Point"; @@ -487,7 +483,6 @@ $config['os'][$os]['text'] = "Microsoft Windows"; $config['os'][$os]['ifname'] = 1; $config['os'][$os]['processor_stacked'] = 1; - $os = "bnt"; $config['os'][$os]['text'] = "Blade Network Technologies"; $config['os'][$os]['type'] = "network"; @@ -921,7 +916,6 @@ if (isset($config['enable_printers']) && $config['enable_printers']) $config['device_types'][$i]['icon'] = 'printer.png'; } - ############################## # No changes below this line # ############################## @@ -994,7 +988,6 @@ $week = time() - (7 * 24 * 60 * 60); $month = time() - (31 * 24 * 60 * 60); $year = time() - (365 * 24 * 60 * 60); - $config['time']['now'] = time(); $config['time']['fourhour'] = time() - (4 * 60 * 60); $config['time']['sixhour'] = time() - (6 * 60 * 60); diff --git a/includes/syslog.php b/includes/syslog.php index 7feb9fa91..4205fdd3e 100755 --- a/includes/syslog.php +++ b/includes/syslog.php @@ -32,7 +32,6 @@ function get_cache($host, $value) { return $dev_cache[$host][$value]; } - function process_syslog ($entry, $update) { global $config; @@ -57,7 +56,6 @@ function process_syslog ($entry, $update) { # } # unset($matches); - if (strstr($entry[msg], "%")) { $entry['msg'] = preg_replace("/^%(.+?):\ /", "\\1||", $entry['msg']); diff --git a/poll-billing.php b/poll-billing.php index 8e542e3a2..ef10e603a 100755 --- a/poll-billing.php +++ b/poll-billing.php @@ -106,5 +106,4 @@ if ($argv[1]) { CollectData($argv[1]); } rrdtool_pipe_close($rrd_process, $rrd_pipes); - ?> diff --git a/poll-device.php b/poll-device.php index 7dfbd3eed..88612cf05 100755 --- a/poll-device.php +++ b/poll-device.php @@ -7,5 +7,4 @@ include("poller.php"); echo("\nPLEASE USE 'poller.php' INSTEAD!\n"); - ?> diff --git a/syslog.php b/syslog.php index 1c6f3cef3..2333d7104 100755 --- a/syslog.php +++ b/syslog.php @@ -14,7 +14,6 @@ * */ - include("includes/defaults.inc.php"); include("config.php"); include("includes/syslog.php");
    Local addressPeer addressTypeFamilyRemote ASStateUptime / Updates