X-Git-Url: http://git.onelab.eu/?p=monitor.git;a=blobdiff_plain;f=automate-default.sh;h=8d300a7c0d4b9537bba3063eb417554107007c34;hp=d01650e252178acea4d0bb376462a74502ba20fa;hb=40884a302bf204a7f42044b72d87f9431ad6dd35;hpb=21f8190281cfb38c3e24dfba6c89420830435f1f diff --git a/automate-default.sh b/automate-default.sh index d01650e..8d300a7 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,43 +62,22 @@ 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 Findbad Nodes" +echo "Performing FindAll Nodes" ######################### # 1. FINDBAD NODES -${MONITOR_SCRIPT_ROOT}/findbad.py --increment $DATE || : +${MONITOR_SCRIPT_ROOT}/findall.py $DATE || : ps ax | grep BatchMode | grep -v grep | awk '{print $1}' | xargs -r kill || : - -echo "Performing Findbad PCUs" -######################### -# 2. FINDBAD PCUS -${MONITOR_SCRIPT_ROOT}/findbadpcu.py --increment $DATE || : # clean up stray 'locfg' processes that hang around inappropriately... ps ax | grep locfg | grep -v grep | awk '{print $1}' | xargs -r kill || : -echo "Performing uptime changes for sites, nodes, and pcus" -######################## -# 3. record last-changed for sites, nodes and pcus. -${MONITOR_SCRIPT_ROOT}/sitebad.py --increment || : -${MONITOR_SCRIPT_ROOT}/nodebad.py --increment || : -${MONITOR_SCRIPT_ROOT}/pcubad.py --increment || : - -echo "Archiving pkl files" -######################### -# Archive pkl files. -for f in findbad act_all findbadpcus 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 - -#echo "Running grouprins on all dbg nodes" -############################ -# 5. Check if there are any nodes in dbg state. Clean up afterward. -#${MONITOR_SCRIPT_ROOT}/grouprins.py --mail=1 --reboot --nodeselect 'state=DOWN&&boot_state=(boot|rins|dbg|diag)' --stopselect "state=BOOT" || : -#${MONITOR_SCRIPT_ROOT}/grouprins.py --mail=1 --reboot --nodeselect 'state=DEBUG&&boot_state=(rins|dbg|boot)' --stopselect 'state=BOOT' || : +${MONITOR_SCRIPT_ROOT}/policy.py $DATE +#${MONITOR_SCRIPT_ROOT}/checksync.py $DATE || : +service plc restart monitor +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 rm -f $MONITOR_PID