From ff72c2843e95db1ea0f42b975b1f84746206f966 Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Tue, 17 Apr 2012 15:27:17 +0000 Subject: [PATCH] syntaxer run git-svn-id: http://www.observium.org/svn/observer/trunk@3045 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/functions.inc.php | 2 +- html/includes/graphs/device/toner.inc.php | 2 +- html/includes/graphs/graph.inc.php | 24 ++++++++++----------- html/index.php | 6 +++--- html/pages/device/overview/c6kxbar.inc.php | 2 +- html/pages/device/overview/mempools.inc.php | 2 +- html/pages/device/overview/storage.inc.php | 2 +- html/pages/device/overview/toner.inc.php | 4 ++-- html/pages/graphs.inc.php | 2 +- html/pages/health/processor.inc.php | 2 +- includes/discovery/humidity/apc.inc.php | 2 +- includes/discovery/processors/junos.inc.php | 4 ++-- includes/discovery/temperatures/apc.inc.php | 4 ++-- includes/polling/os/vmware.inc.php | 2 +- 14 files changed, 30 insertions(+), 30 deletions(-) diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index 20215f7d5a..8aefaeafda 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -12,7 +12,7 @@ function toner2colour($descr, $percent) if (substr($descr,-1) == 'K' || stripos($descr,"black" ) !== false || stripos($descr,"nero" ) !== false) { $colour['left'] = "000000"; $colour['right'] = "222222"; } - return $colour; + return $colour; } function generate_link($text, $vars, $new_vars = array()) diff --git a/html/includes/graphs/device/toner.inc.php b/html/includes/graphs/device/toner.inc.php index 1106896355..9080b058a5 100644 --- a/html/includes/graphs/device/toner.inc.php +++ b/html/includes/graphs/device/toner.inc.php @@ -12,7 +12,7 @@ foreach (dbFetchRows("SELECT * FROM toner where device_id = ?", array($id)) as $ { $colour = toner2colour($toner['toner_descr']); - if ($colour['left'] == NULL) + if ($colour['left'] == NULL) { # FIXME generic colour function switch ($iter) diff --git a/html/includes/graphs/graph.inc.php b/html/includes/graphs/graph.inc.php index d5c4cdd902..1dd731838e 100644 --- a/html/includes/graphs/graph.inc.php +++ b/html/includes/graphs/graph.inc.php @@ -135,22 +135,22 @@ if ($error_msg) { if (!$debug) { header('Content-type: image/png'); - if($config['trim_tobias']) + if ($config['trim_tobias']) { list($w, $h, $type, $attr) = getimagesize($graphfile); $src_im = imagecreatefrompng($graphfile); $src_x = '0'; // begin x - $src_y = '0'; // begin y - $src_w = $w-12; // width - $src_h = $h; // height - $dst_x = '0'; // destination x - $dst_y = '0'; // destination y - $dst_im = imagecreatetruecolor($src_w, $src_h); - $white = imagecolorallocate($dst_im, 255, 255, 255); - imagefill($dst_im, 0, 0, $white); - imagecopy($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h); - imagepng($dst_im); - imagedestroy($dst_im); + $src_y = '0'; // begin y + $src_w = $w-12; // width + $src_h = $h; // height + $dst_x = '0'; // destination x + $dst_y = '0'; // destination y + $dst_im = imagecreatetruecolor($src_w, $src_h); + $white = imagecolorallocate($dst_im, 255, 255, 255); + imagefill($dst_im, 0, 0, $white); + imagecopy($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h); + imagepng($dst_im); + imagedestroy($dst_im); } else { $fd = fopen($graphfile,'r');fpassthru($fd);fclose($fd); } diff --git a/html/index.php b/html/index.php index c07f2f1eab..9555f4240f 100755 --- a/html/index.php +++ b/html/index.php @@ -127,7 +127,7 @@ if (isset($config['branding']) && is_array($config['branding'])) # page_title_prefix is displayed, unless page_title is set if ($config['page_title']) { $config['page_title_prefix'] = $config['page_title']; } - + ?> @@ -333,10 +333,10 @@ if (is_array($pagetitle)) { # if prefix is set, put it in front if ($config['page_title_prefix']) { array_unshift($pagetitle,$config['page_title_prefix']); } - + # if suffix is set, put it in the back if ($config['page_title_suffix']) { $pagetitle[] = $config['page_title_suffix']; } - + # create and set the title $title = join(" - ",$pagetitle); echo(""); diff --git a/html/pages/device/overview/c6kxbar.inc.php b/html/pages/device/overview/c6kxbar.inc.php index 5e41edfc10..35de650b1b 100644 --- a/html/pages/device/overview/c6kxbar.inc.php +++ b/html/pages/device/overview/c6kxbar.inc.php @@ -74,7 +74,7 @@ foreach ($entity_state['group']['c6kxbar'] as $index => $entry) $minigraph = generate_graph_tag($graph_array); - echo(" + echo(" Fabric ".$subindex." ". diff --git a/html/pages/device/overview/mempools.inc.php b/html/pages/device/overview/mempools.inc.php index 80b2db411a..90444cbaa9 100644 --- a/html/pages/device/overview/mempools.inc.php +++ b/html/pages/device/overview/mempools.inc.php @@ -38,7 +38,7 @@ if (count($mempools)) $overlib_content = generate_overlib_content($graph_array, $device['hostname'] . " - " . $text_descr); $graph_array['width'] = 80; $graph_array['height'] = 20; $graph_array['bg'] = 'ffffff00'; # the 00 at the end makes the area transparent. - + $minigraph = generate_graph_tag($graph_array); echo(" diff --git a/html/pages/device/overview/storage.inc.php b/html/pages/device/overview/storage.inc.php index 6ee7eab5ee..72ee796b90 100644 --- a/html/pages/device/overview/storage.inc.php +++ b/html/pages/device/overview/storage.inc.php @@ -63,7 +63,7 @@ if (count($drives)) $overlib_content = generate_overlib_content($graph_array, $device['hostname'] . " - " . $drive['storage_descr']); $graph_array['width'] = 80; $graph_array['height'] = 20; $graph_array['bg'] = 'ffffff00'; # the 00 at the end makes the area transparent. - + $minigraph = generate_graph_tag($graph_array); echo(" diff --git a/html/pages/device/overview/toner.inc.php b/html/pages/device/overview/toner.inc.php index 92fa9aa37b..b4cbd2d24c 100644 --- a/html/pages/device/overview/toner.inc.php +++ b/html/pages/device/overview/toner.inc.php @@ -20,7 +20,7 @@ if (count($toners)) $used = formatStorage($toner['toner_used']); $background = toner2colour($toner['toner_descr'], $percent); - + $graph_array = array(); $graph_array['height'] = "100"; $graph_array['width'] = "210"; @@ -38,7 +38,7 @@ if (count($toners)) $overlib_content = generate_overlib_content($graph_array, $device['hostname'] . " - " . $toner['toner_descr']); $graph_array['width'] = 80; $graph_array['height'] = 20; $graph_array['bg'] = 'ffffff00'; # the 00 at the end makes the area transparent. - + $minigraph = generate_graph_tag($graph_array); echo(" diff --git a/html/pages/graphs.inc.php b/html/pages/graphs.inc.php index 6696627b4b..0b0b1c5f92 100644 --- a/html/pages/graphs.inc.php +++ b/html/pages/graphs.inc.php @@ -68,7 +68,7 @@ if (!$auth) onchange="window.open(this.options[this.selectedIndex].value,'_top')" > $type."_".$avail_type, 'page' => "graphs"))."'"); if ($avail_type == $subtype) { echo(" selected"); } diff --git a/html/pages/health/processor.inc.php b/html/pages/health/processor.inc.php index 7e1ee048b2..36ddc2a28a 100644 --- a/html/pages/health/processor.inc.php +++ b/html/pages/health/processor.inc.php @@ -49,7 +49,7 @@ foreach (dbFetchRows("SELECT * FROM `processors` AS P, `devices` AS D WHERE D.de if ($vars['view'] == "graphs") { echo(' '); - + $daily_graph = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=211&height=100"; $daily_url = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=400&height=150"; diff --git a/includes/discovery/humidity/apc.inc.php b/includes/discovery/humidity/apc.inc.php index 46926a72e4..35cade4f95 100644 --- a/includes/discovery/humidity/apc.inc.php +++ b/includes/discovery/humidity/apc.inc.php @@ -3,7 +3,7 @@ if ($device['os'] == "apc") { # Environmental monitoring on UPSes etc - # FIXME emConfigProbesTable may also be used? But not filled out on my device... + # FIXME emConfigProbesTable may also be used? But not filled out on my device... $apc_env_data = snmpwalk_cache_oid($device, "iemConfigProbesTable", array(), "PowerNet-MIB"); $apc_env_data = snmpwalk_cache_oid($device, "iemStatusProbesTable", $apc_env_data, "PowerNet-MIB"); diff --git a/includes/discovery/processors/junos.inc.php b/includes/discovery/processors/junos.inc.php index b42a7fa3d7..60d5f04fbd 100755 --- a/includes/discovery/processors/junos.inc.php +++ b/includes/discovery/processors/junos.inc.php @@ -30,7 +30,7 @@ if ($device['os'] == "junos") } ## End if array else { - $srx_processors_array = snmpwalk_cache_multi_oid($device, "jnxJsSPUMonitoringCPUUsage", $srx_processors_array, "JUNIPER-SRX5000-SPU-MONITORING-MIB" , '+'.$config['install_dir']."/mibs/junos"); + $srx_processors_array = snmpwalk_cache_multi_oid($device, "jnxJsSPUMonitoringCPUUsage", $srx_processors_array, "JUNIPER-SRX5000-SPU-MONITORING-MIB" , '+'.$config['install_dir']."/mibs/junos"); if (is_array($srx_processors_array)) { @@ -41,7 +41,7 @@ if ($device['os'] == "junos") $usage_oid = ".1.3.6.1.4.1.2636.3.39.1.12.1.1.1.4." . $index; $descr = "CPU"; # No description in the table? $usage = $entry['jnxJsSPUMonitoringCPUUsage']; - + discover_processor($valid['processor'], $device, $usage_oid, $index, "junos", $descr, "1", $usage, NULL, NULL); } } diff --git a/includes/discovery/temperatures/apc.inc.php b/includes/discovery/temperatures/apc.inc.php index 96467af663..bd7fa220c7 100644 --- a/includes/discovery/temperatures/apc.inc.php +++ b/includes/discovery/temperatures/apc.inc.php @@ -17,7 +17,7 @@ if ($device['os'] == "apc") } # Environmental monitoring on UPSes etc - # FIXME emConfigProbesTable may also be used? But not filled out on my device... + # FIXME emConfigProbesTable may also be used? But not filled out on my device... $apc_env_data = snmpwalk_cache_oid($device, "iemConfigProbesTable", array(), "PowerNet-MIB"); $apc_env_data = snmpwalk_cache_oid($device, "iemStatusProbesTable", $apc_env_data, "PowerNet-MIB"); @@ -31,7 +31,7 @@ if ($device['os'] == "apc") $low_warn_limit = ($apc_env_data[$index]['iemConfigProbeLowTempEnable'] != 'disabled' ? $apc_env_data[$index]['iemConfigProbeLowTempThreshold'] : NULL); $high_warn_limit = ($apc_env_data[$index]['iemConfigProbeHighTempEnable'] != 'disabled' ? $apc_env_data[$index]['iemConfigProbeHighTempThreshold'] : NULL); $high_limit = ($apc_env_data[$index]['iemConfigProbeMaxTempEnable'] != 'disabled' ? $apc_env_data[$index]['iemConfigProbeMaxTempThreshold'] : NULL); - + discover_sensor($valid['sensor'], 'temperature', $device, $oid, $index, $sensorType, $descr, '1', '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit , $current); } diff --git a/includes/polling/os/vmware.inc.php b/includes/polling/os/vmware.inc.php index fe2dc43f88..1ce5d16651 100644 --- a/includes/polling/os/vmware.inc.php +++ b/includes/polling/os/vmware.inc.php @@ -66,7 +66,7 @@ foreach ($db_info_list as $db_info) { $vm_info["vmwVmGuestOS"] = $db_info["vmwVmGuestOS"]; } - + /* * Process all the VMware Virtual Machine properties. */