11 Replies Latest reply on Feb 18, 2020 1:16 AM by Mun Keong Lee

    Report on Jobs deleted from Control-M

    Shankar Ramesh
      Share This:

      Hi,

       

      I have a requirement to get a count of jobs deleted from Control-M environment. I have tried in RF, but that report shows if any jobs are moved from One folder to another folder also audited as deletion of jobs.

       

      Is there any way to get the exact count of jobs deleted from Control-M?

      Thanks,

      Gowri

        • 1. Re: Report on Jobs deleted from Control-M
          Adil Kareem

          Hello,

           

          Kindly use Audit Report which will help you out.

           

          Thanks

          Adil

          1 of 1 people found this helpful
          • 2. Re: Report on Jobs deleted from Control-M
            pramoda c n

            Use Reporting Facility >>> Active >>> Create new Report >>> Deleted XXX >>> Select Control-M server >>> bring it to right side >>> remove * >>>Archived network >>>> Select Odate >>> retention of History = Odates shown here >>> next >>>> Select Drop down >>>> State = Deleted ( Type it ) >>> Select fields accordingly >>> Finish

            3 of 3 people found this helpful
            • 3. Re: Report on Jobs deleted from Control-M
              Ilyas Shaikh

              Hi Shanker,

               

              As steps mentioned by pramoda c n, in active jobs reporting template, filter the jobs with Deleted=1 to extract the deleted job details.

               

              Regards,

              Ilyas Shaikh

              • 4. Re: Report on Jobs deleted from Control-M
                Tamilmani N

                Control-M Reports-> +Report-> Add New Report-> Active-> Active Jobs->

                Network-> current active/last day/archived date

                Filters-> Deleted Is Yes

                2 of 2 people found this helpful
                • 5. Re: Report on Jobs deleted from Control-M
                  Fabiana Delfino

                  Hi guys,

                   

                  Is there a way to create a report to select the jobs that were removed from daily?

                   

                   

                  Regards,

                   

                  Fabiana

                  • 6. Re: Report on Jobs deleted from Control-M
                    Mun Keong Lee

                    Hi Fabiana

                    Jobs from previous day that are removed automatically during the new day are recorded in the cmr_ioalog table of the Control-M server database. The Control-M utility, ctmlog, can be used to query such log entries but it has limited query capabilities. Querying from the database will be a better option. Below is my sample SQL. Execute this SQL on a daily basis after the new day procedure has been completed. Here I'm assuming that the new day is at 0700 and will not last more than 5 minutes. Changes these parameters accordingly to fit your environment.

                     

                    SELECT *

                    FROM   cmr_ioalog

                    WHERE  Concat(logdate, logtime) >= Concat(To_char(CURRENT_DATE, 'YYYYMMDD'), '070000')

                           AND Concat(logdate, logtime) <= Concat(To_char(CURRENT_DATE, 'YYYYMMDD'), '070500')

                           AND message = 'REMOVED FROM ACTIVE JOB FILE BY GENERAL DAILY'

                    ORDER  BY Concat(logdate, logtime) ASC

                     

                    Regards,

                    MK

                    • 7. Re: Report on Jobs deleted from Control-M
                      Fabiana Delfino

                      Hi Lee!

                       

                      Thanks for the answer.

                      I forgot to mention that I needed only the ones wich were not executed.

                      Is it possible to filter on this query?

                       

                       

                      Regards,

                       

                      Fabiana

                      • 8. Re: Report on Jobs deleted from Control-M
                        Mun Keong Lee

                        Hi Fabiana

                        Below is my bash script for listing waiting jobs that were removed. This script queries from the EM database and not the Control-M server database as the previous day's jobs are not available in the Control-M database.

                        Please set the value of environment, PG_PASSWORD, to the password of the database owner (default: emuser) before executing this script so that psql does not prompt for password.

                        I did not have a chance to fully test this script. Do update me regardless of whether it works or not so that I can make modifications if necessary.

                        Regards,

                        MK

                         

                        wait_jobs_removed.sh script (Waiting jobs that were removed after the new day)

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

                        #!/bin/bash

                        # get list of active nets

                        anets=`em psql -A -t -c "select active_net_name,ctm_odate,data_center from COMM where active_net_name !='';"`

                         

                        for anet_info in $anets;

                        do

                          IFS='|' read -a strarr <<< "${anet_info}"

                          #

                          today_net=${strarr[0]}

                          yesterday=$(date -d "${strarr[1]} -1 days" +"%Y%m%d")

                          dc=${strarr[2]}

                          yesterday_net=`em psql -A -t -t -c "SELECT max(netname) FROM public.download where netdate='${yesterday}' group by netdate"`

                          today_table=a${today_net}job

                          yesterday_table=a${yesterday_net}job

                          echo "List of waiting jobs that were deleted in Data Center: ${dc}"

                          em psql -c "\

                            SELECT application, group_name, job_name, status, odate, task_type, order_id \

                            FROM ${yesterday_table} \

                            where status like 'Wait%' \

                            and order_id not in (select order_id from ${today_table});"

                        done

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

                        2 of 2 people found this helpful
                        • 9. Re: Report on Jobs deleted from Control-M
                          Fabiana Delfino

                          Hi Lee!

                           

                          Thanks a lot! I'll try and give you a feedback after.

                           

                           

                          Regards,

                           

                          Fabiana

                          • 10. Re: Report on Jobs deleted from Control-M
                            Fabiana Delfino

                            Lee,

                             

                            I'm trying using the script, but I'm afraid I'm making some mistake.

                            How do I set PG_PASSWORD?

                             

                             

                             

                            Regards,

                             

                            Fabiana

                            • 11. Re: Report on Jobs deleted from Control-M
                              Mun Keong Lee

                              Hi Fabiano

                              I have reply to another post created by you. This post is 3 years old and it's actually asking a different question.

                              Regards,

                              MK