array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), "type"=> array(T_ZBX_INT, O_OPT, P_SYS, IN("0,1"), NULL) ); check_fields($fields); validate_group(PERM_READ_ONLY,array("allow_all_hosts","monitored_hosts","with_monitored_items")); ?> AddItem(0,S_ALL_SMALL); if($_REQUEST["type"] == SHOW_TRIGGERS) { $from = ", functions f, triggers t"; $where = " and i.itemid=f.itemid and f.triggerid=t.triggerid and t.status=".TRIGGER_STATUS_ENABLED; } else { $where = $from = ''; } $result=DBselect("select distinct g.groupid,g.name from groups g, hosts_groups hg, hosts h, items i".$from. " where g.groupid in (". get_accessible_groups_by_user($USER_DETAILS,PERM_READ_LIST, null, null, $ZBX_CURNODEID). ") ". " and hg.groupid=g.groupid and h.status=".HOST_STATUS_MONITORED. " and h.hostid=i.hostid and hg.hostid=h.hostid and i.status=".ITEM_STATUS_ACTIVE. $where. " order by g.name"); while($row=DBfetch($result)) { $cmbGroup->AddItem($row["groupid"],$row["name"]); } $form->AddItem(array(S_GROUP.SPACE,$cmbGroup)); $cmbType = new CComboBox("type",$_REQUEST["type"],"submit()"); $cmbType->AddItem(SHOW_TRIGGERS,S_TRIGGERS); $cmbType->AddItem(SHOW_DATA, S_DATA); $form->AddItem(array(S_TYPE.SPACE,$cmbType)); show_table_header(S_OVERVIEW_BIG, $form); ?> Show(); unset($table); } elseif($_REQUEST["type"]==SHOW_TRIGGERS) { COpt::profiling_start("get_triggers_overview"); $table = get_triggers_overview($_REQUEST["groupid"], $ZBX_CURNODEID); COpt::profiling_stop("get_triggers_overview"); $table->Show(); unset($table); } ?>