summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/config.inc.php
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-02-22 16:08:35 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-02-22 16:08:35 +0000
commitcfdccc6dd4f9d313f6cdc34f62f6453a1f5a1a0b (patch)
treef1c9d0192496011e899f91dd9575db73d5cfc77a /frontends/php/include/config.inc.php
parent1e241634d9beb1dc6368d270f8be45d158c66a18 (diff)
- added hosekeeper support for frontend (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@2675 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/config.inc.php')
-rw-r--r--frontends/php/include/config.inc.php42
1 files changed, 34 insertions, 8 deletions
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index 94d8c77f..8d82fefe 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -1553,20 +1553,39 @@ function SDI($msg="SDI") { echo "DEBUG INFO: $msg ".BR; } # DEBUG INFO!!!
# Delete from History
- function delete_history_by_itemid( $itemid )
+ function delete_history_by_itemid($itemid, $use_housekeeper=0)
{
- $sql="delete from history_str where itemid=$itemid";
- DBexecute($sql);
- $sql="delete from history where itemid=$itemid";
- return DBexecute($sql);
+ $result = delete_trends_by_itemid($itemid,$use_housekeeper);
+ if(!$result) return $result;
+
+ if($use_housekeeper)
+ {
+ DBexecute("insert into housekeeper (tablename,field,value)".
+ " values ('history_uint','itemid',$itemid)");
+ DBexecute("insert into housekeeper (tablename,field,value)".
+ " values ('history_str','itemid',$itemid)");
+ DBexecute("insert into housekeeper (tablename,field,value)".
+ " values ('history','itemid',$itemid)");
+ return TRUE;
+ }
+
+ DBexecute("delete from history_uint where itemid=$itemid");
+ DBexecute("delete from history_str where itemid=$itemid");
+ DBexecute("delete from history where itemid=$itemid");
+ return TRUE;
}
# Delete from Trends
- function delete_trends_by_itemid( $itemid )
+ function delete_trends_by_itemid($itemid, $use_housekeeper=0)
{
- $sql="delete from trends where itemid=$itemid";
- return DBexecute($sql);
+ if($use_housekeeper)
+ {
+ DBexecute("insert into housekeeper (tablename,field,value)".
+ " values ('trends','itemid',$itemid)");
+ return TRUE;
+ }
+ return DBexecute("delete from trends where itemid=$itemid");
}
# Add alarm
@@ -2961,4 +2980,11 @@ function SDI($msg="SDI") { echo "DEBUG INFO: $msg ".BR; } # DEBUG INFO!!!
}
return $value;
}
+
+ function Alert($msg)
+ {
+ echo "<script language=\"JavaScript\" type=\"text/javascript\">";
+ echo "alert('$msg');";
+ echo "</script>";
+ }
?>