0 && !isset($_REQUEST["period"]) && !isset($_REQUEST["stime"])) { define('ZBX_PAGE_DO_REFRESH', 1); } include_once "include/page_header.php"; ?> array(T_ZBX_INT, O_OPT, P_SYS, DB_ID,NULL), "hostid"=> array(T_ZBX_INT, O_OPT, P_SYS, DB_ID,NULL), "graphid"=> array(T_ZBX_INT, O_OPT, P_SYS, DB_ID,NULL), "dec"=> array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0,65535*65535),NULL), "inc"=> array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0,65535*65535),NULL), "left"=> array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0,65535*65535),NULL), "right"=> array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0,65535*65535),NULL), "from"=> array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0,65535*65535),NULL), "period"=> array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0,65535*65535),NULL), "stime"=> array(T_ZBX_STR, O_OPT, P_SYS, NULL,NULL), "action"=> array(T_ZBX_STR, O_OPT, P_SYS, IN("'go'"),NULL), "reset"=> array(T_ZBX_STR, O_OPT, P_SYS, IN("'reset'"),NULL), "fullscreen"=> array(T_ZBX_INT, O_OPT, P_SYS, IN("1"), NULL) ); check_fields($fields); ?> 0 && $_REQUEST["hostid"] > 0) { $result=DBselect("select g.graphid from graphs g, graphs_items gi, items i". " where i.hostid=".$_REQUEST["hostid"]." and gi.itemid = i.itemid". " and gi.graphid = g.graphid and g.graphid=".$_REQUEST["graphid"]); if(!DBfetch($result)) $_REQUEST["graphid"] = 0; } ?> 0 && $_REQUEST["period"] >= 3600) { update_profile("web.graph[".$_REQUEST["graphid"]."].period",$_REQUEST["period"]); } update_profile("web.charts.graphid",$_REQUEST["graphid"]); ?> 0) { if(! ($row = DBfetch(DBselect(" select distinct g.name from hosts h, items i, graphs_items gi, graphs g ". " where h.status=".HOST_STATUS_MONITORED. " and h.hostid=i.hostid and g.graphid=".$_REQUEST["graphid"]. " and i.itemid=gi.itemid and gi.graphid=g.graphid". " and h.hostid not in (".$denyed_hosts.") ". " and ".DBid2nodeid("g.graphid")."=".$ZBX_CURNODEID. " order by h.host" )))) { update_profile("web.charts.graphid",0); access_deny(); } array_push($h1, new CLink($row["name"], "?graphid=".$_REQUEST["graphid"].(isset($_REQUEST["fullscreen"]) ? "&fullscreen=1" : ""))); } else { array_push($h1, S_SELECT_GRAPH_TO_DISPLAY); } $r_form = new CForm(); if(isset($_REQUEST['fullscreen'])) $r_form->AddVar('fullscreen', 1); $cmbGroup = new CComboBox("groupid",$_REQUEST["groupid"],"submit()"); $cmbHosts = new CComboBox("hostid",$_REQUEST["hostid"],"submit()"); $cmbGraph = new CComboBox("graphid",$_REQUEST["graphid"],"submit()"); $cmbGroup->AddItem(0,S_ALL_SMALL); $result=DBselect("select distinct g.groupid,g.name from groups g, hosts_groups hg, hosts h, items i, graphs_items gi ". " where g.groupid in (".$availiable_groups.") ". " and hg.groupid=g.groupid and h.status=".HOST_STATUS_MONITORED. " and h.hostid=i.hostid and hg.hostid=h.hostid and i.itemid=gi.itemid ". " order by g.name"); while($row=DBfetch($result)) { $cmbGroup->AddItem($row["groupid"],$row["name"]); } $r_form->AddItem(array(S_GROUP.SPACE,$cmbGroup)); if($_REQUEST["groupid"] > 0) { $sql = " select distinct h.hostid,h.host from hosts h,items i,hosts_groups hg, graphs_items gi ". " where h.status=".HOST_STATUS_MONITORED. " and h.hostid=i.hostid and hg.groupid=".$_REQUEST["groupid"]." and hg.hostid=h.hostid ". " and h.hostid not in (".$denyed_hosts.") and i.itemid=gi.itemid". " order by h.host"; } else { $cmbHosts->AddItem(0,S_ALL_SMALL); $sql = "select distinct h.hostid,h.host from hosts h,items i, graphs_items gi where h.status=".HOST_STATUS_MONITORED. " and i.status=".ITEM_STATUS_ACTIVE." and h.hostid=i.hostid". " and h.hostid not in (".$denyed_hosts.") and i.itemid=gi.itemid". " order by h.host"; } $result=DBselect($sql); while($row=DBfetch($result)) { $cmbHosts->AddItem($row["hostid"],$row["host"]); } $r_form->AddItem(array(SPACE.S_HOST.SPACE,$cmbHosts)); $cmbGraph->AddItem(0,S_SELECT_GRAPH_DOT_DOT_DOT); if($_REQUEST["hostid"] > 0) { $sql = "select distinct g.graphid,g.name from graphs g,graphs_items gi,items i". " where i.itemid=gi.itemid and g.graphid=gi.graphid and i.hostid=".$_REQUEST["hostid"]. " and ".DBid2nodeid("g.graphid")."=".$ZBX_CURNODEID. " and i.hostid not in (".$denyed_hosts.") ". " order by g.name"; } elseif ($_REQUEST["groupid"] > 0) { $sql = "select distinct g.graphid,g.name from graphs g,graphs_items gi,items i,hosts_groups hg,hosts h". " where i.itemid=gi.itemid and g.graphid=gi.graphid and i.hostid=hg.hostid and hg.groupid=".$_REQUEST["groupid"]. " and i.hostid=h.hostid and h.status=".HOST_STATUS_MONITORED. " and ".DBid2nodeid("g.graphid")."=".$ZBX_CURNODEID. " and h.hostid not in (".$denyed_hosts.") ". " order by g.name"; } else { $sql = "select distinct g.graphid,g.name from graphs g,graphs_items gi,items i,hosts h". " where i.itemid=gi.itemid and g.graphid=gi.graphid ". " and i.hostid=h.hostid and h.status=".HOST_STATUS_MONITORED. " and ".DBid2nodeid("g.graphid")."=".$ZBX_CURNODEID. " and h.hostid not in (".$denyed_hosts.") ". " order by g.name"; } $result = DBselect($sql); while($row=DBfetch($result)) { $cmbGraph->AddItem($row["graphid"],$row["name"]); } $r_form->AddItem(array(SPACE.S_GRAPH.SPACE,$cmbGraph)); show_table_header($h1, $r_form); ?> 0) { $row = "\n"; $table->AddRow($row); } $table->Show(); if($_REQUEST["graphid"] > 0) { navigation_bar("charts.php"); } ?>