#!/bin/sh
# ~jhs/bin/.sh/mbmon.sh
# needs to move to /site so hosts dont need to find it by a.d of /usr/home/jhs
# crontab calls this, 
# as I turn off some machines overnight in hot summers,
# its best to call this during the day, else it might not get run.
# procmail stores the result.
# If a machine crashes & the previous weeks log shows progressively 
# higher temperature, likely a fan is stuck with dirt or a bearing gone.

# echo "mbmon.sh started on `hostname -s` `date`" | \
# 	mail -s "Cron: `hostname -s`" jhs

# xs touch /var/log/mbmon ; xs chown jhs:staff /var/log/mbmon
# xs touch /var/log/mbmon.today ; xs chown jhs:staff /var/log/mbmon.today

cat /var/log/mbmon.today 		# Yesterday's values for comparison
echo
date
/usr/local/bin/mbmon -c 1	# Today's
date			  >> /var/log/mbmon 	# Cumulative
/usr/local/bin/mbmon -c 1 >> /var/log/mbmon 	# Cumulative
date			  > /var/log/mbmon.today 	# Store today's
/usr/local/bin/mbmon -c 1 >> /var/log/mbmon.today 	# Store today's

# echo "mbmon.sh finished on `hostname -s` `date`" | \
# 	mail -s "Cron: `hostname -s`" jhs
exit 0

