1 Reply Latest reply on Sep 24, 2015 8:38 PM by Yanick Girouard

    Script job output logged as errors?

    michael huttner

      My script job executes a script file (in this case perl, but the same result happens with a shell script) and gets (X) error lines in the log for standard output from the file, why?

       

      Right now it is a Type 2 script with the following content:

       

      echo WHOAMI=$(whoami)

      echo BLID=$(blid)

      echo Executing on $(hostname) at $(date)

      SCRIPT=/bladelogic/depot/tmp/AD_SYNC2/test.pl

      ls -l $SCRIPT

      echo Executing CMD "$SCRIPT $1 $2 $3 $4 $5 $6 $7 $8 $9"

      $SCRIPT $1 $2 $3 $4 $5 $6 $7 $8 $9 >&2

      EXIT_CODE=$?

      echo job exit code = $EXIT_CODE

      exit $EXIT_CODE

       

       

      InfoSep 24, 2015 4:06:12 PMStarted running the job 'TEST' with priority 'NORMAL' on application server 'myhost'(2,151,035)
      InfoSep 24, 2015 4:06:13 PMExecuting work item NSH Script Job:TEST;  on application server: myhost
      InfoSep 24, 2015 4:06:14 PMWHOAMI=bladmin
      InfoSep 24, 2015 4:06:14 PMBLID=local: uid=65535(bladmin) gid=3051(bladmin) remote: role=MYROLE user=MYLOGIN@MYCOMPANY timeout=1439(minutes) 59(seconds)
      InfoSep 24, 2015 4:06:14 PMExecuting on myhost.mycompany.com at Thu Sep 24 15:06:14 CDT 2015
      InfoSep 24, 2015 4:06:14 PM-rwxr-xr-x  1 zkijsr4  bladmin      145 Sep 24 15:06 /bladelogic/depot/tmp/test.pl
      InfoSep 24, 2015 4:06:14 PMExecuting CMD /bladelogic/depot/tmp/test.pl myhost
      ErrorSep 24, 2015 4:06:14 PMExecuting /bladelogic/depot/tmp/test.pl
      ErrorSep 24, 2015 4:06:14 PMprinting output, hi there
      ErrorSep 24, 2015 4:06:14 PMquitting with exit code: 0
      InfoSep 24, 2015 4:06:14 PMjob exit code = 0
      InfoSep 24, 2015 4:06:14 PMExit Code 0
      InfoSep 24, 2015 4:06:14 PMThe job 'TEST' has succeeded

       

       

      Here is the script:

       

      #!/usr/bin/perl

      print "Executing $0\n";

      print "printing output, hi there\n";

      my $exit = 0;

      print "quitting with exit code: $exit\n";

      exit $exit;

       

      Very strange, changed to Type 3 and all I see is "Info" lines but no output (or error indicators)..