parse_all();
function getSelectOptions($selType, $selValue)
{
if ($selType == 'REFRESH')
{
$options = ['0'=>'Stop',
'10'=>'10 Seconds','15'=>'15 Seconds',
'30'=>'30 Seconds','60'=>'60 Seconds',
'120' => '2 Minutes', '300' => '5 Minutes'];
}
else if ($selType == 'SHOW_TOP')
{
$options = ['5'=>'Top 5',
'10'=>'Top 10', '20'=>'Top 20',
'50'=>'Top 50', '0'=>'All'];
}
else if ($selType == 'VH_SHOW_SORTBY')
{
$options = [
'vhname'=>'Virtual Host Name',
'req_processing'=>'Requests in Processing',
'req_per_sec'=>'Request/Second',
'eap_process'=>'ExtApp Processes',
'eap_inuse'=>'EAProc In Use',
'eap_idle'=>'EAProc Idle',
'eap_waitQ'=>'EAProc WaitQ',
'eap_req_per_sec'=>'EAProc Req/Sec'];
}
else if ($selType == 'EAP_SHOW_SORTBY')
{
$options = [
'vhost'=>'Scope',
'type'=>'Type',
'extapp'=>'Name',
'config_max_conn'=>'Max CONN',
'effect_max_conn'=>'Eff Max',
'pool_size'=>'Pool',
'inuse_conn'=>'In Use',
'idle_conn'=>'Idle',
'waitqueue_depth'=>'WaitQ',
'req_per_sec'=>'Req/Sec'];
}
return DUtil::genOptions($options, $selValue);
}
function td_number($label, $number, $suffix = '', $decimals = 0, $col = 1)
{
$colspan = ($col == 1) ? '' : "colspan=\"$col\" ";
return sprintf('
%s | %s%s | ',
$label, $colspan, number_format($number, $decimals), $suffix);
}
function td_num2($number, $decimals = 0)
{
return '' . number_format($number, $decimals) . ' | ';
}
function td_num3($hits, $hits_per_sec)
{
return '' . number_format($hits) . ' | ' . number_format($hits_per_sec, 1) . ' | ';
}
function td_val($value)
{
return ''. $value . ' | ';
}
function td_label($label, $width = 0, $help_key = '')
{
if ($help_key) {
$dhelp_item = DATTR_HELP::GetInstance()->GetItem($help_key);
$help = '  ' . $dhelp_item->render($help_key);
} else {
$help = '';
}
return '' . $label . $help . ' | ';
}
function input_val($name)
{
return DUtil::getGoodVal(DUtil::grab_input('REQUEST', $name));
}
function graph_icon($gtype, $vhost='', $extapp='')
{
$param = ['gtype' => $gtype];
if ($vhost) {
$param['vhost'] = $vhost;
}
if ($extapp) {
$param['extapp'] = $extapp;
}
$url = 'graph_html.php?' . http_build_query($param);
$window_name = md5($url);
return '";
}
$etr = "\n";
$refresh = input_val('refresh');
$vh_show_ind = input_val('vh_show_ind');
$vh_show_top = input_val('vh_show_top');
$vh_show_filter = input_val('vh_show_filter');
$vh_show_sort = input_val('vh_show_sort');
$eap_show_ind = input_val('eap_show_ind');
$eap_show_top = input_val('eap_show_top');
$eap_show_filter = input_val('eap_show_filter');
$eap_show_sort = input_val('eap_show_sort');
$cur_time = gmdate("D M j H:i:s T");
$server_info = "server {$service->serv['name']} snapshot at $cur_time";
// setting defaults
if ($vh_show_ind == '') {
$vh_show_ind = 'Show';
}
if ($vh_show_top === '') {
$vh_show_top = '5';
}
if ($vh_show_sort == '') {
$vh_show_sort = 'req_per_sec';
}
if ($eap_show_ind == '') {
$eap_show_ind = 'Show';
}
if ($eap_show_top === '') {
$eap_show_top = '5';
}
if ($eap_show_sort == '') {
$eap_show_sort = 'req_per_sec';
}
if ($refresh > 0 && $refresh < 10) {
$refresh = 10;
}
if($refresh >= 10) {
echo '';
}
?>