2 Replies Latest reply on Jul 2, 2020 1:01 PM by Jeffrey Jordan

    Having an issue w/ job on a on do action

    Jeffrey Jordan
      Share This:

      We do many various types of on do actions from text in the sysout but I have one which for the life of me can't get it to work of even send an email on text found in sysout. What I need it to do is on error do not ok. Devel has put coding in their .sh script that on error (we're currently going through all the various scenarios on the error testing) but on the first one while his script puts out the error (### ERROR ### if there's some kind of issue or ### SUCCESS ### if it works fine) it does get a exit code of 0 be it success or error. We're just trying to capture the text ### ERROR ### in an on do action to cause job to end not ok but for some reason it's not even seeing that in the on do action. I've tried diff variations w/ the on do action of *ERROR* to just try to send me an email & it won't even do that. So for some reason it's just not seeing that text in the sysout & not sure why. We do this all over the place but not sure why it's not working here??? Any ideas?

       

        • 1. Re: Having an issue w/ job on a on do action
          Bentze Perlmutter

          Hi Jeffrey,

           

          My guess is that the agent, which performs the scanning of the output files when ON/DO Statements are defined, is getting confused by the # symbols. (is this a UNIX/Linux Agent in which case # would represent comment so this might be confusing the agent)

           

          If possible, ask the developer to change the message to:

          === ERROR ===

           

          Also, for testing purposes, I suggest having the job perform a Notify to Alert window.

          This is just in case the problem is sending the email, meaning the ON STMNT is capturing the output correctly but the DO MAIL is failing for an unrelated reason, so it looks like the ON is not working.

           

          Also, since you're working directly with the developer, if he is willing, in his script, where ever he has:

          echo ### ERROR ####

          He can add a line after this of:

          MYRC=99

           

          And where he has

          echo ### SUCCESS ####

          He can add a line after this of:

          MYRC=0

           

          And then add as the last line in the script:

          exit ${MYRC}

           

          This way you don't have to have ON/DO statements at all which will improve overall performance of Control-M/Agent and Control-M/Server,

           

          Regards,

          Bentze

          3 of 3 people found this helpful
          • 2. Re: Having an issue w/ job on a on do action
            Jeffrey Jordan

            I was starting to wonder that but thought that by me using *ERROR* in the actions tab would still work to do the ON-DO even if that was the case. Since he made change to script to just put out ERROR/SUCCESS, the controlm job actually ends w/ error code of 1 or 0 & errs w/o having to use the action tab to tell it to end not ok whereas before it was completing w/ 0 on good or bad.