Project

General

Profile

« Previous | Next » 

Revision e7da8698

Added by Jim Pingle about 12 years ago

Make mbuf usage a meter, too.

View differences:

usr/local/www/widgets/widgets/system_information.widget.php
195 195
			<td width="25%" class="vncellt">MBUF Usage</td>
196 196
			<td width="75%" class="listr">
197 197
				<?php
198
					$mbufs_output=`netstat -mb | grep "mbuf clusters in use" | awk '{ print $1 }'`;
198
					$mbufs_output=trim(`netstat -mb | grep "mbuf clusters in use" | awk '{ print $1 }'`);
199 199
					list( $mbufs_current, $mbufs_cache, $mbufs_total, $mbufs_max ) = explode( "/", $mbufs_output);
200
					$mbufusage = sprintf("%.2f", ($mbufs_total / $mbufs_max) * 100);
200 201
				?>
201
				<?= $mbufs_total ?>/<?= $mbufs_max ?>
202
				<img src="./themes/<?= $g['theme']; ?>/images/misc/bar_left.gif" height="15" width="4" border="0" align="middle" alt="left bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_blue.gif" height="15" name="tempwidtha" id="tempwidtha" width="<?= round($mbufusage); ?>" border="0" align="middle" alt="red bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_gray.gif" height="15" name="tempwidthb" id="tempwidthb" width="<?= (100 - $mbufusage); ?>" border="0" align="middle" alt="gray bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_right.gif" height="15" width="5" border="0" align="middle" alt="right bar" />
203
				<br/><span id="mbufusagemeter"><?= $mbufusage.'%'; ?></span> (<?= $mbufs_total ?>/<?= $mbufs_max ?>)
202 204
			</td>
203 205
		</tr>
204 206
                <?php if (get_temp() != ""): ?>

Also available in: Unified diff