Tuesday, May 10, 2011

how to monitor temperature every hour (CentOS)

today, i will guide how to monitor your server temparature

1. intall mutt

# yum install mutt
2. create monitor_temp.sh

# vi monitor_temp.sh

type i for insert
sensors | grep Core
hddtemp /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.txt
mutt -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:

Related Posts Plugin for WordPress, Blogger...