bug #2537766 [import] Comments are stripped when editing store procedures
[phpmyadmin/crack.git] / server_status.php
blob860f5fd2f9d658ba02d37bf4a6224a50035c7d33
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * displays status variables with descriptions and some hints an optmizing
5 * + reset status variables
7 * @version $Id$
8 * @package phpMyAdmin
9 */
11 /**
12 * no need for variables importing
13 * @ignore
15 if (! defined('PMA_NO_VARIABLES_IMPORT')) {
16 define('PMA_NO_VARIABLES_IMPORT', true);
18 require_once './libraries/common.inc.php';
20 /**
21 * Does the common work
23 require './libraries/server_common.inc.php';
26 /**
27 * Displays the links
29 require './libraries/server_links.inc.php';
32 /**
33 * Displays the sub-page heading
35 echo '<div id="serverstatus">' . "\n";
36 echo '<h2>' . "\n"
37 . ($GLOBALS['cfg']['MainPageIconic']
38 ? '<img class="icon" src="' . $GLOBALS['pmaThemeImage'] .
39 's_status.png" width="16" height="16" alt="" />'
40 : '')
41 . $strServerStatus . "\n"
42 . '</h2>' . "\n";
45 /**
46 * flush status variables if requested
48 if (isset($_REQUEST['flush'])) {
49 $_flush_commands = array(
50 'STATUS',
51 'TABLES',
52 'QUERY CACHE',
55 if (in_array($_REQUEST['flush'], $_flush_commands)) {
56 PMA_DBI_query('FLUSH ' . $_REQUEST['flush'] . ';');
58 unset($_flush_commands);
62 /**
63 * get status from server
65 $server_status = PMA_DBI_fetch_result('SHOW GLOBAL STATUS', 0, 1);
67 /**
68 * get master status from server
70 $server_master_status = PMA_DBI_fetch_result('SHOW MASTER STATUS');
72 /**
73 * get slave status from server
75 $server_slave_status = PMA_DBI_fetch_result('SHOW SLAVE STATUS');
78 /**
79 * for some calculations we require also some server settings
81 $server_variables = PMA_DBI_fetch_result('SHOW GLOBAL VARIABLES', 0, 1);
83 /**
84 * starttime calculation
86 $start_time = PMA_DBI_fetch_value(
87 'SELECT UNIX_TIMESTAMP() - ' . $server_status['Uptime']);
90 /**
91 * cleanup some deprecated values
93 $deprecated = array(
94 'Com_prepare_sql' => 'Com_stmt_prepare',
95 'Com_execute_sql' => 'Com_stmt_execute',
96 'Com_dealloc_sql' => 'Com_stmt_close',
99 foreach ($deprecated as $old => $new) {
100 if (isset($server_status[$old])
101 && isset($server_status[$new])) {
102 unset($server_status[$old]);
105 unset($deprecated);
109 * calculate some values
111 // Key_buffer_fraction
112 if (isset($server_status['Key_blocks_unused'])
113 && isset($server_variables['key_cache_block_size'])
114 && isset($server_variables['key_buffer_size'])) {
115 $server_status['Key_buffer_fraction_%'] =
117 - $server_status['Key_blocks_unused']
118 * $server_variables['key_cache_block_size']
119 / $server_variables['key_buffer_size']
120 * 100;
121 } elseif (
122 isset($server_status['Key_blocks_used'])
123 && isset($server_variables['key_buffer_size'])) {
124 $server_status['Key_buffer_fraction_%'] =
125 $server_status['Key_blocks_used']
126 * 1024
127 / $server_variables['key_buffer_size'];
130 // Ratio for key read/write
131 if (isset($server_status['Key_writes'])
132 && isset($server_status['Key_write_requests'])
133 && $server_status['Key_write_requests'] > 0)
134 $server_status['Key_write_ratio_%'] = 100 * $server_status['Key_writes'] / $server_status['Key_write_requests'];
136 if (isset($server_status['Key_reads'])
137 && isset($server_status['Key_read_requests'])
138 && $server_status['Key_read_requests'] > 0)
139 $server_status['Key_read_ratio_%'] = 100 * $server_status['Key_reads'] / $server_status['Key_read_requests'];
141 // Threads_cache_hitrate
142 if (isset($server_status['Threads_created'])
143 && isset($server_status['Connections'])
144 && $server_status['Connections'] > 0) {
145 $server_status['Threads_cache_hitrate_%'] =
147 - $server_status['Threads_created']
148 / $server_status['Connections']
149 * 100;
154 * define some alerts
156 // name => max value before alert
157 $alerts = array(
158 // lower is better
159 // variable => max value
160 'Aborted_clients' => 0,
161 'Aborted_connects' => 0,
163 'Binlog_cache_disk_use' => 0,
165 'Created_tmp_disk_tables' => 0,
167 'Handler_read_rnd' => 0,
168 'Handler_read_rnd_next' => 0,
170 'Innodb_buffer_pool_pages_dirty' => 0,
171 'Innodb_buffer_pool_reads' => 0,
172 'Innodb_buffer_pool_wait_free' => 0,
173 'Innodb_log_waits' => 0,
174 'Innodb_row_lock_time_avg' => 10, // ms
175 'Innodb_row_lock_time_max' => 50, // ms
176 'Innodb_row_lock_waits' => 0,
178 'Slow_queries' => 0,
179 'Delayed_errors' => 0,
180 'Select_full_join' => 0,
181 'Select_range_check' => 0,
182 'Sort_merge_passes' => 0,
183 'Opened_tables' => 0,
184 'Table_locks_waited' => 0,
185 'Qcache_lowmem_prunes' => 0,
186 'Slow_launch_threads' => 0,
188 // depends on Key_read_requests
189 // normaly lower then 1:0.01
190 'Key_reads' => (0.01 * $server_status['Key_read_requests']),
191 // depends on Key_write_requests
192 // normaly nearly 1:1
193 'Key_writes' => (0.9 * $server_status['Key_write_requests']),
195 'Key_buffer_fraction' => 0.5,
197 // alert if more than 95% of thread cache is in use
198 'Threads_cached' => 0.95 * $server_variables['thread_cache_size']
200 // higher is better
201 // variable => min value
202 //'Handler read key' => '> ',
207 * split variables in sections
209 $allocations = array(
210 // variable name => section
212 'Com_' => 'com',
213 'Innodb_' => 'innodb',
214 'Ndb_' => 'ndb',
215 'Ssl_' => 'ssl',
216 'Handler_' => 'handler',
217 'Qcache_' => 'qcache',
218 'Threads_' => 'threads',
219 'Slow_launch_threads' => 'threads',
221 'Binlog_cache_' => 'binlog_cache',
222 'Created_tmp_' => 'created_tmp',
223 'Key_' => 'key',
225 'Delayed_' => 'delayed',
226 'Not_flushed_delayed_rows' => 'delayed',
228 'Flush_commands' => 'query',
229 'Last_query_cost' => 'query',
230 'Slow_queries' => 'query',
232 'Select_' => 'select',
233 'Sort_' => 'sort',
235 'Open_tables' => 'table',
236 'Opened_tables' => 'table',
237 'Table_locks_' => 'table',
239 'Rpl_status' => 'repl',
240 'Slave_' => 'repl',
242 'Tc_' => 'tc',
245 $sections = array(
246 // section => section name (description)
247 'com' => array('title' => ''),
248 'query' => array('title' => $strSQLQuery),
249 'innodb' => array('title' => 'InnoDB'),
250 'ndb' => array('title' => 'NDB'),
251 'ssl' => array('title' => 'SSL'),
252 'handler' => array('title' => $strHandler),
253 'qcache' => array('title' => $strQueryCache),
254 'threads' => array('title' => $strThreads),
255 'binlog_cache' => array('title' => $strBinaryLog),
256 'created_tmp' => array('title' => $strTempData),
257 'delayed' => array('title' => $strServerStatusDelayedInserts),
258 'key' => array('title' => $strKeyCache),
259 'select' => array('title' => $strJoins),
260 'repl' => array('title' => $strReplication),
261 'sort' => array('title' => $strSorting),
262 'table' => array('title' => $strNumTables),
263 'tc' => array('title' => $strTransactionCoordinator),
266 /**
267 * replication types
269 $replication_types = array('master', 'slave');
272 * define variables for master status
274 $master_variables = array(
275 'File',
276 'Position',
277 'Binlog_Do_DB',
278 'Binlog_Ignore_DB'
282 * Define variables for slave status
284 $slave_variables = array(
285 'Slave_IO_State',
286 'Master_Host',
287 'Master_User',
288 'Master_Port',
289 'Connect_Retry',
290 'Master_Log_File',
291 'Read_Master_Log_Pos',
292 'Relay_Log_File',
293 'Relay_Log_Pos',
294 'Relay_Master_Log_File',
295 'Slave_IO_Running',
296 'Slave_SQL_Running',
297 'Replicate_Do_DB',
298 'Replicate_Ignore_DB',
299 'Replicate_Do_Table',
300 'Replicate_Ignore_Table',
301 'Replicate_Wild_Do_Table',
302 'Replicate_Wild_Ignore_Table',
303 'Last_Errno',
304 'Last_Error',
305 'Skip_Counter',
306 'Exec_Master_Log_Pos',
307 'Relay_Log_Space',
308 'Until_Condition',
309 'Until_Log_File',
310 'Until_Log_Pos',
311 'Master_SSL_Allowed',
312 'Master_SSL_CA_File',
313 'Master_SSL_CA_Path',
314 'Master_SSL_Cert',
315 'Master_SSL_Cipher',
316 'Master_SSL_Key',
317 'Seconds_Behind_Master'
320 * define important variables, which need to be watched for correct running of replication in slave mode
322 $slave_variables_alerts = array(
323 'Slave_IO_Running' => 'No',
324 'Slave_SQL_Running' => 'No'
326 $slave_variables_oks = array(
327 'Slave_IO_Running' => 'Yes',
328 'Slave_SQL_Running' => 'Yes'
331 * define some needfull links/commands
333 // variable or section name => (name => url)
334 $links = array();
336 $links['table'][$strFlushTables]
337 = $PMA_PHP_SELF . '?flush=TABLES&amp;' . PMA_generate_common_url();
338 $links['table'][$strShowOpenTables]
339 = 'sql.php?sql_query=' . urlencode('SHOW OPEN TABLES') .
340 '&amp;goto=server_status.php&amp;' . PMA_generate_common_url();
342 $links['repl'][$strShowSlaveHosts]
343 = 'sql.php?sql_query=' . urlencode('SHOW SLAVE HOSTS') .
344 '&amp;goto=server_status.php&amp;' . PMA_generate_common_url();
345 $links['repl'][$strShowSlaveStatus]
346 = 'sql.php?sql_query=' . urlencode('SHOW SLAVE STATUS') .
347 '&amp;goto=server_status.php&amp;' . PMA_generate_common_url();
348 $links['repl']['doc'] = 'replication';
350 $links['qcache'][$strFlushQueryCache]
351 = $PMA_PHP_SELF . '?flush=' . urlencode('QUERY CACHE') . '&amp;' .
352 PMA_generate_common_url();
353 $links['qcache']['doc'] = 'query_cache';
355 $links['threads'][$strMySQLShowProcess]
356 = 'server_processlist.php?' . PMA_generate_common_url();
357 $links['threads']['doc'] = 'mysql_threads';
359 $links['key']['doc'] = 'myisam_key_cache';
361 $links['binlog_cache']['doc'] = 'binary_log';
363 $links['Slow_queries']['doc'] = 'slow_query_log';
365 $links['innodb'][$strServerTabVariables]
366 = 'server_engines.php?engine=InnoDB&amp;' . PMA_generate_common_url();
367 $links['innodb'][$strInnodbStat]
368 = 'server_engines.php?engine=InnoDB&amp;page=Status&amp;' .
369 PMA_generate_common_url();
370 $links['innodb']['doc'] = 'innodb';
373 // sort status vars into arrays
374 foreach ($server_status as $name => $value) {
375 if (isset($allocations[$name])) {
376 $sections[$allocations[$name]]['vars'][$name] = $value;
377 unset($server_status[$name]);
378 } else {
379 foreach ($allocations as $filter => $section) {
380 if (preg_match('/^' . $filter . '/', $name)
381 && isset($server_status[$name])) {
382 unset($server_status[$name]);
383 $sections[$section]['vars'][$name] = $value;
388 unset($name, $value, $filter, $section, $allocations);
390 // check which replication is available
391 foreach ($replication_types as $type)
393 if (count(${"server_{$type}_status"}) > 0)
394 ${"server_{$type}_status_run"} = true;
395 else
396 ${"server_{$type}_status_run"} = false;
398 // rest
399 $sections['all']['vars'] =& $server_status;
401 $hour_factor = 3600 / $server_status['Uptime'];
404 * start output
407 <div id="statuslinks">
408 <a href="<?php echo
409 $PMA_PHP_SELF . '?' . PMA_generate_common_url(); ?>"
410 ><?php echo $strRefresh; ?></a>
411 <a href="<?php echo
412 $PMA_PHP_SELF . '?flush=STATUS&amp;' . PMA_generate_common_url(); ?>"
413 ><?php echo $strShowStatusReset; ?></a>
414 <?php echo PMA_showMySQLDocu('server_status_variables','server_status_variables'); ?>
415 </div>
418 <?php
419 echo sprintf($strServerStatusUptime,
420 PMA_timespanFormat($server_status['Uptime']),
421 PMA_localisedDate($start_time)) . "\n";
423 </p>
425 <?php
426 if ($server_master_status_run || $server_slave_status_run) {
427 $replicationOut = "";
428 foreach ($replication_types as $type) {
429 if (${"server_{$type}_status_run"}) {
430 if ($replicationOut != "") {
431 $replicationOut .= $strAndSmall . ' ';
433 $replicationOut .= '<b>' . $type . '</b> ';
436 echo sprintf('<p>' . $strReplicationStatusInfo . '</p>', $replicationOut);
440 <div id="sectionlinks">
441 <?php
442 foreach ($sections as $section_name => $section) {
443 if (! empty($section['vars']) && ! empty($section['title'])) {
444 echo '<a href="' . $PMA_PHP_SELF . '?' .
445 PMA_generate_common_url() . '#' . $section_name . '">' .
446 $section['title'] . '</a>' . "\n";
450 </div>
452 <h3><?php echo $strServerTrafficNotes; ?></h3>
454 <table id="serverstatustraffic" class="data">
455 <thead>
456 <tr>
457 <th colspan="2"><?php echo $strTraffic . '&nbsp;' . PMA_showHint($strStatisticsOverrun); ?></th>
458 <th>&oslash; <?php echo $strPerHour; ?></th>
459 </tr>
460 </thead>
461 <tbody>
462 <tr class="odd">
463 <th class="name"><?php echo $strReceived; ?></th>
464 <td class="value"><?php echo
465 implode(' ',
466 PMA_formatByteDown($server_status['Bytes_received'], 4)); ?></td>
467 <td class="value"><?php echo
468 implode(' ',
469 PMA_formatByteDown(
470 $server_status['Bytes_received'] * $hour_factor, 4)); ?></td>
471 </tr>
472 <tr class="even">
473 <th class="name"><?php echo $strSent; ?></th>
474 <td class="value"><?php echo
475 implode(' ',
476 PMA_formatByteDown($server_status['Bytes_sent'], 4)); ?></td>
477 <td class="value"><?php echo
478 implode(' ',
479 PMA_formatByteDown(
480 $server_status['Bytes_sent'] * $hour_factor, 4)); ?></td>
481 </tr>
482 <tr class="odd">
483 <th class="name"><?php echo $strTotalUC; ?></th>
484 <td class="value"><?php echo
485 implode(' ',
486 PMA_formatByteDown(
487 $server_status['Bytes_received'] + $server_status['Bytes_sent'], 4)
488 ); ?></td>
489 <td class="value"><?php echo
490 implode(' ',
491 PMA_formatByteDown(
492 ($server_status['Bytes_received'] + $server_status['Bytes_sent'])
493 * $hour_factor, 4)
494 ); ?></td>
495 </tr>
496 </tbody>
497 </table>
499 <table id="serverstatusconnections" class="data">
500 <thead>
501 <tr>
502 <th colspan="2"><?php echo $strConnections; ?></th>
503 <th>&oslash; <?php echo $strPerHour; ?></th>
504 <th>%</th>
505 </tr>
506 </thead>
507 <tbody>
508 <tr class="odd">
509 <th class="name"><?php echo $strMaxConnects; ?></th>
510 <td class="value"><?php echo
511 PMA_formatNumber($server_status['Max_used_connections'], 0); ?> </td>
512 <td class="value">--- </td>
513 <td class="value">--- </td>
514 </tr>
515 <tr class="even">
516 <th class="name"><?php echo $strFailedAttempts; ?></th>
517 <td class="value"><?php echo
518 PMA_formatNumber($server_status['Aborted_connects'], 4, 0); ?></td>
519 <td class="value"><?php echo
520 PMA_formatNumber($server_status['Aborted_connects'] * $hour_factor,
521 4, 2); ?></td>
522 <td class="value"><?php echo
523 $server_status['Connections'] > 0
524 ? PMA_formatNumber(
525 $server_status['Aborted_connects'] * 100 / $server_status['Connections'],
526 0, 2) . '%'
527 : '--- '; ?></td>
528 </tr>
529 <tr class="odd">
530 <th class="name"><?php echo $strAbortedClients; ?></th>
531 <td class="value"><?php echo
532 PMA_formatNumber($server_status['Aborted_clients'], 4, 0); ?></td>
533 <td class="value"><?php echo
534 PMA_formatNumber($server_status['Aborted_clients'] * $hour_factor,
535 4, 2); ?></td>
536 <td class="value"><?php echo
537 $server_status['Connections'] > 0
538 ? PMA_formatNumber(
539 $server_status['Aborted_clients'] * 100 / $server_status['Connections'],
540 0, 2) . '%'
541 : '--- '; ?></td>
542 </tr>
543 <tr class="even">
544 <th class="name"><?php echo $strTotalUC; ?></th>
545 <td class="value"><?php echo
546 PMA_formatNumber($server_status['Connections'], 4, 0); ?></td>
547 <td class="value"><?php echo
548 PMA_formatNumber($server_status['Connections'] * $hour_factor,
549 4, 2); ?></td>
550 <td class="value"><?php echo
551 PMA_formatNumber(100, 0, 2); ?>%</td>
552 </tr>
553 </tbody>
554 </table>
556 <hr class="clearfloat" />
558 <h3><?php echo
559 sprintf($strQueryStatistics,
560 PMA_formatNumber($server_status['Questions'], 0)); ?></h3>
562 <table id="serverstatusqueriessummary" class="data">
563 <thead>
564 <tr>
565 <th><?php echo $strTotalUC; ?></th>
566 <th>&oslash; <?php echo $strPerHour; ?></th>
567 <th>&oslash; <?php echo $strPerMinute; ?></th>
568 <th>&oslash; <?php echo $strPerSecond; ?></th>
569 </tr>
570 </thead>
571 <tbody>
572 <tr class="odd">
573 <td class="value"><?php echo
574 PMA_formatNumber($server_status['Questions'], 4, 0); ?></td>
575 <td class="value"><?php echo
576 PMA_formatNumber($server_status['Questions'] * $hour_factor,
577 3, 2); ?></td>
578 <td class="value"><?php echo
579 PMA_formatNumber(
580 $server_status['Questions'] * 60 / $server_status['Uptime'],
581 3, 2); ?></td>
582 <td class="value"><?php echo
583 PMA_formatNumber(
584 $server_status['Questions'] / $server_status['Uptime'],
585 3, 2); ?></td>
586 </tr>
587 </tbody>
588 </table>
590 <div id="serverstatusqueriesdetails">
591 <?php
592 // number of tables to split values into
593 $tables = 2;
594 $rows_per_table = (int) ceil(count($sections['com']['vars']) / $tables);
595 $current_table = 0;
596 $odd_row = true;
597 $countRows = 0;
598 $perc_factor = 100 / ($server_status['Questions'] - $server_status['Connections']);
599 foreach ($sections['com']['vars'] as $name => $value) {
600 $current_table++;
601 if ($countRows === 0 || $countRows === $rows_per_table) {
602 $odd_row = true;
603 if ($countRows === $rows_per_table) {
604 echo ' </tbody>' . "\n";
605 echo ' </table>' . "\n";
608 <table id="serverstatusqueriesdetails<?php echo $current_table; ?>" class="data">
609 <col class="namecol" />
610 <col class="valuecol" span="3" />
611 <thead>
612 <tr><th colspan="2"><?php echo $strQueryType; ?></th>
613 <th>&oslash; <?php echo $strPerHour; ?></th>
614 <th>%</th>
615 </tr>
616 </thead>
617 <tbody>
618 <?php
619 } else {
620 $odd_row = !$odd_row;
622 $countRows++;
624 // For the percentage column, use Questions - Connections, because
625 // the number of connections is not an item of the Query types
626 // but is included in Questions. Then the total of the percentages is 100.
627 $name = str_replace('Com_', '', $name);
628 $name = str_replace('_', ' ', $name);
630 <tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>">
631 <th class="name"><?php echo htmlspecialchars($name); ?></th>
632 <td class="value"><?php echo PMA_formatNumber($value, 4, 0); ?></td>
633 <td class="value"><?php echo
634 PMA_formatNumber($value * $hour_factor, 4, 2); ?></td>
635 <td class="value"><?php echo
636 PMA_formatNumber($value * $perc_factor, 0, 2); ?>%</td>
637 </tr>
638 <?php
641 </tbody>
642 </table>
643 </div>
645 <div id="serverstatussection">
646 <?php
647 //Unset used variables
648 unset(
649 $tables, $rows_per_table, $current_table, $countRows, $perc_factor,
650 $hour_factor, $sections['com'],
651 $server_status['Aborted_clients'], $server_status['Aborted_connects'],
652 $server_status['Max_used_connections'], $server_status['Bytes_received'],
653 $server_status['Bytes_sent'], $server_status['Connections'],
654 $server_status['Questions'], $server_status['Uptime']
657 foreach ($sections as $section_name => $section) {
658 if (! empty($section['vars'])) {
660 <table class="data" id="serverstatussection<?php echo $section_name; ?>">
661 <caption class="tblHeaders">
662 <a class="top"
663 href="<?php echo $PMA_PHP_SELF . '?' .
664 PMA_generate_common_url() . '#serverstatus'; ?>"
665 name="<?php echo $section_name; ?>"><?php echo $strPos1; ?>
666 <?php echo
667 ($GLOBALS['cfg']['MainPageIconic']
668 ? '<img src="' . $GLOBALS['pmaThemeImage'] .
669 's_asc.png" width="11" height="9" align="middle" alt="" />'
670 : ''); ?>
671 </a>
672 <?php
673 if (! empty($section['title'])) {
674 echo $section['title'];
677 </caption>
678 <col class="namecol" />
679 <col class="valuecol" />
680 <col class="descrcol" />
681 <thead>
682 <tr>
683 <th><?php echo $strVar; ?></th>
684 <th><?php echo $strValue; ?></th>
685 <th><?php echo $strDescription; ?></th>
686 </tr>
687 </thead>
688 <?php
689 if (! empty($links[$section_name])) {
691 <tfoot>
692 <tr class="tblFooters">
693 <th colspan="3" class="tblFooters">
694 <?php
695 foreach ($links[$section_name] as $link_name => $link_url) {
696 if ('doc' == $link_name) {
697 echo PMA_showMySQLDocu($link_url, $link_url);
698 } else {
699 echo '<a href="' . $link_url . '">' . $link_name . '</a>' . "\n";
702 unset($link_url, $link_name);
704 </th>
705 </tr>
706 </tfoot>
707 <?php
710 <tbody>
711 <?php
712 $odd_row = false;
713 foreach ($section['vars'] as $name => $value) {
714 $odd_row = !$odd_row;
716 <tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>">
717 <th class="name"><?php echo htmlspecialchars($name); ?></th>
718 <td class="value"><?php
719 if (isset($alerts[$name])) {
720 if ($value > $alerts[$name]) {
721 echo '<span class="attention">';
722 } else {
723 echo '<span class="allfine">';
726 if ('%' === substr($name, -1, 1)) {
727 echo PMA_formatNumber($value, 0, 2) . ' %';
728 } elseif (is_numeric($value) && $value == (int) $value) {
729 echo PMA_formatNumber($value, 4, 0);
730 } elseif (is_numeric($value)) {
731 echo PMA_formatNumber($value, 4, 2);
732 } else {
733 echo htmlspecialchars($value);
735 if (isset($alerts[$name])) {
736 echo '</span>';
738 ?></td>
739 <td class="descr">
740 <?php
741 if (isset($GLOBALS['strShowStatus' . $name . 'Descr'])) {
742 echo $GLOBALS['strShowStatus' . $name . 'Descr'];
745 if (isset($links[$name])) {
746 foreach ($links[$name] as $link_name => $link_url) {
747 if ('doc' == $link_name) {
748 echo PMA_showMySQLDocu($link_url, $link_url);
749 } else {
750 echo ' <a href="' . $link_url . '">' . $link_name . '</a>' .
751 "\n";
754 unset($link_url, $link_name);
757 </td>
758 </tr>
759 <?php
761 unset($name, $value);
763 </tbody>
764 </table>
765 <?php
768 unset($section_name, $section, $sections, $server_status, $odd_row, $alerts);
770 </div>
771 <?php
772 /* if the server works as master or slave in replication process, display useful information */
773 if ($server_master_status_run || $server_slave_status_run)
776 <hr class="clearfloat" />
778 <h3><a name="replication"></a><?php echo $strReplicationStatus; ?></h3>
779 <?php
781 foreach ($replication_types as $type)
783 if (${"server_{$type}_status_run"})
786 <h4><?php echo ${"strReplicationStatus_{$type}"}; ?></h4>
787 <?php
789 <table id="server<?php echo $type; ?>replicationsummary" class="data">
791 <thead>
792 <tr>
793 <th><?php echo $strVar; ?></th>
794 <th><?php echo $strValue; ?></th>
795 </tr>
796 </thead>
797 <tbody>
798 <?php
799 $odd_row = true;
800 foreach(${"{$type}_variables"} as $variable)
803 <tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>">
804 <td class="name">
805 <?php echo $variable; ?>
806 </td>
807 <td class="value">
808 <?php
809 if (isset(${"{$type}_variables_alerts"}[$variable])
810 && ${"{$type}_variables_alerts"}[$variable] == ${"server_{$type}_status"}[0][$variable]) {
811 echo '<span class="attention">';
813 } elseif (isset(${"{$type}_variables_oks"}[$variable])
814 && ${"{$type}_variables_oks"}[$variable] == ${"server_{$type}_status"}[0][$variable]) {
815 echo '<span class="allfine">';
816 } else {
817 echo '<span>';
819 echo ${"server_{$type}_status"}[0][$variable];
820 echo '</span>';
822 </td>
823 </tr>
824 <?php
825 $odd_row = ! $odd_row;
827 unset(${"server_{$type}_status"});
829 </tbody>
830 </table>
831 <?php
834 unset($types);
838 </div>
840 <?php
842 * Sends the footer
844 require_once './libraries/footer.inc.php';