array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), ); check_fields($fields); ?> AddItem(0,S_ALL_SMALL); $db_drules = DBselect('select distinct * from drules where '.DBid2nodeid('druleid').'='.$ZBX_CURNODEID." order by name"); while($drule_data = DBfetch($db_drules)) $cmbDRules->AddItem($drule_data['druleid'],$drule_data['name']); $r_form->AddItem(array(S_DISCOVERY_RULE.SPACE,$cmbDRules)); show_table_header(S_STATUS_OF_DISCOVERY_BIG, $r_form); ?> 0 ? ' where druleid='.$druleid : ''). ' order by status,ip' ); $services = array(); $discovery_info = array(); while($drule_data = DBfetch($db_dhosts)) { $class = 'enabled'; $time = 'lastup'; if(DHOST_STATUS_DISABLED == $drule_data['status']) { $class = 'disabled'; $time = 'lastdown'; } $discovery_info[$drule_data['ip']] = array('class' => $class, 'time' => $drule_data[$time]); $db_dservices = DBselect('select * from dservices where dhostid='.$drule_data['dhostid'].' order by status,type,port'); while($dservice_data = DBfetch($db_dservices)) { $class = 'active'; $time = 'lastup'; if(DSVC_STATUS_DISABLED == $dservice_data['status']) { $class = 'inactive'; $time = 'lastdown'; } $service_name = discovery_check_type2str($dservice_data['type']).':'.$dservice_data['port']; $services[$service_name] = 1; $discovery_info [$drule_data['ip']] ['services'] [$service_name] = array('class' => $class, 'time' => $dservice_data[$time]); } } ksort($services); $header = array( new CCol(S_HOST, 'center'), new CCol(S_UPTIME.'/'.BR.S_DOWNTIME,'center') ); foreach($services as $name => $foo) { $header[] = new CImg('vtext.php?text='.$name); } $table = new CTableInfo(); $table->SetHeader($header,'vertical_header'); foreach($discovery_info as $ip => $h_data) { $table_row = array( new CSpan($ip, $h_data['class']), new CSpan(convert_units(time() - $h_data['time'], 'uptime'), $h_data['class']) ); foreach($services as $name => $foo) { $class = null; $time = SPACE; if(isset($h_data['services'][$name])) { $class = $h_data['services'][$name]['class']; $time = $h_data['services'][$name]['time']; } $table_row[] = new CCol(SPACE, $class); } $table->AddRow($table_row); } $table->Show(); ?>