X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=automate-default.sh;h=9f0f9d175c8bc1dc767e0b3f546330c9e63b49f7;hb=1a924461e1cdfdde9f5b4cdd5b9d81ca365ec981;hp=24a9e6138fae493c612020027cdbe7f0a8bad969;hpb=c9d06f3b274ecbc092a0b3eb1f5ceb6c0f734aad;p=monitor.git diff --git a/automate-default.sh b/automate-default.sh index 24a9e61..9f0f9d1 100755 --- a/automate-default.sh +++ b/automate-default.sh @@ -1,5 +1,7 @@ #!/bin/bash +export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + # 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 @@ -60,27 +62,23 @@ 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 || : +service plc restart monitor echo "Performing FindAll Nodes" ######################### # 1. FINDBAD NODES -${MONITOR_SCRIPT_ROOT}/findall.py --increment $DATE || : +${MONITOR_SCRIPT_ROOT}/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 -echo "Archiving pkl files" -######################### -# Archive pkl files. -for f in act_all l_plcnodes site_persistflags node_persistflags pcu_persistflags ; do - if [ -f ${MONITOR_DATA_ROOT}/production.$f.pkl ] ; then - cp ${MONITOR_DATA_ROOT}/production.$f.pkl ${MONITOR_ARCHIVE_ROOT}/`date +%F-%H:%M`.production.$f.pkl - else - echo "Warning: It failed to archive ${MONITOR_DATA_ROOT}/production.$f.pkl" - fi -done +${MONITOR_SCRIPT_ROOT}/policy.py $DATE || : +${MONITOR_SCRIPT_ROOT}/statistics/add-record.py || : +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 +service plc restart monitor || : rm -f $MONITOR_PID