[ale] strange program [requested]

Steve Throckmorton ttwelve at yahoo.com
Fri Jul 6 16:06:53 EDT 2001


Well, here's something to try (I know it will create the log, cause I tested
it, but I can't tell you how resource intensive it is, or what kind of results
you might get with nice--you'd have to play with it):

#!/bin/bash
while test 1
do
date >> userlog
top -b -d 1 -s -n 1 | grep user | awk '{if ($NF !~ /bash/) print}' >> userlog
done

Substitute actual username in grep and log file, and run this shell script in a
background process.

This timestamps the log, then runs top in batch mode, parses the result for the
desired user's processes, and eliminates the messages that tell you he's
running a shell (assuming it's bash, obviously).  You have to kill the logging
process to read the log (it's easier to kill the whole shell).  You get a LOT
of redundant messages in this log, but I don't know how to filter that out
while the log is being created; it's fairly simple to do it after the log is
done.

I'd be interested to know if this works for you.

Steve 


--- Christopher Bergeron <christopher at bergeron.com> wrote:
> dOes anyone know if there exists a utility that can monitor the programs
> that a user runs?  I would think that it would just be a matter of "grepping
> ps for username every second > /dev/myconsole".  Has anyone seen any
> prewritten proggys that will do this?  Most likely, this isn't a normal
> request hence the "strange program" subj.
> 
> Thanks in advance for any leads...
> 
> -CB
> 
> 
> P.S.
> does anyone know how I can grep every second? or should i just write a shell
> script and use sleep?!?
> 
> --
> To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message
body.


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.





More information about the Ale mailing list