git-svn-id: http://www.observium.org/svn/observer/trunk@196 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2008-03-23 00:10:15 +00:00
parent d17301405a
commit 899051be65
8 changed files with 56 additions and 34 deletions

View File

@@ -254,7 +254,7 @@ $type = strtolower($data['os']);
function delHost($id) {
global $rrd_dir;
global $config;
$host = mysql_result(mysql_query("SELECT hostname FROM devices WHERE device_id = '$id'"), 0);
mysql_query("DELETE FROM `devices` WHERE `device_id` = '$id'");
$int_query = mysql_query("SELECT * FROM `interfaces` WHERE `device_id` = '$id'");
@@ -276,6 +276,7 @@ function delHost($id) {
mysql_query("DELETE FROM `interfaces` WHERE `device_id` = '$id'");
mysql_query("DELETE FROM `services` WHERE `service_host` = '$id'");
mysql_query("DELETE FROM `alerts` WHERE `device_id` = '$id'");
$rrd_dir = $config['rrd_dir'];
`rm -f $rrd_dir/$host-*.rrd`;
`rm -rf $rrd_dir/$host`;
echo("Removed device $host<br />");