removed some XHTML problems (slider effect)
[phpmyadmin/madhuracj.git] / server_status.php
blob1e071b61df0eebaee6bfec95257bd3efccff0794
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)
428 $replicationOut = "";
429 foreach ($replication_types as $type)
431 if ($replicationOut != "")
432 $replicationOut .= $strAndSmall . ' ';
433 if (${"server_{$type}_status_run"})
435 $replicationOut .= '<b>' . $type . '</b> ';
438 echo sprintf('<p>' . $strReplicationStatusInfo . '</p>', $replicationOut);
442 <div id="sectionlinks">
443 <?php
444 foreach ($sections as $section_name => $section) {
445 if (! empty($section['vars']) && ! empty($section['title'])) {
446 echo '<a href="' . $PMA_PHP_SELF . '?' .
447 PMA_generate_common_url() . '#' . $section_name . '">' .
448 $section['title'] . '</a>' . "\n";
452 </div>
454 <h3><?php echo $strServerTrafficNotes; ?></h3>
456 <table id="serverstatustraffic" class="data">
457 <thead>
458 <tr>
459 <th colspan="2"><?php echo $strTraffic . '&nbsp;' . PMA_showHint($strStatisticsOverrun); ?></th>
460 <th>&oslash; <?php echo $strPerHour; ?></th>
461 </tr>
462 </thead>
463 <tbody>
464 <tr class="odd">
465 <th class="name"><?php echo $strReceived; ?></th>
466 <td class="value"><?php echo
467 implode(' ',
468 PMA_formatByteDown($server_status['Bytes_received'], 4)); ?></td>
469 <td class="value"><?php echo
470 implode(' ',
471 PMA_formatByteDown(
472 $server_status['Bytes_received'] * $hour_factor, 4)); ?></td>
473 </tr>
474 <tr class="even">
475 <th class="name"><?php echo $strSent; ?></th>
476 <td class="value"><?php echo
477 implode(' ',
478 PMA_formatByteDown($server_status['Bytes_sent'], 4)); ?></td>
479 <td class="value"><?php echo
480 implode(' ',
481 PMA_formatByteDown(
482 $server_status['Bytes_sent'] * $hour_factor, 4)); ?></td>
483 </tr>
484 <tr class="odd">
485 <th class="name"><?php echo $strTotalUC; ?></th>
486 <td class="value"><?php echo
487 implode(' ',
488 PMA_formatByteDown(
489 $server_status['Bytes_received'] + $server_status['Bytes_sent'], 4)
490 ); ?></td>
491 <td class="value"><?php echo
492 implode(' ',
493 PMA_formatByteDown(
494 ($server_status['Bytes_received'] + $server_status['Bytes_sent'])
495 * $hour_factor, 4)
496 ); ?></td>
497 </tr>
498 </tbody>
499 </table>
501 <table id="serverstatusconnections" class="data">
502 <thead>
503 <tr>
504 <th colspan="2"><?php echo $strConnections; ?></th>
505 <th>&oslash; <?php echo $strPerHour; ?></th>
506 <th>%</th>
507 </tr>
508 </thead>
509 <tbody>
510 <tr class="odd">
511 <th class="name"><?php echo $strMaxConnects; ?></th>
512 <td class="value"><?php echo
513 PMA_formatNumber($server_status['Max_used_connections'], 0); ?> </td>
514 <td class="value">--- </td>
515 <td class="value">--- </td>
516 </tr>
517 <tr class="even">
518 <th class="name"><?php echo $strFailedAttempts; ?></th>
519 <td class="value"><?php echo
520 PMA_formatNumber($server_status['Aborted_connects'], 4, 0); ?></td>
521 <td class="value"><?php echo
522 PMA_formatNumber($server_status['Aborted_connects'] * $hour_factor,
523 4, 2); ?></td>
524 <td class="value"><?php echo
525 $server_status['Connections'] > 0
526 ? PMA_formatNumber(
527 $server_status['Aborted_connects'] * 100 / $server_status['Connections'],
528 0, 2) . '%'
529 : '--- '; ?></td>
530 </tr>
531 <tr class="odd">
532 <th class="name"><?php echo $strAbortedClients; ?></th>
533 <td class="value"><?php echo
534 PMA_formatNumber($server_status['Aborted_clients'], 4, 0); ?></td>
535 <td class="value"><?php echo
536 PMA_formatNumber($server_status['Aborted_clients'] * $hour_factor,
537 4, 2); ?></td>
538 <td class="value"><?php echo
539 $server_status['Connections'] > 0
540 ? PMA_formatNumber(
541 $server_status['Aborted_clients'] * 100 / $server_status['Connections'],
542 0, 2) . '%'
543 : '--- '; ?></td>
544 </tr>
545 <tr class="even">
546 <th class="name"><?php echo $strTotalUC; ?></th>
547 <td class="value"><?php echo
548 PMA_formatNumber($server_status['Connections'], 4, 0); ?></td>
549 <td class="value"><?php echo
550 PMA_formatNumber($server_status['Connections'] * $hour_factor,
551 4, 2); ?></td>
552 <td class="value"><?php echo
553 PMA_formatNumber(100, 0, 2); ?>%</td>
554 </tr>
555 </tbody>
556 </table>
558 <hr class="clearfloat" />
560 <h3><?php echo
561 sprintf($strQueryStatistics,
562 PMA_formatNumber($server_status['Questions'], 0)); ?></h3>
564 <table id="serverstatusqueriessummary" class="data">
565 <thead>
566 <tr>
567 <th><?php echo $strTotalUC; ?></th>
568 <th>&oslash; <?php echo $strPerHour; ?></th>
569 <th>&oslash; <?php echo $strPerMinute; ?></th>
570 <th>&oslash; <?php echo $strPerSecond; ?></th>
571 </tr>
572 </thead>
573 <tbody>
574 <tr class="odd">
575 <td class="value"><?php echo
576 PMA_formatNumber($server_status['Questions'], 4, 0); ?></td>
577 <td class="value"><?php echo
578 PMA_formatNumber($server_status['Questions'] * $hour_factor,
579 3, 2); ?></td>
580 <td class="value"><?php echo
581 PMA_formatNumber(
582 $server_status['Questions'] * 60 / $server_status['Uptime'],
583 3, 2); ?></td>
584 <td class="value"><?php echo
585 PMA_formatNumber(
586 $server_status['Questions'] / $server_status['Uptime'],
587 3, 2); ?></td>
588 </tr>
589 </tbody>
590 </table>
592 <div id="serverstatusqueriesdetails">
593 <?php
594 // number of tables to split values into
595 $tables = 2;
596 $rows_per_table = (int) ceil(count($sections['com']['vars']) / $tables);
597 $current_table = 0;
598 $odd_row = true;
599 $countRows = 0;
600 $perc_factor = 100 / ($server_status['Questions'] - $server_status['Connections']);
601 foreach ($sections['com']['vars'] as $name => $value) {
602 $current_table++;
603 if ($countRows === 0 || $countRows === $rows_per_table) {
604 $odd_row = true;
605 if ($countRows === $rows_per_table) {
606 echo ' </tbody>' . "\n";
607 echo ' </table>' . "\n";
610 <table id="serverstatusqueriesdetails<?php echo $current_table; ?>" class="data">
611 <col class="namecol" />
612 <col class="valuecol" span="3" />
613 <thead>
614 <tr><th colspan="2"><?php echo $strQueryType; ?></th>
615 <th>&oslash; <?php echo $strPerHour; ?></th>
616 <th>%</th>
617 </tr>
618 </thead>
619 <tbody>
620 <?php
621 } else {
622 $odd_row = !$odd_row;
624 $countRows++;
626 // For the percentage column, use Questions - Connections, because
627 // the number of connections is not an item of the Query types
628 // but is included in Questions. Then the total of the percentages is 100.
629 $name = str_replace('Com_', '', $name);
630 $name = str_replace('_', ' ', $name);
632 <tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>">
633 <th class="name"><?php echo htmlspecialchars($name); ?></th>
634 <td class="value"><?php echo PMA_formatNumber($value, 4, 0); ?></td>
635 <td class="value"><?php echo
636 PMA_formatNumber($value * $hour_factor, 4, 2); ?></td>
637 <td class="value"><?php echo
638 PMA_formatNumber($value * $perc_factor, 0, 2); ?>%</td>
639 </tr>
640 <?php
643 </tbody>
644 </table>
645 </div>
647 <div id="serverstatussection">
648 <?php
649 //Unset used variables
650 unset(
651 $tables, $rows_per_table, $current_table, $countRows, $perc_factor,
652 $hour_factor, $sections['com'],
653 $server_status['Aborted_clients'], $server_status['Aborted_connects'],
654 $server_status['Max_used_connections'], $server_status['Bytes_received'],
655 $server_status['Bytes_sent'], $server_status['Connections'],
656 $server_status['Questions'], $server_status['Uptime']
659 foreach ($sections as $section_name => $section) {
660 if (! empty($section['vars'])) {
662 <table class="data" id="serverstatussection<?php echo $section_name; ?>">
663 <caption class="tblHeaders">
664 <a class="top"
665 href="<?php echo $PMA_PHP_SELF . '?' .
666 PMA_generate_common_url() . '#serverstatus'; ?>"
667 name="<?php echo $section_name; ?>"><?php echo $strPos1; ?>
668 <?php echo
669 ($GLOBALS['cfg']['MainPageIconic']
670 ? '<img src="' . $GLOBALS['pmaThemeImage'] .
671 's_asc.png" width="11" height="9" align="middle" alt="" />'
672 : ''); ?>
673 </a>
674 <?php
675 if (! empty($section['title'])) {
676 echo $section['title'];
679 </caption>
680 <col class="namecol" />
681 <col class="valuecol" />
682 <col class="descrcol" />
683 <thead>
684 <tr>
685 <th><?php echo $strVar; ?></th>
686 <th><?php echo $strValue; ?></th>
687 <th><?php echo $strDescription; ?></th>
688 </tr>
689 </thead>
690 <?php
691 if (! empty($links[$section_name])) {
693 <tfoot>
694 <tr class="tblFooters">
695 <th colspan="3" class="tblFooters">
696 <?php
697 foreach ($links[$section_name] as $link_name => $link_url) {
698 if ('doc' == $link_name) {
699 echo PMA_showMySQLDocu($link_url, $link_url);
700 } else {
701 echo '<a href="' . $link_url . '">' . $link_name . '</a>' . "\n";
704 unset($link_url, $link_name);
706 </th>
707 </tr>
708 </tfoot>
709 <?php
712 <tbody>
713 <?php
714 $odd_row = false;
715 foreach ($section['vars'] as $name => $value) {
716 $odd_row = !$odd_row;
718 <tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>">
719 <th class="name"><?php echo htmlspecialchars($name); ?></th>
720 <td class="value"><?php
721 if (isset($alerts[$name])) {
722 if ($value > $alerts[$name]) {
723 echo '<span class="attention">';
724 } else {
725 echo '<span class="allfine">';
728 if ('%' === substr($name, -1, 1)) {
729 echo PMA_formatNumber($value, 0, 2) . ' %';
730 } elseif (is_numeric($value) && $value == (int) $value) {
731 echo PMA_formatNumber($value, 4, 0);
732 } elseif (is_numeric($value)) {
733 echo PMA_formatNumber($value, 4, 2);
734 } else {
735 echo htmlspecialchars($value);
737 if (isset($alerts[$name])) {
738 echo '</span>';
740 ?></td>
741 <td class="descr">
742 <?php
743 if (isset($GLOBALS['strShowStatus' . $name . 'Descr'])) {
744 echo $GLOBALS['strShowStatus' . $name . 'Descr'];
747 if (isset($links[$name])) {
748 foreach ($links[$name] as $link_name => $link_url) {
749 if ('doc' == $link_name) {
750 echo PMA_showMySQLDocu($link_url, $link_url);
751 } else {
752 echo ' <a href="' . $link_url . '">' . $link_name . '</a>' .
753 "\n";
756 unset($link_url, $link_name);
759 </td>
760 </tr>
761 <?php
763 unset($name, $value);
765 </tbody>
766 </table>
767 <?php
770 unset($section_name, $section, $sections, $server_status, $odd_row, $alerts);
772 </div>
773 <?php
774 /* if the server works as master or slave in replication process, display useful information */
775 if ($server_master_status_run || $server_slave_status_run)
778 <hr class="clearfloat" />
780 <h3><a name="replication"></a><?php echo $strReplicationStatus; ?></h3>
781 <?php
783 foreach ($replication_types as $type)
785 if (${"server_{$type}_status_run"})
788 <h4><?php echo ${"strReplicationStatus_{$type}"}; ?></h4>
789 <?php
791 <table id="server<?php echo $type; ?>replicationsummary" class="data">
793 <thead>
794 <tr>
795 <th><?php echo $strVar; ?></th>
796 <th><?php echo $strValue; ?></th>
797 </tr>
798 </thead>
799 <tbody>
800 <?php
801 $odd_row = true;
802 foreach(${"{$type}_variables"} as $variable)
805 <tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>">
806 <td class="name">
807 <?php echo $variable; ?>
808 </td>
809 <td class="value">
810 <?php
811 if (${"{$type}_variables_alerts"}[$variable] == ${"server_{$type}_status"}[0][$variable])
812 echo '<span class="attention">';
813 if (${"{$type}_variables_oks"}[$variable] == ${"server_{$type}_status"}[0][$variable])
814 echo '<span class="allfine">';
815 else
816 echo '<span>';
817 echo ${"server_{$type}_status"}[0][$variable];
818 echo '</span>';
820 </td>
821 </tr>
822 <?php
823 $odd_row = ! $odd_row;
825 unset(${"server_{$type}_status"});
827 </tbody>
828 </table>
829 <?php
832 unset($types);
836 </div>
838 <?php
840 * Sends the footer
842 require_once './libraries/footer.inc.php';