5 Replies Latest reply on Apr 22, 2019 3:09 PM by Justin Holbrook

    Purge Control-M workbench environment?

    Justin Holbrook
      Share:|

      Is there a way to force a workbench environment to purge deleted jobs? I was playing with cyclic jobs and now I have some jobs that have been stuck in my environment for days.

       

      Also, has anyone noticed that certain commands do not provide back accurate representations of the properties of jobs? Specifically "ctm run job:status::get <jobID>" vs "ctm run jobs:status::get". I can't show jobs that are deleted unless I query specifically by jobId. Is this because I'm in the workbench environment or will I still have this issue once I start communicating with our production environment?

       

      Example:

       

      PS C:\Users\JDHolbrook> (ctm run jobs:status::get | convertfrom-json).statuses | Select-Object -Property jobId,Type,Status,Held,deleted | Format-Table

       

       

      jobId           type    status    held deleted

      -----           ----    ------    ---- -------

      workbench:00053 Folder  Ended OK False   False

      workbench:0005h Folder  Ended OK False   False

      workbench:0005i Command Ended OK False   False

      workbench:00054 Command Ended OK False   False

       

       

      PS C:\Users\JDHolbrook> ctm run job::delete workbench:0005i

      {

        "message": "Job workbench:0005i is already deleted"

      }

      PS C:\Users\JDHolbrook> (ctm run job:status::get workbench:0005i | convertfrom-json) | select-object -Property jobId,Type,Status,Held,deleted | Format-Table

       

       

      jobId           type    status    held deleted

      -----           ----    ------    ---- -------

      workbench:0005i Command Ended OK False    True

        • 1. Re: Purge Control-M workbench environment?
          MunKeong Lee

          Hi Justin

          What you are experiencing with the Control-M automation is a known issue that will be addressed in 9.0.18 fix pack 3. This article describes the issue After marking a Control-M job as deleted using the Control-M Automation API REST interface, the job shows as not deleted from the Automation API status request

          Since these jobs are actually marked as deleted, they should be purged during the next new day. Is this not happening in your case?

          Regards,

          MK

          1 of 1 people found this helpful
          • 2. Re: Purge Control-M workbench environment?
            Justin Holbrook

            Hi MunKeong,

             

            I'm not sure if the next new day is triggering. I'm using the version you mentioned above as the .ova for my workbench virtual appliance is "workbench_vmware_ova-9.0.18.300-20190218.132300-1". The OVA is running on my laptop which gets shut down at the end of the day. I tried exporting the workbench parameters with "ctm config server:params::get workbench", but I don't see any newday time configurations:

             

            {

                "name": "AGENTS_CLEANUP_IN_NEWDAY",

                "value": "",

                "defaultValue": "Y"

              },

              {

                "name": "STATISTICS_CLEANUP_IN_NEWDAY",

                "value": "",

                "defaultValue": "Y"

              },

              {

                "name": "STOP_SUBMISSION_BEFORE_NEWDAY",

                "value": "",

                "defaultValue": "2"

              },

              {

                "name": "NEWDAY_MODE",

                "value": "",

                "defaultValue": "1"

              },

             

             

            Is there a way to trigger the newday or to set the time when it runs when you're using the workbench?

            • 3. Re: Purge Control-M workbench environment?
              MunKeong Lee

              Hi Justin

              You can login to the workbench EM via GUI using workbench for username and password. The new day time is set to +0000.  You can change the new day time using CCM but it's not a good long term solution. You should just let workbench housekeep unwanted jobs during the new day like a normal Control-M setup.

              Regards,

              MK

              • 4. Re: Purge Control-M workbench environment?
                Adriano Gomes

                Hi Justin Holbrook

                 

                As Workbench is a very secured control-M Appliance with little or almost none privileged access to it, performing changes that you would be easily done when you have the credentials  access to the Box is very painful.

                 

                Whether you have access to Workbench with CTM EM GUI local windows to connect with Workbench, as MunKeong Lee have had mentioned, you can perform changes to Control-M New Day Time only and wait it happens in order to have the Active environment cleaned up

                In order to make this Change to New Day be effective you must set SYSTEM daily last run to previous DATE first  prior to changing THE New Day TIME, otherwise no clean up will happen, because Control-M knows its last NDT run DATE. You would need fist run "ctmudlst UPDATE SYSTEM YYYYMMDD" where   DD must be D-1. but it can only be executed as ctm user you won't be able to do it with in workbench.

                 

                Although, If you want this to work appropriately with Workbench, there is still an open door that can be exploited with Notify to a program (CTMSHOUT) that will allow you to execute programs as ctm server account within Workbench Box and invoke reset_gd, or ctmudlst UPDATE SYSTEM YYYYMMDD"  (ONLY the Old Wolves knows about it)

                 

                Please follow the steps below:

                 

                1) Create a new shout destination to a program and type ~/ctm_server/scripts/reset_gd (is the internal call to perform New DAY)

                 

                2) Create a Run as DUMMY Job and define ON Do Actions "when Job Ended do Notify to RESET_GD"

                3) Order the Dummy Job and wait for the cleanup.

                Note that, as it is a native control-M process, jobs ended NOT OK, executing, and held will be kept also Tables with automatic order will also be scanned.

                 

                CAUTION: Do not run this on PRODUCTION.

                 

                My Best

                A>Gomes

                2 of 2 people found this helpful
                • 5. Re: Purge Control-M workbench environment?
                  Justin Holbrook

                  Thank for this detailed response. I'll do some searching and see if I can get a copy of the GUI. I've been doing everything through the CLI and API thus far.