array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), 'view_style'=> array(T_ZBX_INT, O_OPT, P_SYS, IN("0,1"), NULL), 'type'=> array(T_ZBX_INT, O_OPT, P_SYS, IN("0,1"), NULL) ); check_fields($fields); $_REQUEST['view_style'] = get_request('view_style',get_profile('web.overview.view.style',STYLE_TOP)); update_profile('web.overview.view.style',$_REQUEST['view_style']); validate_group(PERM_READ_ONLY,array("allow_all_hosts","monitored_hosts","with_monitored_items")); $_REQUEST["type"] = get_request("type",get_profile("web.overview.type",SHOW_TRIGGERS)); update_profile("web.overview.type",$_REQUEST["type"]); $form = new CForm(); $form->SetMethod('get'); $cmbGroup = new CComboBox("groupid",$_REQUEST["groupid"],"submit()"); $cmbGroup->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, get_current_nodeid()). ") ". " 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"], get_node_name_by_elid($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)); $help = new CHelp('web.view.php','left'); $help_table = new CTableInfo(); $help_table->AddOption('style', 'width: 200px'); if($_REQUEST["type"]==SHOW_TRIGGERS){ $help_table->AddRow(array(new CCol(SPACE, 'normal'), S_DISABLED)); } foreach(array(1,2,3,4,5) as $tr_severity) $help_table->AddRow(array(new CCol(get_severity_description($tr_severity),get_severity_style($tr_severity)),S_ENABLED)); $help_table->AddRow(array(new CCol(SPACE, 'unknown_trigger'), S_UNKNOWN)); if($_REQUEST["type"]==SHOW_TRIGGERS) { $col = new CCol(SPACE, 'unknown_trigger'); $col->AddOption('style','background-image: url(images/gradients/blink1.gif); '. 'background-position: top left; background-repeat: repeate;'); $help_table->AddRow(array($col, S_5_MIN)); $col = new CCol(SPACE, 'unknown_trigger'); $col->AddOption('style','background-image: url(images/gradients/blink2.gif); '. 'background-position: top left; background-repeat: repeate;'); $help_table->AddRow(array($col, S_15_MIN)); $help_table->AddRow(array(new CCol(SPACE), S_NO_TRIGGER)); } else { $help_table->AddRow(array(new CCol(SPACE), S_DISABLED.' '.S_OR.' '.S_NO_TRIGGER)); } $help->SetHint($help_table); show_table_header(array($help, S_OVERVIEW_BIG), $form); unset($help, $help_table, $form, $col); $form = new CForm(); $form->SetMethod('get'); $cmbStyle = new CComboBox("view_style",$_REQUEST["view_style"],"submit()"); $cmbStyle->AddItem(STYLE_TOP,S_TOP); $cmbStyle->AddItem(STYLE_LEFT,S_LEFT); $form->Additem(array(S_HOSTS_LOCATION.SPACE,$cmbStyle)); show_table_header($form, NULL); ?> Show(); unset($table); } elseif($_REQUEST["type"]==SHOW_TRIGGERS) { COpt::profiling_start("get_triggers_overview"); $table = get_triggers_overview($_REQUEST["groupid"],$_REQUEST['view_style']); COpt::profiling_stop("get_triggers_overview"); $table->Show(); unset($table); } ?>