sh Distcc HealthMonitor

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh Distcc HealthMonitor相关的知识,希望对你有一定的参考价值。

#!/bin/bash
# Aayush Tuladhar
# v1.0 (2011)
# DistCC Monitor
# Performs Distcc On the Host Servers. Gets the compilation time and delivers email using sendmail.

HOSTFILE=/usr/local/itasca/buildtools/etc/lsdistcc_hosts
sendmailbin=/usr/sbin/sendmail

WORKING_DIR=`pwd`
MAIL_LIST_FILENAME=maillist.txt
REPORTFILENAME=$(date +"%b_%e_%Y"_report.txt)
REPORTFILE=$WORKING_DIR/$REPORTFILENAME
MAIL_LIST=$WORKING_DIR/$MAIL_LIST_FILENAME

SERVER_STATUS=0 #0 - No Server Down #1 - Server Down

#Mail Settings (FROM, SUBJECT, emailtarget, msgdate, daemail)
FROM="distcc_report.mailbot@distccmon.com"

function sendmail(){
if [ -z $SERVER_STATUS ]
then
SUBJECT="Buildfarm Monitor : Server Up"
else
SUBJECT="Buildfarm Monitor : Server Down"
fi

msgdate='date+"%a, %e %Y %T %z"'
daemail=$(cat <> $REPORTFILE
SERVER_STATUS=1
else
echo "Server : $1 [UP]" >> $REPORTFILE
fi
}

echo "$(date)" >> $REPORTFILE
echo "-------------------------------------" >> $REPORTFILE
if [ -r $HOSTFILE ]
then
#Reading Hosts
exec 9<$HOSTFILE
while read -u9 line
do
#Processing Hosts
check_status $line
done
else
echo "Error : HostFile ($HOSTFILE) not Found"
exit 111        #Exit 111 : Hostfile Not Found
fi

#Reading Maillist
if [ -r $MAIL_LIST ]
then
#Reading Maillist
exec 8<$MAIL_LIST
while read -u8 list
do
#Reading List
emailtarget=$list,$emailtarget
done
echo -e "\nSTATUS : Sending Mail to $emailtarget"
sendmail
else
echo "Error : Maillist ($MAIL_LIST) not Found"
exit 112        #Exit 112 : Maillist Not Found
fi

以上是关于sh Distcc HealthMonitor的主要内容,如果未能解决你的问题,请参考以下文章

distcc 问题:它真的可以加快编译速度吗?

.Net 和/或单声道是不是有等效的 ccache 或 distcc

distcc (dcc_execvp) ERROR: failed to exec XX: Permission denied

linux分布式编译

linux分布式编译

linux分布式编译