diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-05-06 20:18:20 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-05-06 20:18:20 +0000 |
| commit | f0992b870a4b4b2cd541bce01ae20694b02aaf02 (patch) | |
| tree | eadb9a14de5c0b904c4af0cdfec8bd45d68b3a32 /frontends/php/include | |
| parent | 07523be771478603a8b15ab748278f6eef147197 (diff) | |
Minor changes.
git-svn-id: svn://svn.zabbix.com/trunk@1760 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
| -rw-r--r-- | frontends/php/include/graphs.inc.php | 8 | ||||
| -rw-r--r-- | frontends/php/include/items.inc.php | 6 | ||||
| -rw-r--r-- | frontends/php/include/triggers.inc.php | 6 |
3 files changed, 19 insertions, 1 deletions
diff --git a/frontends/php/include/graphs.inc.php b/frontends/php/include/graphs.inc.php index 5d08b6ad..158d2ac5 100644 --- a/frontends/php/include/graphs.inc.php +++ b/frontends/php/include/graphs.inc.php @@ -136,14 +136,18 @@ $sql="select distinct g.graphid from graphs g,graphs_items gi,items i where i.itemid=gi.itemid and i.hostid=".$row["hostid"]." and g.graphid=gi.graphid and g.name='".addslashes($graph["name"])."'"; $result2=DBselect($sql); + $host=get_host_by_hostid($result["hostid"]); while($row2=DBfetch($result2)) { add_item_to_graph($row2["graphid"],$itemid,$graph_item["color"],$graph_item["drawtype"],$graph_item["sortorder"]); + info("Added graph element to graph ".$graph["name"]." of linked host ".$host["host"]); } if(DBnum_rows($result2)==0) { $graphid=add_graph($graph["name"],$graph["width"],$graph["height"],$graph["yaxistype"],$graph["yaxismin"],$graph["yaxismax"]); + info("Added graph ".$graph["name"]." of linked host ".$host["host"]); add_item_to_graph($graphid,$itemid,$graph_item["color"],$graph_item["drawtype"],$graph_item["sortorder"]); + info("Added graph element to graph ".$graph["name"]." of linked host ".$host["host"]); } } } @@ -171,17 +175,21 @@ $row2=DBfetch($result2); $itemid=$row2["itemid"]; + $host=get_host_by_hostid($result["hostid"]); + $sql="select distinct gi.gitemid,gi.graphid from graphs_items gi,items i where i.itemid=gi.itemid and i.hostid=".$row["hostid"]." and i.itemid=$itemid"; $result2=DBselect($sql); while($row2=DBfetch($result2)) { delete_graphs_item($row2["gitemid"]); + info("Deleted graph element ".$item["key_"]." from linked host ".$host["host"]); $sql="select count(*) as count from graphs_items where graphid=".$row2["graphid"]; $result3=DBselect($sql); $row3=DBfetch($result3); if($row3["count"]==0) { delete_graph($row2["graphid"]); + info("Deleted graph from linked host ".$host["host"]); } } } diff --git a/frontends/php/include/items.inc.php b/frontends/php/include/items.inc.php index ec793a75..652688f2 100644 --- a/frontends/php/include/items.inc.php +++ b/frontends/php/include/items.inc.php @@ -140,7 +140,7 @@ { add_item($item["description"],$item["key_"],$row["hostid"],$item["delay"],$item["history"],$item["status"],$item["type"],$item["snmp_community"],$item["snmp_oid"],$item["value_type"],$item["trapper_hosts"],$item["snmp_port"],$item["units"],$item["multiplier"],$item["delta"],$item["snmpv3_securityname"],$item["snmpv3_securitylevel"],$item["snmpv3_authpassphrase"],$item["snmpv3_privpassphrase"],$item["formula"],$item["trends"]); $host=get_host_by_hostid($row["hostid"]); - info("Added to host ".$host["host"]); + info("Added to linked host ".$host["host"]); } } } @@ -166,6 +166,8 @@ while($row2=DBfetch($result2)) { delete_item($row2["itemid"]); + $host=get_host_by_hostid($row["hostid"]); + info("Deleted from linked host ".$host["host"]); } } } @@ -192,6 +194,8 @@ { $row2=DBfetch($result2); update_item($row2["itemid"],$item["description"],$item["key_"],$row["hostid"],$item["delay"],$item["history"],$item["status"],$item["type"],$item["snmp_community"],$item["snmp_oid"],$item["value_type"],$item["trapper_hosts"],$item["snmp_port"],$item["units"],$item["multiplier"],$item["delta"],$item["snmpv3_securityname"],$item["snmpv3_securitylevel"],$item["snmpv3_authpassphrase"],$item["snmpv3_privpassphrase"],$item["formula"],$item["trends"]); + $host=get_host_by_hostid($row["hostid"]); + info("Updated for linked host ".$host["host"]); } } } diff --git a/frontends/php/include/triggers.inc.php b/frontends/php/include/triggers.inc.php index 032bbe41..415c5cf9 100644 --- a/frontends/php/include/triggers.inc.php +++ b/frontends/php/include/triggers.inc.php @@ -387,6 +387,9 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; $expression=str_replace("{".$row2["functionid"]."}","{".$functionid."}",$trigger["expression"]); $sql="update triggers set expression='$expression' where triggerid=$triggerid_new"; DBexecute($sql); + + $host=get_host_by_hostid($row["hostid"]); + info("Added trigger to linked host ".$host["host"]); } } } @@ -422,6 +425,9 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; while($row2=DBfetch($result2)) { delete_trigger($row2["triggerid"]); + + $host=get_host_by_hostid($row["hostid"]); + info("Deleted trigger from linked host ".$host["host"]); } } |
