Esempio n. 1
0
            $table->setHeader(array(_('Next check'), _('Delayed by'), is_show_all_nodes() ? _('Node') : null, _('Host'), _('Name')));
            while ($row = DBfetch($result)) {
                $res = calculateItemNextcheck($row['interfaceid'], $row['itemid'], $row['type'], $row['delay'], $row['delay_flex'], $row['lastclock']);
                if (0 != $row['proxy_hostid'] && 0 != $res['delay']) {
                    $res['nextcheck'] = $row['lastclock'] + $res['delay'];
                }
                $diff = $now - $res['nextcheck'];
                if ($diff <= 5) {
                    continue;
                }
                $arr[] = array($res['nextcheck'], $row['hostid'], $row['hostname'], itemName($row));
            }
            $rows = 0;
            sort($arr);
            foreach ($arr as $r) {
                $rows++;
                if ($rows > 500) {
                    $truncated = true;
                    break;
                }
                $table->addRow(array(zbx_date2str(QUEUE_NODES_DATE_FORMAT, $r[0]), zbx_date2age($r[0]), get_node_name_by_elid($r[1]), $r[2], $r[3]));
            }
        }
    }
}
$queue_wdgt->addItem($table);
$queue_wdgt->Show();
if ($_REQUEST['config'] != 0) {
    show_table_header(_('Total') . ": " . $table->GetNumRows() . ($truncated ? ' (' . _('Truncated') . ')' : ''));
}
require_once dirname(__FILE__) . '/include/page_footer.php';