Example #1
0
*/
require "auth.inc";
require "guiconfig.inc";
$pgtitle = array(gettext("Disks"), gettext("ZFS"), gettext("Pools"), gettext("I/O statistics"));
function zfs_zpool_get_iostat()
{
    // Get zpool I/O statistic informations
    $cmd = "zpool iostat -v 2>&1";
    if (isset($_GET['pool'])) {
        $cmd .= " {$_GET['pool']}";
    }
    mwexec2($cmd, $rawdata);
    return implode("\n", $rawdata);
}
if (is_ajax()) {
    $iostat = zfs_zpool_get_iostat();
    render_ajax($iostat);
}
include "fbegin.inc";
?>
<script type="text/javascript">//<![CDATA[
$(document).ready(function(){
	var gui = new GUI;
	gui.recall(0, 5000, 'disks_zfs_zpool_io.php', null, function(data) {
		$('#zfs_zpool_iostat').text(data.data);
	});
});
//]]>
</script>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
</span></a></li>
				<li class="tabact"><a href="disks_zfs_zpool_io.php" title="<?php 
echo gettext("Reload page");
?>
"><span><?php 
echo gettext("I/O statistics");
?>
</span></a></li>
			</ul>
		</td>
	</tr>
	<tr>
		<td class="tabcont">
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<?php 
html_titleline(gettext("Pool information and status"));
?>
				<tr>
					<td class="listt">
						<pre><span id="zfs_zpool_iostat"><?php 
echo zfs_zpool_get_iostat();
?>
</span></pre>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<?php 
include "fend.inc";