1. intall mutt
# yum install mutt
2. create monitor_temp.sh
# vi monitor_temp.sh
type i for insertsensors | grep Corehddtemp /dev/sda
type esc and :wq
to quit and save the file
type
3. Create report script
# vi report.sh
sh monitor_temp.sh > data.txtmutt -s "Report: Temperature report" your@email-server.com < ~/data.txt
again, save the file
test the script by typing
# sh report.sh
if this success, check your email.
make this file executables:
#chmod 755 report.sh
4. create cron job to run every 1 hour
#vi /etc/crontab
* 1 * * * /root/scripts/report.sh
Reference:
No comments:
Post a Comment