$sec_600[$row['proxy_hostid']]++; } else { $sec_rest[$row['proxy_hostid']]++; } } } } } } $table->setHeader(array(S_PROXY, S_5_SECONDS, S_10_SECONDS, S_30_SECONDS, S_1_MINUTE, S_5_MINUTES, S_MORE_THAN_10_MINUTES)); $db_proxies = DBselect('select hostid,host from hosts where status=' . HOST_STATUS_PROXY . ' order by host'); while (null != ($db_proxy = DBfetch($db_proxies))) { $elements = array($db_proxy['host'], new CCol($sec_10[$db_proxy['hostid']], $sec_10[$db_proxy['hostid']] ? "unknown_trigger" : "normal"), new CCol($sec_30[$db_proxy['hostid']], $sec_30[$db_proxy['hostid']] ? "information" : "normal"), new CCol($sec_60[$db_proxy['hostid']], $sec_60[$db_proxy['hostid']] ? "warning" : "normal"), new CCol($sec_300[$db_proxy['hostid']], $sec_300[$db_proxy['hostid']] ? "average" : "normal"), new CCol($sec_600[$db_proxy['hostid']], $sec_600[$db_proxy['hostid']] ? "high" : "normal"), new CCol($sec_rest[$db_proxy['hostid']], $sec_rest[$db_proxy['hostid']] ? "disaster" : "normal")); $table->addRow($elements); } $elements = array(new CCol(S_SERVER, 'bold'), new CCol($sec_10[0], $sec_10[0] ? 'unknown_trigger' : 'normal'), new CCol($sec_30[0], $sec_30[0] ? 'information' : 'normal'), new CCol($sec_60[0], $sec_60[0] ? 'warning' : 'normal'), new CCol($sec_300[0], $sec_300[0] ? 'average' : 'normal'), new CCol($sec_600[0], $sec_600[0] ? 'high' : 'normal'), new CCol($sec_rest[0], $sec_rest[0] ? 'disaster' : 'normal')); $table->addRow($elements); } else { if ($_REQUEST["show"] == 2) { $table->SetHeader(array(S_NEXT_CHECK, is_show_subnodes() ? S_NODE : null, S_HOST, S_DESCRIPTION)); while ($row = DBfetch($result)) { $table->AddRow(array(date("m.d.Y H:i:s", $row["nextcheck"]), get_node_name_by_elid($row['hostid']), $row['host'], item_description($row))); } } } } $table->Show(); if ($_REQUEST["show"] != 0) { show_table_header(S_TOTAL . ": " . $table->GetNumRows()); } include_once "include/page_footer.php";
$arr = array(); $table->SetHeader(array(S_NEXT_CHECK, S_DELAYED_BY, is_show_all_nodes() ? S_NODE : null, S_HOST, S_DESCRIPTION)); while ($row = DBfetch($result)) { $res = calculate_item_nextcheck($row['itemid'], $row['type'], $row['delay'], $row['delay_flex'], $row['lastclock']); if (0 != $row['proxy_hostid']) { $res['nextcheck'] = $row['lastclock'] + $res['delay']; } $diff = $now - $res['nextcheck']; if ($diff <= 5) { continue; } array_push($arr, array($res['nextcheck'], $row['hostid'], $row['host'], item_description($row))); } $rows = 0; sort($arr); foreach ($arr as $r) { $rows++; if ($rows > 500) { $truncated = 1; break; } $table->AddRow(array(date(S_DATE_FORMAT_YMDHMS, $r[0]), zbx_date2age($r[0]), get_node_name_by_elid($r[1]), $r[2], $r[3])); } } } } $table->Show(); if ($_REQUEST["config"] != 0) { show_table_header(S_TOTAL . ": " . $table->GetNumRows() . ($truncated ? ' (' . S_TRUNCATED . ')' : '')); } include_once "include/page_footer.php";