Adding subdirectories for remote commands to control ILO and DRAC cards over
[monitor.git] / automate_pl03.sh
1 #!/bin/bash
2
3 set -e
4 cd $HOME/monitor/
5
6 #########################
7 # 1. FINDBAD NODES 
8 rm -f pdb/production.findbad2.pkl
9 ./findbad.py --cachenodes --debug=0 --dbname="findbad2"
10
11 ########################
12 # COPY to golf for diagnose.py and action.py
13 cp pdb/production.findbad2.pkl pdb/production.findbad.pkl
14 scp pdb/production.findbad2.pkl soltesz@golf.cs.princeton.edu:monitor3/pdb/production.findbad.pkl
15
16 ########################
17 # COPY Act_all records
18 #scp soltesz@golf.cs.princeton.edu:monitor3/pdb/production.act_all.pkl pdb/
19
20 ########################
21 # badcsv.txt
22 ./printbadcsv.py  | grep -v loading | tr -d ' ' > badcsv.txt
23 cp badcsv.txt /plc/data/var/www/html/monitor/
24
25 #########################
26 # 2. FINDBAD PCUS
27 rm -f pdb/production.findbadpcus2.pkl
28 ./findbadpcu.py --increment --refresh --debug=0 --dbname=findbadpcus2
29 # convert pkl to php serialize format.
30 cp pdb/production.findbadpcus2.pkl pdb/production.findbadpcus.pkl
31 ./pkl2php.py -i findbadpcus2 -o findbadpcus
32
33
34 for f in findbad act_all findbadpcus l_plcnodes; do 
35         cp pdb/production.$f.pkl archive-pdb/`date +%F`.production.$f.pkl
36 done