3 // vim: expandtab sw=4 ts=4 sts=4:
9 require('./server_common.inc.php3');
15 require('./server_links.inc.php3');
21 if (!empty($innodbstatus)) {
23 . ' ' . $strInnodbStat . "\n"
25 $sql_query = 'SHOW INNODB STATUS;';
26 $res = PMA_mysql_query($sql_query, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), $sql_query);
27 $row = PMA_mysql_fetch_row($res);
29 . htmlspecialchars($row[0]) . "\n"
31 mysql_free_result($res);
32 include('./footer.inc.php3');
37 * Displays the sub-page heading
40 . ' ' . $strServerStatus . "\n"
45 * Checks if the user is allowed to do what he tries to...
47 if (!$is_superuser && !$cfg['ShowMysqlInfo']) {
48 echo $strNoPrivileges;
49 include('./footer.inc.php3');
55 * Sends the query and buffers the result
57 $res = @PMA_mysql_query
('SHOW STATUS;', $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), 'SHOW STATUS;');
58 while ($row = PMA_mysql_fetch_row($res)) {
59 $serverStatus[$row[0]] = $row[1];
61 @mysql_free_result
($res);
70 $res = @PMA_mysql_query
('SELECT UNIX_TIMESTAMP() - ' . $serverStatus['Uptime'] . ';');
71 $row = PMA_mysql_fetch_row($res);
72 echo sprintf($strServerStatusUptime, PMA_timespanFormat($serverStatus['Uptime']), PMA_localisedDate($row[0])) . "\n";
73 mysql_free_result($res);
76 //Get query statistics
77 $queryStats = array();
78 $tmp_array = $serverStatus;
79 while (list($name, $value) = each($tmp_array)) {
80 if (substr($name, 0, 4) == 'Com_') {
81 $queryStats[str_replace('_', ' ', substr($name, 4))] = $value;
82 unset($serverStatus[$name]);
89 <!-- Server Traffic
-->
90 <?php
echo $strServerTrafficNotes; ?
><br
/>
96 <th colspan
="2"> 
;<?php
echo $strTraffic; ?
> 
;</th
>
97 <th
> 
;ø
; 
;<?php
echo $strPerHour; ?
> 
;</th
>
100 <td bgcolor
="<?php echo $cfg['BgcolorTwo']; ?>"> 
;<?php
echo $strReceived; ?
> 
;</td
>
101 <td bgcolor
="<?php echo $cfg['BgcolorTwo']; ?>" align
="right"> 
;<?php
echo join(' ', PMA_formatByteDown($serverStatus['Bytes_received'])); ?
> 
;</td
>
102 <td bgcolor
="<?php echo $cfg['BgcolorTwo']; ?>" align
="right"> 
;<?php
echo join(' ', PMA_formatByteDown($serverStatus['Bytes_received'] * 3600 / $serverStatus['Uptime'])); ?
> 
;</td
>
105 <td bgcolor
="<?php echo $cfg['BgcolorTwo']; ?>"> 
;<?php
echo $strSent; ?
> 
;</td
>
106 <td bgcolor
="<?php echo $cfg['BgcolorTwo']; ?>" align
="right"> 
;<?php
echo join(' ', PMA_formatByteDown($serverStatus['Bytes_sent'])); ?
> 
;</td
>
107 <td bgcolor
="<?php echo $cfg['BgcolorTwo']; ?>" align
="right"> 
;<?php
echo join(' ', PMA_formatByteDown($serverStatus['Bytes_sent'] * 3600 / $serverStatus['Uptime'])); ?
> 
;</td
>
110 <td bgcolor
="<?php echo $cfg['BgcolorOne']; ?>"> 
;<?php
echo $strTotalUC; ?
> 
;</td
>
111 <td bgcolor
="<?php echo $cfg['BgcolorOne']; ?>" align
="right"> 
;<?php
echo join(' ', PMA_formatByteDown($serverStatus['Bytes_received'] +
$serverStatus['Bytes_sent'])); ?
> 
;</td
>
112 <td bgcolor
="<?php echo $cfg['BgcolorOne']; ?>" align
="right"> 
;<?php
echo join(' ', PMA_formatByteDown(($serverStatus['Bytes_received'] +
$serverStatus['Bytes_sent']) * 3600 / $serverStatus['Uptime'])); ?
> 
;</td
>
119 <th colspan
="2"> 
;<?php
echo $strConnections; ?
> 
;</th
>
120 <th
> 
;ø
; 
;<?php
echo $strPerHour; ?
> 
;</th
>
121 <th
> 
;%
 
;</th
>
124 <td bgcolor
="<?php echo $cfg['BgcolorTwo']; ?>"> 
;<?php
echo $strFailedAttempts; ?
> 
;</td
>
125 <td bgcolor
="<?php echo $cfg['BgcolorTwo']; ?>" align
="right"> 
;<?php
echo number_format($serverStatus['Aborted_connects'], 0, $number_decimal_separator, $number_thousands_separator); ?
> 
;</td
>
126 <td bgcolor
="<?php echo $cfg['BgcolorTwo']; ?>" align
="right"> 
;<?php
echo number_format(($serverStatus['Aborted_connects'] * 3600 / $serverStatus['Uptime']), 2, $number_decimal_separator, $number_thousands_separator); ?
> 
;</td
>
127 <td bgcolor
="<?php echo $cfg['BgcolorTwo']; ?>" align
="right"> 
;<?php
echo ($serverStatus['Connections'] > 0 ) ?
number_format(($serverStatus['Aborted_connects'] * 100 / $serverStatus['Connections']), 2, $number_decimal_separator, $number_thousands_separator) . ' %' : '---'; ?
> 
;</td
>
130 <td bgcolor
="<?php echo $cfg['BgcolorTwo']; ?>"> 
;<?php
echo $strAbortedClients; ?
> 
;</td
>
131 <td bgcolor
="<?php echo $cfg['BgcolorTwo']; ?>" align
="right"> 
;<?php
echo number_format($serverStatus['Aborted_clients'], 0, $number_decimal_separator, $number_thousands_separator); ?
> 
;</td
>
132 <td bgcolor
="<?php echo $cfg['BgcolorTwo']; ?>" align
="right"> 
;<?php
echo number_format(($serverStatus['Aborted_clients'] * 3600 / $serverStatus['Uptime']), 2, $number_decimal_separator, $number_thousands_separator); ?
> 
;</td
>
133 <td bgcolor
="<?php echo $cfg['BgcolorTwo']; ?>" align
="right"> 
;<?php
echo ($serverStatus['Connections'] > 0 ) ?
number_format(($serverStatus['Aborted_clients'] * 100 / $serverStatus['Connections']), 2 , $number_decimal_separator, $number_thousands_separator) . ' %' : '---'; ?
> 
;</td
>
136 <td bgcolor
="<?php echo $cfg['BgcolorOne']; ?>"> 
;<?php
echo $strTotalUC; ?
> 
;</td
>
137 <td bgcolor
="<?php echo $cfg['BgcolorOne']; ?>" align
="right"> 
;<?php
echo number_format($serverStatus['Connections'], 0, $number_decimal_separator, $number_thousands_separator); ?
> 
;</td
>
138 <td bgcolor
="<?php echo $cfg['BgcolorOne']; ?>" align
="right"> 
;<?php
echo number_format(($serverStatus['Connections'] * 3600 / $serverStatus['Uptime']), 2, $number_decimal_separator, $number_thousands_separator); ?
> 
;</td
>
139 <td bgcolor
="<?php echo $cfg['BgcolorOne']; ?>" align
="right"> 
;100,00 
;%
 
;</td
>
149 <?php
echo sprintf($strQueryStatistics, number_format($serverStatus['Questions'], 0, $number_decimal_separator, $number_thousands_separator)) . "\n"; ?
>
154 <table border
="0" align
="right">
156 <th
> 
;<?php
echo $strTotalUC; ?
> 
;</th
>
157 <th
> 
;ø
; 
;<?php
echo $strPerHour; ?
> 
;</th
>
158 <th
> 
;ø
; 
;<?php
echo $strPerMinute; ?
> 
;</th
>
159 <th
> 
;ø
; 
;<?php
echo $strPerSecond; ?
> 
;</th
>
162 <td bgcolor
="<?php echo $cfg['BgcolorOne']; ?>" align
="right"> 
;<?php
echo number_format($serverStatus['Questions'], 0, $number_decimal_separator, $number_thousands_separator); ?
> 
;</td
>
163 <td bgcolor
="<?php echo $cfg['BgcolorOne']; ?>" align
="right"> 
;<?php
echo number_format(($serverStatus['Questions'] * 3600 / $serverStatus['Uptime']), 2, $number_decimal_separator, $number_thousands_separator); ?
> 
;</td
>
164 <td bgcolor
="<?php echo $cfg['BgcolorOne']; ?>" align
="right"> 
;<?php
echo number_format(($serverStatus['Questions'] * 60 / $serverStatus['Uptime']), 2, $number_decimal_separator, $number_thousands_separator); ?
> 
;</td
>
165 <td bgcolor
="<?php echo $cfg['BgcolorOne']; ?>" align
="right"> 
;<?php
echo number_format(($serverStatus['Questions'] / $serverStatus['Uptime']), 2, $number_decimal_separator, $number_thousands_separator); ?
> 
;</td
>
174 <th colspan
="2"> 
;<?php
echo $strQueryType; ?
> 
;</th
>
175 <th
> 
;ø
; 
;<?php
echo $strPerHour; ?
> 
;</th
>
176 <th
> 
;%
 
;</th
>
180 $useBgcolorOne = TRUE;
182 while (list($name, $value) = each($queryStats)) {
185 <td bgcolor
="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> 
;<?php
echo htmlspecialchars($name); ?
> 
;</td
>
186 <td bgcolor
="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>" align
="right"> 
;<?php
echo number_format($value, 0, $number_decimal_separator, $number_thousands_separator); ?
> 
;</td
>
187 <td bgcolor
="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>" align
="right"> 
;<?php
echo number_format(($value * 3600 / $serverStatus['Uptime']), 2, $number_decimal_separator, $number_thousands_separator); ?
> 
;</td
>
188 <td bgcolor
="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>" align
="right"> 
;<?php
echo number_format(($value * 100 / $serverStatus['Questions']), 2, $number_decimal_separator, $number_thousands_separator); ?
> 
;%
 
;</td
>
191 $useBgcolorOne = !$useBgcolorOne;
192 if (++
$countRows == ceil(count($queryStats) / 2)) {
193 $useBgcolorOne = TRUE;
200 <th colspan
="2"> 
;<?php
echo $strQueryType; ?
> 
;</th
>
201 <th
> 
;ø
; 
;<?php
echo $strPerHour; ?
> 
;</th
>
202 <th
> 
;%
 
;</th
>
208 unset($useBgcolorOne);
216 //Unset used variables
217 unset($serverStatus['Aborted_clients']);
218 unset($serverStatus['Aborted_connects']);
219 unset($serverStatus['Bytes_received']);
220 unset($serverStatus['Bytes_sent']);
221 unset($serverStatus['Connections']);
222 unset($serverStatus['Questions']);
223 unset($serverStatus['Uptime']);
225 if (!empty($serverStatus)) {
229 <!-- Other status variables
-->
230 <b
><?php
echo $strMoreStatusVars; ?
></b
><br
/>
236 <th
> 
;<?php
echo $strVar; ?
> 
;</th
>
237 <th
> 
;<?php
echo $strValue; ?
> 
;</th
>
240 $useBgcolorOne = TRUE;
242 while (list($name, $value) = each($serverStatus)) {
245 <td bgcolor
="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> 
;<?php
echo htmlspecialchars(str_replace('_', ' ', $name)); ?
> 
;</td
>
246 <td bgcolor
="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> 
;<?php
echo htmlspecialchars($value); ?
> 
;</td
>
249 $useBgcolorOne = !$useBgcolorOne;
250 if (++
$countRows == ceil(count($serverStatus) / 3) ||
$countRows == ceil(count($serverStatus) * 2 / 3)) {
251 $useBgcolorOne = TRUE;
258 <th
> 
;<?php
echo $strVar; ?
> 
;</th
>
259 <th
> 
;<?php
echo $strValue; ?
> 
;</th
>
264 unset($useBgcolorOne);
273 $res = PMA_mysql_query('SHOW VARIABLES LIKE "have_innodb";', $userlink);
275 $row = PMA_mysql_fetch_row($res);
276 if (!empty($row[1]) && $row[1] == 'YES') {
280 <!-- InnoDB Status
-->
281 <a href
="./server_status.php3?<?php echo $url_query; ?>&innodbstatus=1">
282 <b
><?php
echo $strInnodbStat; ?
></b
>
300 require('./footer.inc.php3');