aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/monitor.sh33
1 files changed, 18 insertions, 15 deletions
diff --git a/scripts/monitor.sh b/scripts/monitor.sh
index 958203be..1fbdcb99 100644
--- a/scripts/monitor.sh
+++ b/scripts/monitor.sh
@@ -1,16 +1,19 @@
#!/bin/sh
-while true; do
- if [ -f cusips_to_price.txt ]; then
- R CMD BATCH --no-restore --no-save ../code/R/build_portfolios.R logs/build_portfolios.Rout &
- fi
- if [ -f scenarios.txt ]; then
- R CMD BATCH --no-restore --no-save ../code/R/build_scenarios.R logs/build_scenarios.Rout
- if [ $HOSTNAME = "gomez" ]; then
- pythonexec=python2
- elif [ $HOSTNAME = "debian" ]; then
- pythonexec=python
- fi
- $pythonexec ../code/python/intex_scenarios.py >logs/intex_scenarios.out
- fi
- sleep 3
-done
+
+(
+ cat <<EOF
+I am sorry to report that unit $MONITOR_UNIT on $HOSTNAME failed.
+
+Service Status
+--------------
+EOF
+
+ systemctl status $MONITOR_UNIT
+ cat <<EOF
+
+Execution Environment
+---------------------
+EOF
+
+ export
+) | email ghorel@lmcg.com -s "Unit $MONITOR_UNIT on $HOSTNAME failed!"