4

At this moment I am trying to make a generic error handling script using Pentaho. So far I've found some information about Shell scripts but they do not seem to work for me.

What I want to create is a script (Shell or whatever) that can send messages through Gmail or Hipchat with information about the error and what went wrong. This has to be a generic step so that it can easily be placed in any other job.

Does anyone have ideas? I can't find much (dated) information about Pentaho at all through Google.

I have also tried sending E-mail but for some reason I just get an E-mail containing what was done, not with the errors I get?

The shell script I found is listed below, however it does not seem to be sending E-mail:

#!/bin/sh

OUTDIR=/pentaho/spoon/data-integration/Backup/FCP_DEL_ALL.out
v_jobfile=/pentaho/spoon/data-integration/production_reports/XYZ.kjb

/pentaho/spoon/data-integration/kitchen.sh \
-file="$v_jobfile" -level=Minimal > $OUTDIR
if [ $? -eq 0 ];
then
echo "The Program Completed Successfully(KAAS) :-" >> $OUTDIR
else
mail -s "TRF NAME ERROR" mick.vanhulst@gmail.com -c mick.vanhulst@gmail.com < /pentaho/spoon/data-integration/Backup/FCP_DEL_ALL.out
fi
Marlon Abeykoon
  • 11,927
  • 4
  • 54
  • 75
Mick
  • 324
  • 4
  • 14

1 Answers1

4

Try setting the level to Error. By this way, only error messages would be written to log file. Also, use -log option. Also, instead of checking return code of kitchen.sh, check whether log file is empty.

OUTDIR=/pentaho/spoon/data-integration/Backup/FCP_DEL_ALL.out
v_jobfile=/pentaho/spoon/data-integration/production_reports/XYZ.kjb

/pentaho/spoon/data-integration/kitchen.sh \
-file="$v_jobfile" -level=Error -log="$OUT_DIR"
if [ -z "$OUTDIR" ];
then
echo "The Program Completed Successfully(KAAS) :-" >> $OUTDIR
else
mail -s "TRF NAME ERROR" mick.vanhulst@gmail.com -c mick.vanhulst@gmail.com < /pentaho/spoon/data-integration/Backup/FCP_DEL_ALL.out
fi
cyber.sh
  • 712
  • 4
  • 10
  • 1
    Thank you for your answer! Unfortunatly I cannot upvote it since I am a new user. However you have my gratitude! – Mick Dec 09 '15 at 21:05