summaryrefslogtreecommitdiffstats
path: root/frontends/php/items.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/items.php
parent1e241634d9beb1dc6368d270f8be45d158c66a18 (diff)
downloadzabbix-cfdccc6dd4f9d313f6cdc34f62f6453a1f5a1a0b.tar.gz
zabbix-cfdccc6dd4f9d313f6cdc34f62f6453a1f5a1a0b.tar.xz
zabbix-cfdccc6dd4f9d313f6cdc34f62f6453a1f5a1a0b.zip
- 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/items.php')
-rw-r--r--frontends/php/items.php29
1 files changed, 28 insertions, 1 deletions
diff --git a/frontends/php/items.php b/frontends/php/items.php
index b8c54ca6..2b6b8672 100644
--- a/frontends/php/items.php
+++ b/frontends/php/items.php
@@ -78,6 +78,8 @@
"group_itemid"=> array(T_ZBX_INT, O_OPT, NULL, DB_ID, NULL),
+ "del_history"=> array(T_ZBX_STR, O_OPT, P_SYS|P_ACT, NULL, NULL),
+
"register"=> array(T_ZBX_STR, O_OPT, P_SYS|P_ACT, NULL, NULL),
"group_task"=> array(T_ZBX_STR, O_OPT, P_SYS|P_ACT, NULL, NULL),
"save"=> array(T_ZBX_STR, O_OPT, P_SYS|P_ACT, NULL, NULL),
@@ -144,6 +146,17 @@
unset($_REQUEST["form"]);
}
}
+ elseif(isset($_REQUEST["del_history"])&&isset($_REQUEST["itemid"]))
+ {
+ $result = delete_history_by_itemid($_REQUEST["itemid"]);
+ if($result)
+ {
+ DBexecute("update items set nextcheck=null,lastvalue=null,".
+ "lastclock=null,prevvalue=null where itemid=".$_REQUEST["itemid"]);
+ }
+ show_messages($result, S_HISTORY_CLEANED, S_CANNOT_CLEAN_HISTORY);
+
+ }
elseif(isset($_REQUEST["register"]))
{
if($_REQUEST["register"]=="do")
@@ -249,7 +262,7 @@
}
show_messages(TRUE, S_ITEMS_ACTIVATED, S_CANNOT_ACTIVATE_ITEMS);
}
- if($_REQUEST["group_task"]=="Disable selected")
+ elseif($_REQUEST["group_task"]=="Disable selected")
{
$group_itemid = $_REQUEST["group_itemid"];
foreach($group_itemid as $id)
@@ -258,6 +271,17 @@
}
show_messages(TRUE, S_ITEMS_DISABLED, S_CANNOT_DISABLE_ITEMS);
}
+ elseif($_REQUEST["group_task"]=="Clean history")
+ {
+ $group_itemid = $_REQUEST["group_itemid"];
+ foreach($group_itemid as $id)
+ {
+ delete_history_by_itemid($id);
+ DBexecute("update items set nextcheck=null,lastvalue=null,".
+ "lastclock=null,prevvalue=null where itemid=$id");
+ }
+ show_messages(TRUE, S_HISTORY_CLEANED, S_CANNOT_CLEAN_HISTORY);
+ }
}
?>
@@ -433,6 +457,9 @@
array_push($footerButtons, new CButton('group_task','Disable selected',
"return Confirm('".S_DISABLE_SELECTED_ITEMS_Q."');"));
array_push($footerButtons, SPACE);
+ array_push($footerButtons, new CButton('group_task','Clean history',
+ "return Confirm('History cleaning can take a long time. Continue?');"));
+ array_push($footerButtons, SPACE);
array_push($footerButtons, new CButton('group_task','Delete selected',
"return Confirm('".S_DELETE_SELECTED_ITEMS_Q."');"));
$table->SetFooter(new CCol($footerButtons),'table_footer');