Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print('<h2>Server load</h2>');
- print("<table class='main' border='0' width='420'><tr><td style='padding: 0px; background-repeat: repeat-x'>");
- $percent = min(100, round(exec('ps ax | grep -c lighttpd') / 256 * 30 )); // Apache or lighttpd
- // System tracker load
- echo "<center><br />Tracker load: ($percent %)
- <table class='main' border='0' width='400'><tr>
- <td style='padding: 0px; background-image: url({$images}loadbarbg.gif); background-repeat: repeat-x'>";
- if ($percent <= 70) $pic = "{$images}loadbargreen.gif";
- elseif ($percent <= 90) $pic = "{$images}loadbaryellow.gif";
- else $pic = "{$images}loadbarred.gif";
- $width = $percent * 8;
- echo "<img height=15 width=$width src='".$pic."' alt='$percent%'></td></tr></table>";
- echo "Uptime: ".trim(exec('uptime'))."<br />";
- $percent = min(100, round(exec('ps ax | grep -c lighttpd') / 256 * 150));
- // Server load
- echo "<br />Server load: ($percent %)
- <table class='main' border='0' width='400'><tr>
- <td style='padding: 0px; background-image: url({$images}loadbarbg.gif); background-repeat: repeat-x'>";
- if ($percent <= 70) $pic = "{$images}loadbargreen.gif";
- elseif ($percent <= 90) $pic = "{$images}loadbaryellow.gif";
- else
- $pic = '{$images}loadbarred.gif';
- $width = $percent * 8;
- echo "<img height='15' width=$width src='".$pic."' alt='$percent%'></td></tr></table><br />";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement