1 2 Previous Next 16 Replies Latest reply on Aug 19, 2019 5:01 AM by Bill Robinson

    Intermittent response from "JobRun - getLogItemsByJobRunId" command

    Siddhesh Bakkar
      Share This:

      Hello Everyone,

       

      We have created a python script to access the BSA webservices & trigger a NSH job in BSA. We are able to successfully trigger the job. For fetching the job logs, we are using the "JobRun - getLogItemsByJobRunId" command. But we are observing that some times only partial job logs are fetched by the command but when we check the NSH job result from the BSA console, it is showing all the logs.

       

      Sharing the python code for fetching the output :

       

      #       Find the JobRunLogs from JobRunID

                      args3 = [jobdbkey, runid]

                      joblogs_report = ticket_id + "_joblogs.txt"

                      joblogs = client2.service.executeCommandByParamList('JobRun', 'getLogItemsByJobRunId', args3)

                      print "==================JOB LOGS========================"

                      print "Job Logs :\n",joblogs

                      print "=========================================="

                      file9 = open(joblogs_report, 'w')

                      filewrite5 = file9.write(str(joblogs))

                      file9.close()

                      file10 = open(joblogs_report, 'r')

                      filewrite6 = file10.read().splitlines()

                      file10.close()

       

      Partial output :

       

      (Result){

         classInstance = False

         comments = "No comments"

         executionTime = 0

         list = False

         memoryUsed = 0

         realInputArguments[] =

            "DBKey:SJobModelKeyImpl:2007707-40-5874634",

            "3736986",

         returnValue = "Type: Info Date: Thu Oct 11 17:11:12 IST 2018 Message: JobRun Log Settings: JobRun Limit = 1000000, Per Target Log Limit = 1000, Per Target Log Level = AllInfo

      Type: Info Date: Thu Oct 11 17:11:12 IST 2018 Message: Started running the job 'nb_bpclntcmd_ip' with priority 'NORMAL' on application server 'job_deployment_1_app'(2,000,900)

      Type: Info Date: Thu Oct 11 17:11:22 IST 2018 Message: The job 'nb_bpclntcmd_ip' has succeeded

      "

         success = True

       

      BSA Console Output for the above request :

       

       

       

      Full Output received for the next request trigerred for the same job :

       

      (Result){

         classInstance = False

         comments = "No comments"

         executionTime = 0

         list = False

         memoryUsed = 0

         realInputArguments[] =

            "DBKey:SJobModelKeyImpl:2007707-56-5874634",

            "3785844",

         returnValue = "Type: Info Date: Thu Oct 11 19:14:22 IST 2018 Message: JobRun Log Settings: JobRun Limit = 1000000, Per Target Log Limit = 1000, Per Target Log Level = AllInfo

      Type: Info Date: Thu Oct 11 19:14:22 IST 2018 Message: Started running the job 'nb_bpclntcmd_ip' with priority 'NORMAL' on application server 'job_deployment_1_app'(2,000,600)

      Type: Info Date: Thu Oct 11 19:14:23 IST 2018 Message: Executing work item NSH Script Job:nb_bpclntcmd_ip; Server:10.71.13.36;  on application server: job_deployment_1_app

      Type: Info Date: Thu Oct 11 19:14:25 IST 2018 Message: host 10.27.10.210: 10.65.35.22 at 10.85.45.22

      Type: Info Date: Thu Oct 11 19:14:25 IST 2018 Message: aliases:     10.23.85.22

      Type: Info Date: Thu Oct 11 19:14:26 IST 2018 Message: Exit Code 0

      Type: Info Date: Thu Oct 11 19:14:27 IST 2018 Message: The job 'nb_bpclntcmd_ip' has succeeded

      "

         success = True

       

      This issue happens intermittently & we are unable to find out the exact cause.

       

      Kindly help!

        1 2 Previous Next