From c8c80a7dcf44c2a29bc0ccdac95476bc0f6ba1ee Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Thu, 5 Aug 2010 23:21:57 +0000 Subject: [PATCH] flatten map (it was like that for a reason :P) and list all ports deleted when deleting an interface git-svn-id: http://www.observium.org/svn/observer/trunk@1650 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/map.php | 5 +++-- includes/functions.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/html/map.php b/html/map.php index 74e2cec8c..50891cca1 100755 --- a/html/map.php +++ b/html/map.php @@ -138,8 +138,9 @@ if (isset($_GET['format']) && preg_match("/^[a-z]*$/", $_GET['format'])) $_GET['format'] = 'png'; } - $maptool = 'unflatten -f -l 5 |dot'; - + #$maptool = 'unflatten -f -l 5 |dot'; + $maptool = 'dot'; + if ($where == '') { $maptool = 'neato -Gpack'; } $img = shell_exec("echo \"".addslashes($map)."\" | $maptool -T".$_GET['format'].""); diff --git a/includes/functions.php b/includes/functions.php index 6a092d47e..38b94687b 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -224,7 +224,7 @@ function delete_device($id) $int_if = $int_data['ifDescr']; $int_id = $int_data['interface_id']; delete_port($int_id); - $ret = "Removed interface $int_id ($int_if)\n"; + $ret .= "Removed interface $int_id ($int_if)\n"; } mysql_query("DELETE FROM `entPhysical` WHERE `device_id` = '$id'"); mysql_query("DELETE FROM `devices_attribs` WHERE `device_id` = '$id'"); @@ -244,7 +244,8 @@ function delete_device($id) mysql_query("DELETE FROM `current` WHERE `device_id` = '$id'"); mysql_query("DELETE FROM `sensors` WHERE `device_id` = '$id'"); shell_exec("rm -rf ".trim($config['rrd_dir'])."/$host"); - return $ret . "Removed device $host\n"; + $ret = "Removed Device $host\n"; + return $ret; } function addHost($host, $community, $snmpver, $port = 161)