parse_all(); function getSelectOptions($selType, $selValue) { if ($selType == 'REFRESH') { $options = array('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 = array('5'=>'Top 5', '10'=>'Top 10', '20'=>'Top 20', '50'=>'Top 50', '0'=>'All'); } else if ($selType == 'VH_SHOW_SORTBY') { $options = array( '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 = array( '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); } $refresh = DUtil::getGoodVal(DUtil::grab_input("request",'refresh')); $vh_show_ind = DUtil::getGoodVal(DUtil::grab_input("request","vh_show_ind")); $vh_show_top = DUtil::getGoodVal(DUtil::grab_input("request","vh_show_top")); $vh_show_filter = DUtil::getGoodVal(DUtil::grab_input("request","vh_show_filter","string")); $vh_show_sort = DUtil::getGoodVal(DUtil::grab_input("request","vh_show_sort","string")); $eap_show_ind = DUtil::getGoodVal(DUtil::grab_input("request","eap_show_ind")); $eap_show_top = DUtil::getGoodVal(DUtil::grab_input("request","eap_show_top")); $eap_show_filter = DUtil::getGoodVal(DUtil::grab_input("request","eap_show_filter","string")); $eap_show_sort = DUtil::getGoodVal(DUtil::grab_input("request","eap_show_sort","string")); $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 <= 1 && $refresh != 0) { $refresh = 5; } if($refresh >= 2) { echo ''; } ?>
Real-Time Statistics    Refresh Interval:
'; $buf .= '' ."\n"; $blocked_count = count($stats->blocked_ip); $blocked_sample = 'NONE'; if ($blocked_count > 14) { $blocked_sample = join(', ', array_slice($stats->blocked_ip, 0, 14) ); $blocked_sample .= '
...
Total ' . $blocked_count . ' blocked    Show All'; } else if ($blocked_count > 0) { $blocked_sample = join(', ', $stats->blocked_ip); } $buf .= '' ."\n"; echo $buf; ?>
Server Health
Uptime'. ucwords($stats->uptime) .'
Load' . $stats->load_avg .'
Anti-DDoS Blocked IP' . $blocked_sample .'
' . '' . '' . ''."\n"; $buf .= '' . '' . '' . ''."\n"; $buf .= '' . '' . '' . ''."\n"; $buf .= '' . '' . '' . ''."\n"; $buf .= '' . '' . '' . ''."\n"; $buf .= '' . '' . '' . ''."\n"; $buf .= '' . '' . '\n"; $buf .= '' . '' . '' . '\n"; $buf .= '' . '' . '' . '\n"; $buf .= '' . '' . '' . '\n"; $total_req = $stats->serv->req_total; if ($total_req == 0) { $total_req = 1; $cache_hit_rate = 0; } else { $cacheable_req = $total_req - $stats->serv->total_static_hits; if ($cacheable_req == 0) $cache_hit_rate = 0; else $cache_hit_rate = number_format($stats->serv->total_cache_hits / $total_req, 4) * 100; } echo $buf; ?>
Server
Network ThroughputHttp In' . number_format($stats->bps_in) . 'KBHttp Out' . number_format($stats->bps_out) . 'KB
 Https In' . number_format($stats->ssl_bps_in) . 'KBHttps Out' . number_format($stats->ssl_bps_out) . 'KB
ConnectionsMax' . number_format($stats->max_conn) . 'Idle' . number_format($stats->idle_conn) . '
 Http Used' . number_format($stats->plain_conn) . 'Http Free' . number_format($stats->avail_conn) . '
 Https Used' . number_format($stats->ssl_conn) . 'Https Free' . number_format($stats->avail_ssl_conn) . '
Requests   (Details)In Processing' . number_format($stats->serv->req_processing). 'Req/Sec' . number_format($stats->serv->req_per_sec, 1) . '
 Total Req' . number_format($stats->serv->req_total). "
 Total Static Hits' . number_format($stats->serv->total_static_hits) . 'Static Hits/Sec' . number_format($stats->serv->static_hits_per_sec, 1) . "
 Total Public Cache Hits' . number_format($stats->serv->total_cache_hits) . 'Public Cache Hits/Sec' . number_format($stats->serv->cache_hits_per_sec, 1) . "
 Total Private Cache Hits' . number_format($stats->serv->total_private_cache_hits) . 'Private Cache Hits/Sec' . number_format($stats->serv->private_cache_hits_per_sec, 1) . "
' . '' . '' . '' . '' . '' . "\n"; $vhlist = $stats->apply_vh_filter($vh_show_top, $vh_show_filter, $vh_show_sort); foreach( $vhlist as $vhname ) { if ($vhname == '_Server') continue; $vh = $stats->vhosts[$vhname]; $buf .= ''; $buf .= ''; $buf .= ''; $buf .= ''; $buf .= ''; $buf .= ''; $buf .= ''; $buf .= ''; $buf .= ''; $buf .= ''; $buf .= ''; $buf .= ''; $buf .= ''."\n"; } echo $buf; } ?>
'."\n"; $buf .= '' ."\n"; $buf .= ''."\n"; $buf .= '
Virtual Host Hide'; } else { $buf .= ''; } $buf .= 'Display: Filter by Name (take regExp): Sort by: '; echo $buf; ?>
VH Name Req in ProcessingReq/SecTotal Static Hits | Hits/SecPublic Cache Hits | Hits/SecPrivate Cache Hits | Hits/SecExtApp ProcessesEAProc In UseEAProc IdleEAProc WaitQEAProc Req/Sec
' . $vhname . ''.number_format($vh->req_processing).''.number_format($vh->req_per_sec,1).''.number_format($vh->total_static_hits). ' | ' . number_format($vh->static_hits_per_sec,1).''.number_format($vh->total_cache_hits). ' | ' .number_format($vh->cache_hits_per_sec,1).''.number_format($vh->total_private_cache_hits). ' | ' .number_format($vh->private_cache_hits_per_sec,1).''.number_format($vh->eap_process).''.number_format($vh->eap_inuse).''.number_format($vh->eap_idle).''.number_format($vh->eap_waitQ).''.number_format($vh->eap_req_per_sec,1).'
' . "\n"; if ($eap_show_ind == 'Show') { $buf .= '' . '' . '' . '' . "\n"; $exapps = $stats->apply_eap_filter($eap_show_top, $eap_show_filter, $eap_show_sort); foreach( $exapps as $eap ) { $buf .= ''; $buf .= ''; $buf .= ''; $buf .= ''; $buf .= ''; $buf .= ''; $buf .= ''; $buf .= ''; $buf .= ''; $buf .= ''; $buf .= ''; $buf .= ''."\n"; } } echo $buf; ?>
' . '' . ''."\n"; $buf .= '' ."\n"; $buf .= ''."\n"; $buf .= '' . '
External Application'; if ($eap_show_ind == 'Show') { $buf .= ''; } else { $buf .= ''; } $buf .= 'Display: Filter by Name (take regExp): Sort by:
ScopeTypeName Max CONNEff MaxPoolIn UseIdleWaitQReq/Sec
' . $eap->vhost . '' . $eap->type . '' . $eap->extapp . '' . ''.number_format($eap->config_max_conn).''.number_format($eap->effect_max_conn).''.number_format($eap->pool_size).''.number_format($eap->inuse_conn).''.number_format($eap->idle_conn).''.number_format($eap->waitqueue_depth).''.number_format($eap->req_per_sec,1).'