Cool, thanks!

Now, is it possible to kill a process, based on it's name (not PID) when
such message is triggered and an email is dispatched to my cell phone?  The
reason I'm asking is because I have a client running FrontPage extensions on
her site and she LOVES to issue the "recalculate links" feature 10 times a
day for no reason at all.  I asked her why she's doing it, as there is no
reason at all for her to run it to begin with, especially that frequently,
but she is just stuck on doing it as a "preventitive maintenance."  <sigh>
Needless to say, her site is HUGE and every time she runs this, the server
is running at 10+ load for 30 minutes at a time.  I'd love to just kill the
"Author.exe" process sucking up all the CPU cycles when the load gets to 5+
level (for example), to automatically stop her unnecessary imact on the
server.  Since the PID changes all the time, it would need to kill the
process by name (Author.exe) or look up the PID dynamically.  That's the
only process that ever gets the server above 2.00 CPU levels so it's pretty
safe to assume that's what's sucking up the cycles.

Thanks,

Chris




----- Original Message -----
From: "Anthony E. Greene" <[EMAIL PROTECTED]>
Sent: Wednesday, March 26, 2003 1:07 PM
Subject: Re: CPU monitoring service => even more Correct


> Chris wrote:
> The problem is that $load actually contains a string representation of a
> floating point number, complete with decimal point. Bash only supports
> integer math. It will handle a string representation of an interger as an
> integer in the correct context (similar to perl) but it will balk at
> attempting to handle strings that look like floating point numbers.
>
> Try this:
>
> # Get the real load.
> trueload=$(cat /proc/loadavg | awk '{print $1}')
>
> # Multiply the load by 100 to create an integer,
> # then keep only the stuff in front of the decimal point.
> load=$(echo "$trueload * 100" | bc | cut -f 1 -d .)
>
> # See if the load is too high.
> if [ $load -gt $MY_THRESHOLD ] ; then
> ... do stuff
>
>
>
> Tony




-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to