[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-users] Usage questions (TOP) (Raq4)



> 1. So to you linux gurus, does this look like enough of a load to
> nix it and
> look elsewhere, or should I not even worry about it at this point?

The processor utilization would be a concern if it's constant; but cgi
programs usually aren't. Nevertheless, I would suggest a secured standard
irc server with a web interface that php will easily do (See Application
Development with PHP 4.0, 2000, New Riders)

> 2. And I've been looking all through the archive as to what that
> mdrecoveryd
> line might mean, but haven't been enlightened as of yet, so any
> comments on
> that would be welcome.

mdrecoveryd insures devices sponsored by software RAID are synchronized
correctly at shutdown. It's default on RedHat, though I don't know why
the Raqs use it, it may literally be a superfluous process in this case,
which reminds me of MS; but nevermind that now. It's a kernel process which
you can determine by looking at the output of the ps command; and cannot
readily
disable for that reason.

> 3. Does anyone know of a little script, php code snippet, or SSI call that
> will take that first line of TOP and put it on a webpage for me?  I'd like
> to have this handy for my clients' area so they can see it as well.

I can't get it to work with top because the output is binary; but I figure
ps
is pretty informative as well so here ya go, set target to the number of
lines
you want to return. I wrote it this way because I figure seeing multiple
lines
has more utility. you could also call it like:

include test.php?target=N for quick editing to suit different users

<?php
$cmd = "ps -aux";
$target = 20;
$lines = 0;

if (!exec($cmd, $myOutput)) {
echo "Guess that didn't work";
exit();
}

while($lines < $target) {
echo "$myOutput[$lines]<BR>\n";
$lines++;
}
?>

If you really want just the one line  to print, run it like this first, take
the
"echo" line out of the while loop, and set $lines to the value you think has
what
you want, rembering that the first line number is 0.

I just used <BR> to break the lines for readability; but you may want to do
more
sophisticated formatting.

Clark