From 50f873bffc9b129dcc9522a81482c0bb2bbade61 Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Wed, 16 Mar 2011 09:29:46 +0000 Subject: [PATCH] the trailing spaces hunt continues... git-svn-id: http://www.observium.org/svn/observer/trunk@1867 61d68cd4-352d-0410-923a-c4978735b2b8 --- addhost.php | 4 ++-- adduser.php | 12 ++++++------ check-errors.php | 2 +- cleanup.php | 8 ++++---- includes/snmp.inc.php | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/addhost.php b/addhost.php index d6de321729..58ac184c76 100755 --- a/addhost.php +++ b/addhost.php @@ -2,11 +2,11 @@ [email]\n"); - } + } } else { diff --git a/check-errors.php b/check-errors.php index 36d22f36c4..8dc52d29f4 100755 --- a/check-errors.php +++ b/check-errors.php @@ -29,7 +29,7 @@ if ($errored) { ## If there are errored ports $i=0; $msg = "Interfaces with errors : \n\n"; - + foreach ($errored as $int) { $msg .= "$int\n"; ## Add a line to the report email warning about them diff --git a/cleanup.php b/cleanup.php index 04b062914d..917c146018 100755 --- a/cleanup.php +++ b/cleanup.php @@ -7,7 +7,7 @@ include("includes/defaults.inc.php"); include("config.php"); include("includes/functions.php"); -$query = "SELECT *,A.id as id FROM ipv4_addresses AS A, ports as I, devices as D +$query = "SELECT *,A.id as id FROM ipv4_addresses AS A, ports as I, devices as D WHERE A.interface_id = I.interface_id AND I.device_id = D.device_id AND D.status = '1'"; $data = mysql_query($query); @@ -33,7 +33,7 @@ $query = mysql_query($sql); while ($device = mysql_fetch_array($query)) { echo($device['hostname'] . " \n\n"); - + $oids = snmp_walk($device, "ipAddressIfIndex.ipv6", "-Osq"); $oids = str_replace("ipAddressIfIndex.ipv6.", "", $oids); $oids = str_replace("\"", "", $oids); $oids = trim($oids); @@ -87,7 +87,7 @@ while ($interface = mysql_fetch_array($interface_query)) { mysql_query("delete from ports where `interface_id` = '$interface_id'"); echo("Deleting if $interface_id \n"); - } + } } echo(mysql_result(mysql_query("SELECT COUNT(*) FROM `ports`"), 0) . " ports at end\n"); @@ -134,7 +134,7 @@ while ($link = mysql_fetch_array($link_query)) mysql_query("delete from adjacencies where `adj_id` = '$id'"); echo("Deleting link $id (".$link['cidr']." - ". $link['hostname'] ." - ". $link['ifDescr'] .")\n"); } - + unset($remove); } diff --git a/includes/snmp.inc.php b/includes/snmp.inc.php index c55def66a4..10a134ddde 100644 --- a/includes/snmp.inc.php +++ b/includes/snmp.inc.php @@ -18,7 +18,7 @@ function snmp_get_multi($device, $oids, $options = "-OQUs", $mib = NULL, $mibdir $retries = $config['snmp']['retries']; } - if (!isset($device['transport'])) + if (!isset($device['transport'])) { $device['transport'] = "udp"; } @@ -255,7 +255,7 @@ function snmpwalk_cache_cip($device, $oid, $array, $mib = 0) $cmd .= " -M ".$config['install_dir']."/mibs/"; if (isset($timeout)) { $cmd .= " -t " . $timeout; } if (isset($retries)) { $cmd .= " -r " . $retries; } - + $cmd .= " ".$device['transport'].":".$device['hostname'].":".$device['port']." ".$oid; if (!$debug) { $cmd .= " 2>/dev/null"; }