From 6b8cba3d2402f464aa28e3236f466ea2617858a3 Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Mon, 26 Sep 2011 16:06:18 +0000 Subject: [PATCH] syntaxer run git-svn-id: http://www.observium.org/svn/observer/trunk@2580 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/authentication/ldap.inc.php | 8 +++---- html/pages/device.inc.php | 2 +- html/pages/device/apps/powerdns.inc.php | 2 +- html/pages/devices.inc.php | 2 +- html/pages/graphs.inc.php | 2 +- html/pages/ports/graph.inc.php | 2 +- html/pages/routing/bgp.inc.php | 10 ++++----- includes/defaults.inc.php | 26 +++++++++++------------ includes/discovery/mempools/vrp.inc.php | 18 +++++++++------- includes/discovery/processors/vrp.inc.php | 8 +++---- includes/polling/mempools/vrp.inc.php | 6 +++--- 11 files changed, 43 insertions(+), 43 deletions(-) diff --git a/html/includes/authentication/ldap.inc.php b/html/includes/authentication/ldap.inc.php index 3ba08fc05..74213fbbc 100644 --- a/html/includes/authentication/ldap.inc.php +++ b/html/includes/authentication/ldap.inc.php @@ -126,10 +126,10 @@ function get_userlist() global $config, $ds; $filter = '(' . $config['auth_ldap_prefix'] . '*)'; - + $search = ldap_search($ds, trim($config['auth_ldap_suffix'],','), $filter); $entries = ldap_get_entries($ds, $search); - + if ($entries['count']) { foreach ($entries as $entry) @@ -137,14 +137,14 @@ function get_userlist() $username = $entry['uid'][0]; $realname = $entry['cn'][0]; $user_id = $entry['uidnumber'][0]; - + if (!isset($config['auth_ldap_group']) || ldap_compare($ds,$config['auth_ldap_group'],'memberUid',$username)) { $userlist[] = array('username' => $username, 'realname' => $realname, 'user_id' => $user_id); } } } - + return $userlist; } diff --git a/html/pages/device.inc.php b/html/pages/device.inc.php index 282efbdfc..70ed6a7be 100644 --- a/html/pages/device.inc.php +++ b/html/pages/device.inc.php @@ -251,7 +251,7 @@ if (device_permitted($vars['device']) || $check_device == $vars['device']) '); } - echo(""); + echo(""); } if (device_permitted($device['device_id']) || $check_device == $vars['device']) { diff --git a/html/pages/device/apps/powerdns.inc.php b/html/pages/device/apps/powerdns.inc.php index ae857f384..c1d93e0dd 100644 --- a/html/pages/device/apps/powerdns.inc.php +++ b/html/pages/device/apps/powerdns.inc.php @@ -11,7 +11,7 @@ $graphs = array('powerdns_latency' => 'Latency', 'powerdns_queries_udp' => 'Detail UDP IPv4/IPv6 Queries and Answers'); foreach ($graphs as $key => $text) { - $graph_type = $key; + $graph_type = $key; $graph_array['height'] = "100"; $graph_array['width'] = "215"; $graph_array['to'] = $now; diff --git a/html/pages/devices.inc.php b/html/pages/devices.inc.php index ba151f5c6..6f805ccc4 100644 --- a/html/pages/devices.inc.php +++ b/html/pages/devices.inc.php @@ -247,7 +247,7 @@ if($format == "graph") { $graph_type = "device_".$subformat; - if($_SESSION['widescreen']) { $width=270; } else { $width=315; } + if ($_SESSION['widescreen']) { $width=270; } else { $width=315; } echo("
"); - if($vars['legend'] == "no") + if ($vars['legend'] == "no") { echo(generate_link("Show Legend",$vars, array('page' => "graphs", 'legend' => NULL))); } else { diff --git a/html/pages/ports/graph.inc.php b/html/pages/ports/graph.inc.php index e6ed1f8e1..016104b1a 100644 --- a/html/pages/ports/graph.inc.php +++ b/html/pages/ports/graph.inc.php @@ -36,7 +36,7 @@ foreach ($ports as $port) $link = generate_url($link_array); $overlib_content = generate_overlib_content($graph_array, $port['hostname'] . " - " . $port['label']); $graph_array['title'] = "yes"; - $graph_array['width'] = 315; $graph_array['height'] = 119; + $graph_array['width'] = 315; $graph_array['height'] = 119; $graph = generate_graph_tag($graph_array); echo("
"); diff --git a/html/pages/routing/bgp.inc.php b/html/pages/routing/bgp.inc.php index 63ed34482..3670b5ac2 100644 --- a/html/pages/routing/bgp.inc.php +++ b/html/pages/routing/bgp.inc.php @@ -55,7 +55,7 @@ else echo(" | "); - if ($vars['state'] == "down") + if ($vars['state'] == "down") { echo(""); echo(generate_link("Down",$vars, array('state' => NULL))); @@ -66,7 +66,7 @@ else ## End BGP Menu - if(!isset($vars['view'])) { $vars['view'] = 'details'; } + if (!isset($vars['view'])) { $vars['view'] = 'details'; } echo('
'); @@ -133,19 +133,19 @@ else $i = "1"; - if ($vars['type'] == "external") + if ($vars['type'] == "external") { $where = "AND D.bgpLocalAs != B.bgpPeerRemoteAs"; } elseif ($vars['type'] == "internal") { $where = "AND D.bgpLocalAs = B.bgpPeerRemoteAs"; } - if($vars['adminstatus'] == "stop") + if ($vars['adminstatus'] == "stop") { $where .= " AND (B.bgpPeerAdminStatus = 'stop')"; } - if($vars['state'] == "down") + if ($vars['state'] == "down") { $where .= " AND (B.bgpPeerState != 'established')"; } diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index e878820d1..35a25e177 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -71,19 +71,19 @@ $config['snmp']['transports'] = array('udp', 'udp6', 'tcp', 'tcp6'); ### Autodiscovery Settings -$config['autodiscovery']['xdp'] = true; ## Autodiscover hosts via discovery protocols +$config['autodiscovery']['xdp'] = true; ## Autodiscover hosts via discovery protocols $config['autodiscovery']['ospf'] = true; ## Autodiscover hosts via OSPF -$config['autodiscovery']['bgp'] = true; ## Autodiscover hosts via BGP -$config['autodiscovery']['snmpscan'] = true; ## autodiscover hosts via SNMP scanning +$config['autodiscovery']['bgp'] = true; ## Autodiscover hosts via BGP +$config['autodiscovery']['snmpscan'] = true; ## autodiscover hosts via SNMP scanning -$config['discover_services'] = false; ## Autodiscover services via SNMP on devices of type "server" +$config['discover_services'] = false; ## Autodiscover services via SNMP on devices of type "server" ### Alerting Settings $config['alerts']['email']['default'] = NULL; ## Default alert recipient $config['alerts']['email']['default_only'] = FALSE; ## Only use default recipient $config['alerts']['email']['enable'] = TRUE; ## Enable email alerts -$config['alerts']['bgp']['whitelist'] = NULL; ## Populate as an array() with ASNs to alert on. +$config['alerts']['bgp']['whitelist'] = NULL; ## Populate as an array() with ASNs to alert on. $config['uptime_warning'] = "84600"; ## Time in seconds to display a "Device Rebooted" Alert. 0 to disable warnings. @@ -149,8 +149,8 @@ $config['enable_eigrp'] = 1; # Enable EIGRP session collection a $config['enable_syslog'] = 0; # Enable Syslog $config['enable_inventory'] = 1; # Enable Inventory $config['enable_pseudowires'] = 1; # Enable Pseudowires -$config['enable_vrfs'] = 1; # Enable VRFs -$config['enable_printers'] = 0; # Enable Printer support +$config['enable_vrfs'] = 1; # Enable VRFs +$config['enable_printers'] = 0; # Enable Printer support ### Ports extension modules @@ -164,14 +164,14 @@ $config['enable_ports_poe'] = 0; # Enable PoE stats collection ### Billing System Configuration $config['enable_billing'] = 0; # Enable Billing -$config['billing']['customer_autoadd'] = 0; # Enable Auto-add bill per customer -$config['billing']['circuit_autoadd'] = 0; # Enable Auto-add bill per circuit_id -$config['billing']['bill_autoadd'] = 0; # Enable Auto-add bill per bill_id +$config['billing']['customer_autoadd'] = 0; # Enable Auto-add bill per customer +$config['billing']['circuit_autoadd'] = 0; # Enable Auto-add bill per circuit_id +$config['billing']['bill_autoadd'] = 0; # Enable Auto-add bill per bill_id ### External Integration -#$config['rancid_configs'][] = '/var/lib/rancid/network/configs/'; -$config['rancid_ignorecomments'] = 0; # Ignore lines starting with # +#$config['rancid_configs'][] = '/var/lib/rancid/network/configs/'; +$config['rancid_ignorecomments'] = 0; # Ignore lines starting with # #$config['collectd_dir'] = '/var/lib/collectd/rrd'; # NFSen RRD dir. @@ -351,8 +351,6 @@ $config['poller_modules']['cisco-cef'] = 1; $config['poller_modules']['cisco-mac-accounting'] = 1; $config['poller_modules']['cipsec-tunnels'] = 1; - #include("includes/polling/altiga-ssl.inc.php"); - ## List of discovery modules. Need to be in this array to be ## considered for execution. diff --git a/includes/discovery/mempools/vrp.inc.php b/includes/discovery/mempools/vrp.inc.php index 1c81ab88b..6fa1967ba 100644 --- a/includes/discovery/mempools/vrp.inc.php +++ b/includes/discovery/mempools/vrp.inc.php @@ -7,18 +7,20 @@ if($device['os'] == "vrp") $mempools_array = snmpwalk_cache_multi_oid($device, "hwEntityMemUsage", $mempools_array, "HUAWEI-ENTITY-EXTENT-MIB" , $config['install_dir']."/mibs"); $mempools_array = snmpwalk_cache_multi_oid($device, "hwEntityMemSize", $mempools_array, "HUAWEI-ENTITY-EXTENT-MIB" , $config['install_dir']."/mibs"); $mempools_array = snmpwalk_cache_multi_oid($device, "hwEntityBomEnDesc", $mempools_array, "HUAWEI-ENTITY-EXTENT-MIB" , $config['install_dir']."/mibs"); - if($debug) { print_r($mempools_array); } + if ($debug) { print_r($mempools_array); } - if(is_array($mempools_array)) { - foreach($mempools_array as $index => $entry) { - - if($entry['hwEntityMemSize'] != 0 ) { + if (is_array($mempools_array)) + { + foreach($mempools_array as $index => $entry) + { + if ($entry['hwEntityMemSize'] != 0 ) + { if ($debug) { echo($index . " " . $entry['hwEntityBomEnDesc'] . " -> " . $entry['hwEntityMemUsage'] . " -> " . $entry['hwEntityMemSize'] . "\n"); } - echo($index . " " . $entry['hwEntityBomEnDesc'] . " -> " . $entry['hwEntityMemUsage'] . " -> " . $entry['hwEntityMemSize'] . "\n"); $usage_oid = ".1.3.6.1.4.1.2011.5.25.31.1.1.1.1.7." . $index; $descr = $entry['hwEntityBomEnDesc']; $usage = $entry['hwEntityMemUsage']; - if(!strstr($descr, "No") && !strstr($usage, "No") && $descr != "" ) { + if (!strstr($descr, "No") && !strstr($usage, "No") && $descr != "" ) + { discover_mempool($valid_mempool, $device, $index, "vrp", $descr, "1", NULL, NULL); } } ## End if checks @@ -26,6 +28,6 @@ if($device['os'] == "vrp") } ## End if array } ## End VRP mempools - unset ($mempools_array); +unset ($mempools_array); ?> diff --git a/includes/discovery/processors/vrp.inc.php b/includes/discovery/processors/vrp.inc.php index 0228fae8e..1c1717bf1 100644 --- a/includes/discovery/processors/vrp.inc.php +++ b/includes/discovery/processors/vrp.inc.php @@ -11,17 +11,17 @@ if($device['os'] == "vrp") if (is_array($processors_array)) { - foreach ($processors_array as $index => $entry) + foreach ($processors_array as $index => $entry) { - if ( $entry['hwEntityMemSize'] != 0 ) + if ($entry['hwEntityMemSize'] != 0) { if ($debug) { echo($index . " " . $entry['hwEntityBomEnDesc'] . " -> " . $entry['hwEntityCpuUsage'] . " -> " . $entry['hwEntityMemSize']. "\n"); } $usage_oid = ".1.3.6.1.4.1.2011.5.25.31.1.1.1.1.5." . $index; $descr = $entry['hwEntityBomEnDesc']; $usage = $entry['hwEntityCpuUsage']; - if(!strstr($descr, "No") && !strstr($usage, "No") && $descr != "" ) + if (!strstr($descr, "No") && !strstr($usage, "No") && $descr != "" ) { - discover_processor($valid['processor'], $device, $usage_oid, $index, "vrp", $descr, "1", $usage, NULL, NULL); + discover_processor($valid['processor'], $device, $usage_oid, $index, "vrp", $descr, "1", $usage, NULL, NULL); } } ## End if checks } ## End Foreach diff --git a/includes/polling/mempools/vrp.inc.php b/includes/polling/mempools/vrp.inc.php index 5e6cc8a5f..a7da24998 100644 --- a/includes/polling/mempools/vrp.inc.php +++ b/includes/polling/mempools/vrp.inc.php @@ -1,15 +1,15 @@