# NOTE: Must be an absolute path to guarantee it is read.
INSTALLPATH=/usr/share/monitor/
-# Generate an 'sh' style file full of variables in monitor.conf
-$INSTALLPATH/shconfig.py > $INSTALLPATH/monitorconfig.sh
+$INSTALLPATH/commands/shconfig.py > $INSTALLPATH/monitorconfig.sh
source $INSTALLPATH/monitorconfig.sh
cd ${MONITOR_SCRIPT_ROOT}
set -e
echo "#######################################"; echo "Running Monitor at $DATE"; echo "######################################"
echo "Performing API test"
-API=$(./testapi.py)
+API=$(${MONITOR_SCRIPT_ROOT}/tools/testapi.py)
if [ "$API" != "ok" ] ; then
# NOTE: Do not try to run any commands if the API is obviously broken.
echo "API IS DOWN : "`date`
PID=`cat $MONITOR_PID`
rm -f $MONITOR_PID
if [ -z $PID ] ; then
- ${MONITOR_SCRIPT_ROOT}/kill.cmd.sh $PID
+ ${MONITOR_SCRIPT_ROOT}/tools/kill.cmd.sh $PID
echo "done."
else
echo "No PID to be killed."
# if no agent is running, set it up.
ssh-agent > ${MONITOR_SCRIPT_ROOT}/agent.sh
source ${MONITOR_SCRIPT_ROOT}/agent.sh
+ ssh-add /etc/planetlab/myops_ssh_key.rsa
ssh-add /etc/planetlab/debug_ssh_key.rsa
ssh-add /etc/planetlab/root_ssh_key.rsa
fi
#TODO: should add a call to ssh-add -l to check if the keys are loaded or not.
source ${MONITOR_SCRIPT_ROOT}/agent.sh
-#${MONITOR_SCRIPT_ROOT}/checksync.py $DATE || :
-${MONITOR_SCRIPT_ROOT}/syncwithplc.py $DATE || :
+${MONITOR_SCRIPT_ROOT}/commands/syncwithplc.py $DATE || :
service plc restart monitor
echo "Performing FindAll Nodes"
#########################
# 1. FINDBAD NODES
-${MONITOR_SCRIPT_ROOT}/findall.py $DATE || :
+${MONITOR_SCRIPT_ROOT}/commands/findall.py $DATE || :
ps ax | grep BatchMode | grep -v grep | awk '{print $1}' | xargs -r kill || :
# clean up stray 'locfg' processes that hang around inappropriately...
ps ax | grep locfg | grep -v grep | awk '{print $1}' | xargs -r kill || :
-${MONITOR_SCRIPT_ROOT}/policy.py $DATE || :
-${MONITOR_SCRIPT_ROOT}/statistics/add-record.py || :
+${MONITOR_SCRIPT_ROOT}/commands/policy.py $DATE || :
curl -s 'http://summer.cs.princeton.edu/status/tabulator.cgi?table=table_nodeview&formatcsv' > /var/lib/monitor/comon/$DATE.comon.csv || :
cp ${MONITOR_SCRIPT_ROOT}/monitor.log ${MONITOR_ARCHIVE_ROOT}/`date +%F-%H:%M`.monitor.log