From 86348b92bb969ad11cec12fb2be3e6b8c6d630eb Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Sun, 20 May 2012 23:14:08 +0000 Subject: [PATCH] syntaxer run git-svn-id: http://www.observium.org/svn/observer/trunk@3218 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/functions.inc.php | 7 +++---- html/pages/device.inc.php | 1 - html/pages/device/alerts.inc.php | 3 +-- includes/common.php | 2 +- includes/defaults.inc.php | 2 +- includes/functions.php | 22 ++++++++++----------- includes/polling/os/nrg.inc.php | 2 +- includes/polling/os/sonicwall.inc.php | 12 +++++------ includes/polling/ports.inc.php | 2 +- includes/polling/unix-agent.inc.php | 6 ++++-- includes/polling/unix-agent/hddtemp.inc.php | 2 +- 11 files changed, 30 insertions(+), 31 deletions(-) diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index 673e0c5b7..beacc1b2c 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -343,10 +343,9 @@ function print_percentage_bar($width, $height, $percent, $left_text, $left_colou function generate_entity_link($type, $entity, $text = NULL, $graph_type=NULL) { - global $config; - global $entity_cache; + global $config, $entity_cache; - if(is_numeric($entity)) + if (is_numeric($entity)) { $entity = get_entity_by_id_cache($type, $entity); } @@ -357,7 +356,7 @@ function generate_entity_link($type, $entity, $text = NULL, $graph_type=NULL) $link = generate_port_link($entity, $text, $graph_type); break; case "storage": - if(empty($text)) { $text = $entity['storage_descr']; } + if (empty($text)) { $text = $entity['storage_descr']; } $link = generate_link($text, array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'health', 'metric' => 'storage')); break; default: diff --git a/html/pages/device.inc.php b/html/pages/device.inc.php index a8915e76b..b2f00fcf2 100644 --- a/html/pages/device.inc.php +++ b/html/pages/device.inc.php @@ -308,7 +308,6 @@ if (device_permitted($vars['device']) || $check_device == $vars['device']) '); } - if ($_SESSION['userlevel'] >= "7") { if (!is_array($config['rancid_configs'])) { $config['rancid_configs'] = array($config['rancid_configs']); } diff --git a/html/pages/device/alerts.inc.php b/html/pages/device/alerts.inc.php index bbbd0c7c3..3885ae8ea 100644 --- a/html/pages/device/alerts.inc.php +++ b/html/pages/device/alerts.inc.php @@ -74,7 +74,7 @@ foreach ($glo_conditions as $type => $subtypes) if (!empty($entities)) { echo(''); - foreach ($entities as $entity) + foreach ($entities as $entity) { echo(''.generate_entity_link($type, $entity).""); } @@ -85,7 +85,6 @@ foreach ($glo_conditions as $type => $subtypes) } } - echo(''); ?> diff --git a/includes/common.php b/includes/common.php index ea4f47f55..f830bff3c 100644 --- a/includes/common.php +++ b/includes/common.php @@ -170,7 +170,7 @@ function port_by_id_cache($port_id) function table_from_entity_type($type) { /// Fuck you, english pluralisation. - if($type == "storage") + if ($type == "storage") { return $type; } else { diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index 6cbb4ac14..5de4f1293 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -97,7 +97,7 @@ $config['page_gen'] = 1; $config['web_header'] = "header.inc.php"; # in html/includes $config['login_message'] = "Unauthorised access or use shall render the user liable to criminal and/or civil prosecution."; -$config['old_graphs'] = 1; ## RRDfiles from before the great rra reform. This is default for a while. +$config['old_graphs'] = 1; ## RRDfiles from before the great rra reform. This is default for a while. $config['int_customers'] = 1; # Enable Customer Port Parsing $config['int_transit'] = 1; # Enable Transit Types diff --git a/includes/functions.php b/includes/functions.php index 347cc5957..17e0823bc 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -211,23 +211,23 @@ function addHost($host, $snmpver, $port = '161', $transport = 'udp') { // Try SNMPv2c $snmpver = 'v2c'; - $ret = addHost($host, $snmpver); - if (!$ret) + $ret = addHost($host, $snmpver); + if (!$ret) { //Try SNMPv3 $snmpver = 'v3'; - $ret = addHost($host, $snmpver); - if (!$ret) + $ret = addHost($host, $snmpver); + if (!$ret) { // Try SNMPv1 $snmpver = 'v1'; - return addHost($host, $snmpver); - } else { - return $ret; - } - } else { - return $ret; - } + return addHost($host, $snmpver); + } else { + return $ret; + } + } else { + return $ret; + } } if ($snmpver === "v3") diff --git a/includes/polling/os/nrg.inc.php b/includes/polling/os/nrg.inc.php index 740e03e83..e46a27001 100644 --- a/includes/polling/os/nrg.inc.php +++ b/includes/polling/os/nrg.inc.php @@ -1,4 +1,4 @@ - diff --git a/includes/polling/ports.inc.php b/includes/polling/ports.inc.php index e6d21acac..6c1f8172e 100755 --- a/includes/polling/ports.inc.php +++ b/includes/polling/ports.inc.php @@ -324,7 +324,7 @@ foreach ($ports as $port) $port['stats']['ifOutBits_rate'] = round($port['stats']['ifOutOctets_rate'] * 8); // If we have a valid ifSpeed we should populate the stats for checking. - if(is_numeric($this_port['ifSpeed'])) + if (is_numeric($this_port['ifSpeed'])) { $port['stats']['ifInBits_perc'] = round($port['stats']['ifInBits_rate'] / $this_port['ifSpeed'] * 100); $port['stats']['ifOutBits_perc'] = round($port['stats']['ifOutBits_rate'] / $this_port['ifSpeed'] * 100); diff --git a/includes/polling/unix-agent.inc.php b/includes/polling/unix-agent.inc.php index 4bd0170d3..63c8f1d94 100755 --- a/includes/polling/unix-agent.inc.php +++ b/includes/polling/unix-agent.inc.php @@ -56,12 +56,13 @@ if ($device['os_group'] == "unix") include("unix-agent/packages.inc.php"); include("unix-agent/munin-plugins.inc.php"); - + foreach (array_keys($agent_data) as $key) { if (file_exists("includes/polling/unix-agent/$key.inc.php")) { if ($debug) { echo("Including: unix-agent/$key.inc.php"); } + include("unix-agent/$key.inc.php"); } } @@ -71,6 +72,7 @@ if ($device['os_group'] == "unix") if (file_exists("includes/polling/applications/$key.inc.php")) { if ($debug) { echo("Including: applications/$key.inc.php"); } + include("applications/$key.inc.php"); } } @@ -144,7 +146,7 @@ if ($device['os_group'] == "unix") } } } - + if (!empty($agent_sensors)) { echo("Sensors: "); diff --git a/includes/polling/unix-agent/hddtemp.inc.php b/includes/polling/unix-agent/hddtemp.inc.php index 913d98fbd..af999ba35 100644 --- a/includes/polling/unix-agent/hddtemp.inc.php +++ b/includes/polling/unix-agent/hddtemp.inc.php @@ -14,7 +14,7 @@ if (count($disks)) list($blockdevice,$descr,$temperature,$unit) = explode('|',$disk,4); $diskcount++; discover_sensor($valid['sensor'], 'temperature', $device, '', $diskcount, 'hddtemp', "$blockdevice: $descr", '1', '1', NULL, NULL, NULL, NULL, $temperature, 'agent'); - + $agent_sensors['temperature']['hddtemp'][$diskcount] = array('description' => "$blockdevice: $descr", 'current' => $temperature, 'index' => $diskcount); } echo "\n";