\n";
print "
\n";
print "
| " . __('Title') . " |
" . html_escape($xport_array['meta']['title_cache']) . " |
\n";
print "
| " . __('Vertical Label') . " |
" . html_escape($xport_array['meta']['vertical_label']) . " |
\n";
print "
| " . __('Start Date') . " |
" . date('Y-m-d H:i:s', $xport_array['meta']['start']) . " |
\n";
print "
| " . __('End Date') . " |
" . date('Y-m-d H:i:s', ($xport_array['meta']['end'] == $xport_array['meta']['start']) ? $xport_array['meta']['start'] + $xport_array['meta']['step'] * ($xport_array['meta']['rows'] - 1) : $xport_array['meta']['end']) . " |
\n";
print "
| " . __('Step') . " |
" . $xport_array['meta']['step'] . " |
\n";
print "
| " . __('Total Rows') . " |
" . $xport_array['meta']['rows'] . " |
\n";
print "
| " . __('Graph ID') . " |
" . $xport_array['meta']['local_graph_id'] . " |
\n";
print "
| " . __('Host ID') . " |
" . $xport_array['meta']['host_id'] . " |
\n";
$class = 'even';
if (isset($xport_meta['NthPercentile'])) {
foreach ($xport_meta['NthPercentile'] as $item) {
if ($class == 'even') {
$class = 'odd';
} else {
$class = 'even';
}
print "
| " . __('Nth Percentile') . ' [ ' . html_escape($item['format']) . " ] |
" . html_escape($item['value']) . " |
\n";
}
}
if (isset($xport_meta['Summation'])) {
foreach ($xport_meta['Summation'] as $item) {
if ($class == 'even') {
$class = 'odd';
} else {
$class = 'even';
}
print "
| " . __('Summation') . ' [ ' . html_escape($item['format']) . " ] |
" . html_escape($item['value']) . " |
\n";
}
}
print "
\n";
print "\n";
print "\n";
print "
\n";
print "\n";
}
}
if (isset($xport_array['data']) && is_array($xport_array['data'])) {
if (!$html) {
$j = 1;
foreach ($xport_array['data'] as $row) {
$data = '"' . date('Y-m-d H:i:s', (isset($row['timestamp']) ? $row['timestamp'] : $xport_array['meta']['start'] + $j * $xport_array['meta']['step'])) . '"';
for ($i = 1; $i <= $xport_array['meta']['columns']; $i++) {
$data .= ',"' . $row['col' . $i] . '"';
}
$output .= $data . "\n";
$j++;
}
// Full UTF-8 Output
print "\xEF\xBB\xBF";
print $output;
} else {
$j = 1;
foreach ($xport_array['data'] as $row) {
print "| " . date('Y-m-d H:i:s', (isset($row['timestamp']) ? $row['timestamp'] : $xport_array['meta']['start'] + $j * $xport_array['meta']['step'])) . ' | ';
for ($i = 1; $i <= $xport_array['meta']['columns']; $i++) {
$row_data = floatval($row['col'. $i]);
if ($row_data > 1) {
$row_data = trim(number_format_i18n(round($row_data, 3), 2, $graph_info['base_value']));
} elseif ($row_data == 0) {
$row_data = '-';
if (!is_numeric($row['col'.$i])) {
$row_data .= '(unexpected: ' . $row['col' . $i] . ')';
}
} elseif (is_numeric($row_data)) {
$row_data = trim(number_format_i18n(round($row_data, 5), 4));
} else {
$row_data = 'U';
}
print "$row_data | ";
}
print "
\n";
$j++;
}
print "| \n";
?>
|
\n";
}
}
/* log the memory usage */
cacti_log("The Peak Graph XPORT Memory Usage was '" . memory_get_peak_usage() . "'", false, 'WEBUI', POLLER_VERBOSITY_MEDIUM);