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/graphs.inc.php | |
| parent | 07523be771478603a8b15ab748278f6eef147197 (diff) | |
| download | zabbix-f0992b870a4b4b2cd541bce01ae20694b02aaf02.tar.gz zabbix-f0992b870a4b4b2cd541bce01ae20694b02aaf02.tar.xz zabbix-f0992b870a4b4b2cd541bce01ae20694b02aaf02.zip | |
Minor changes.
git-svn-id: svn://svn.zabbix.com/trunk@1760 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/graphs.inc.php')
| -rw-r--r-- | frontends/php/include/graphs.inc.php | 8 |
1 files changed, 8 insertions, 0 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"]); } } } |
