X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=automate-default.sh;h=24a9e6138fae493c612020027cdbe7f0a8bad969;hb=15d79125cf2f49bb4f6ece93ae423689175518f9;hp=b5508c13ffacb32f1eb29e6d0c5840478e91a375;hpb=0fabfc8dbe8f1f2c0d12397e1bc8c6ed686fb5ed;p=monitor.git diff --git a/automate-default.sh b/automate-default.sh index b5508c1..24a9e61 100755 --- a/automate-default.sh +++ b/automate-default.sh @@ -1,7 +1,7 @@ #!/bin/bash # NOTE: Must be an absolute path to guarantee it is read. -INSTALLPATH=/usr/share/monitor-server/ +INSTALLPATH=/usr/share/monitor/ # Generate an 'sh' style file full of variables in monitor.conf $INSTALLPATH/shconfig.py > $INSTALLPATH/monitorconfig.sh source $INSTALLPATH/monitorconfig.sh @@ -61,55 +61,20 @@ fi source ${MONITOR_SCRIPT_ROOT}/agent.sh -echo "Performing Findbad Nodes" +echo "Performing FindAll Nodes" ######################### # 1. FINDBAD NODES -rm -f ${MONITOR_DATA_ROOT}/production.findbad2.pkl -${MONITOR_SCRIPT_ROOT}/findbad.py --increment --cachenodes --debug=0 --dbname="findbad2" $DATE || : -cp ${MONITOR_DATA_ROOT}/production.findbad2.pkl ${MONITOR_DATA_ROOT}/production.findbad.pkl +${MONITOR_SCRIPT_ROOT}/findall.py --increment $DATE || : ps ax | grep BatchMode | grep -v grep | awk '{print $1}' | xargs -r kill || : - -echo "Performing Findbad PCUs" -######################### -# 2. FINDBAD PCUS -rm -f ${MONITOR_DATA_ROOT}/production.findbadpcus2.pkl -${MONITOR_SCRIPT_ROOT}/findbadpcu.py --increment --refresh --debug=0 --dbname=findbadpcus2 $DATE || : -cp ${MONITOR_DATA_ROOT}/production.findbadpcus2.pkl ${MONITOR_DATA_ROOT}/production.findbadpcus.pkl # clean up stray 'locfg' processes that hang around inappropriately... ps ax | grep locfg | grep -v grep | awk '{print $1}' | xargs -r kill || : -#echo "Generating web data" -# badcsv.txt -#${MONITOR_SCRIPT_ROOT}/printbadcsv.py | grep -v loading | tr -d ' ' > badcsv.txt -#cp badcsv.txt /plc/data/var/www/html/monitor/ -#${MONITOR_SCRIPT_ROOT}/showlatlon.py | head -9 | awk 'BEGIN {print ""} { print ""} END{print "
", $0, "
"}' | sed -e 's\|\\g' > /plc/data/var/www/html/monitor/regions.html - -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 "Converting pkl files to phpserial" -######################### -# 4. convert pkl to php serialize format. -${MONITOR_SCRIPT_ROOT}/pkl2php.py -i findbadpcus2 -o findbadpcus -for f in act_all plcdb_hn2lb ; do - if [ -f ${MONITOR_DATA_ROOT}/production.$f.pkl ]; then - ${MONITOR_SCRIPT_ROOT}/pkl2php.py -i $f -o $f - else - echo "Warning: ${MONITOR_DATA_ROOT}/production.$f.pkl does not exist." - fi -done -${MONITOR_SCRIPT_ROOT}/pkl2php.py -i findbad -o findbadnodes -#${MONITOR_SCRIPT_ROOT}/pkl2php.py -i ad_dbTickets -o ad_dbTickets -#${MONITOR_SCRIPT_ROOT}/pkl2php.py -i idTickets -o idTickets +${MONITOR_SCRIPT_ROOT}/policy.py $DATE echo "Archiving pkl files" ######################### # Archive pkl files. -for f in findbad act_all findbadpcus l_plcnodes site_persistflags node_persistflags pcu_persistflags ; do +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 @@ -117,11 +82,5 @@ for f in findbad act_all findbadpcus l_plcnodes site_persistflags node_persistfl 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' || : - cp ${MONITOR_SCRIPT_ROOT}/monitor.log ${MONITOR_ARCHIVE_ROOT}/`date +%F-%H:%M`.monitor.log rm -f $MONITOR_PID