afhosting
03-15-2002, 09:39 AM
Does anyone know where I can find a script that will email results of the top command at preset intervals?
I remember seeing such a script several months ago, but I can't find it now.
Thanks
elsmore1
03-17-2002, 01:24 AM
If you can create a cron job... you can do it like this.
5 * * * * /usr/bin/top -bc -n 1 | /bin/mail -s "Output from Top" you@youraddress.com
The above line should mail the results of top to you at 5 minutes after evry hour, every day. (paths, email addresses etc. may differ) There are a number of other ways of doing it too, so if this one doesn't appeal to you, keep trying. or you could leave off the pipe to mail if you set the cron MAILTO: to yourself, or you receive the default cron mailto: Of course, then you won't get that nice looking subject line :)
::edited to clarify and fix a typo::
Originally posted by afhosting
Does anyone know where I can find a script that will email results of the top command at preset intervals?
I remember seeing such a script several months ago, but I can't find it now.
Thanks
afhosting
03-17-2002, 05:28 PM
Thanks elsmore1!
That worked perfect and is just what I was looking for.