';
$canvas .= '
';
$canvas .= area_graph($interactive_graph, $chart, 800, 300, $color, $legend, $long_index, $no_data_image, "", "", "",
"", '', '', '', 1, array(), array(), 0, 0, '', false, '', false);
$canvas .= '';
echo $canvas;
$table->width = '99%';
$table->id = 'table-form';
$table->class = 'databox';
$table->style = array ();
$table->style[0] = 'font-weight: bold;';
$table->style[1] = 'font-weight: bold;';
$table->style[2] = 'font-weight: bold;';
$table->data = array ();
$graph_fields['cpu_load'] = __('Pandora Server CPU');
$graph_fields['pending_packets'] = __('Pandora Server Pending packets');
$graph_fields['disk_io_wait'] = __('Pandora Server Disk IO Wait');
$graph_fields['apache_load'] = __('Pandora Server Apache load');
$graph_fields['mysql_load'] = __('Pandora Server MySQL load');
$graph_fields['server_load'] = __('Pandora Server load');
$graph_fields['snmp_interface'] = __('SNMP Interface throughput');
$graph = get_parameter('graph', 'cpu_load');
$refresh = get_parameter('refresh', '1000');
$data['graph'] = __('Graph') . '
' . html_print_select ($graph_fields, 'graph', $graph, '', '', 0, true);
$data['reset'] = html_print_button(__('Clear graph'), 'reset', false, 'clearGraph()', 'class="sub delete"', true);
$refresh_fields[1000] = human_time_description_raw(1, true, 'large');
$refresh_fields[5000] = human_time_description_raw(5, true, 'large');
$refresh_fields[10000] = human_time_description_raw(10, true, 'large');
$refresh_fields[30000] = human_time_description_raw(30, true, 'large');
$data['refresh'] = __('Refresh interval') . '
' . html_print_select ($refresh_fields, 'refresh', $refresh, '', '', 0, true);
$data['incremental'] = __('Incremental') . '
' . html_print_checkbox ('incremental', 1, 0, true);
$table->data[] = $data;
if ($graph == 'snmp_interface') {
$snmp_address = '';
$snmp_community = '';
$snmp_oid = '';
$snmp_ver = '1';
$snmp_inc = false;
$data = array();
$data['snmp_address'] = __('Target IP') . '
' . html_print_input_text ('ip_target', $snmp_address, '', 50, 255, true);
$table->colspan[1]['snmp_address'] = 2;
$data['snmp_community'] = __('Community') . '
' . html_print_input_text ('snmp_community', $snmp_community, '', 50, 255, true);
$table->colspan[1]['snmp_community'] = 2;
$table->data[] = $data;
$snmp_versions = array();
$snmp_versions['1'] = '1';
$snmp_versions['2'] = '2';
$snmp_versions['2c'] = '2c';
$data = array();
$data['snmp_oid'] = __('OID') . '
' . html_print_input_text ('snmp_oid', $snmp_oid, '', 100, 255, true);
$data['snmp_oid'] .= html_print_button (__('SNMP walk'), 'snmp_walk', false, 'snmpBrowserWindow()', 'class="sub next"', true);
$table->colspan[2]['snmp_oid'] = 2;
$data['snmp_ver'] = __('Version') . '
' . html_print_select ($snmp_versions, 'snmp_version', $snmp_ver, '', '', 0, true);
$table->colspan[2]['snmp_ver'] = 2;
$table->data[] = $data;
snmp_browser_print_container (false, '100%', '60%', 'none');
}
echo '';
// Define a custom action to save the OID selected in the SNMP browser to the form
html_print_input_hidden ('custom_action', urlencode (base64_encode(' ')), false);
html_print_input_hidden ('incremental_base', '0');
echo '';
echo '';
echo '';
// Store servers timezone offset to be retrieved from js
set_js_value('timezone_offset', date('Z', time()));
}
extensions_add_operation_menu_option (__('Realtime graphs'), null, null, "v1r1");
extensions_add_main_function ('pandora_realtime_graphs');
$db = NULL;
?>