Forum Discussion

issmag's avatar
issmag
Level 5
11 years ago
Solved

Job Queue Log

hello,

please, where can i find the job queue logs ??

is there a specific directory for that ? i need to monitor the job queue during the week end.

thanks in advance for your help.

 

Master server : Windows 2008 R2.

Netbackup : Entreprise Edition 7.5.0.6

 

  • Hi issmag,

    You could save this script as something like:

    C:\NBU-SCRIPTS\mon-job-counts\mon-job-counts.bat

    ...and schedule a task to run it every 5 or 10 or so minutes.

    Then after the weekend, collect the "mon-job-counts.csv" file, and open in Excel and you should be able to easily graph the numbers.

    HTH

    @echo off
    setlocal enabledelayedexpansion
    
    set z_path=%~dp0
    set z_name=%~n0
    
    set z_file_csv=!z_path!!z_name!.csv
    set z_file_log=!z_path!!z_name!.log
    set z_file_sum=!z_path!!z_name!.sum
    set z_file_tmp=!z_path!!z_name!.tmp
    
    if exist "!z_file_sum!"  del "!z_file_sum!"
    if exist "!z_file_tmp!"  del "!z_file_tmp!"
    
    call :log ""
    call :log ""
    call :log "***************************************"
    call :log "Script started..."
    set z_nbu_path=C:\Program Files\Veritas\NetBackup
    set z_cli_bpdbjobs=!z_nbu_path!\bin\admincmd\bpdbjobs.exe
    if not exist "!z_cli_bpdbjobs!" (
      call :log "Unable to locate `!z_cli_bpdbjobs!`, aborting..."
      goto :eof
    )
    
    call :log ""
    call :log "Getting current date time..."
    set z_date=!date!
    set z_time=!time:~0,8!
    if "!z_date:~3,1!"==" " (
      set z_date_dd=!z_date:~4,2!
      set z_date_mm=!z_date:~7,2!
      set z_date_yyyy=!z_date:~10,4!
    ) else (
      set z_date_dd=!z_date:~0,2!
      set z_date_mm=!z_date:~3,2!
      set z_date_yyyy=!z_date:~6,4!
    )
    set z_date_yyyy_mm_dd=!z_date_yyyy!/!z_date_mm!/!z_date_dd!
    call :log "...date in yyyy/mm/dd is `!z_date_yyyy_mm_dd!`..."
    call :log "Done..."
    
    call :log ""
    call :log "Collecting job summary..."
    "!z_cli_bpdbjobs!" -summary >"!z_file_sum!"
    set z_sts=!errorlevel!
    if not "!z_sts!"=="0" (
      call :log "...attempt to collect job summary failed, status `!z_sts!`, aborting..."
      goto :end
    )
    call :log "Done..."
    
    call :log ""
    call :log "Processing job summary..."
    for /f "tokens=1,2,3,4,5,6,7,8,9,10,11,12" %%a in ('type "!z_file_sum!"') do (
      if /i "%%a %%b"=="master server" (
        if not exist "!z_file_csv!" (
          set z_header=Server,Date Time,Queued,Requeued,Active,Success,PartSucc,Failed,Incomp,Susp,Waiting,Total
          (echo !z_header!)>>"!z_file_csv!"
        )
      ) else (
        set z_csv=%%a,!z_date_yyyy_mm_dd! !z_time!,%%b,%%c,%%d,%%e,%%f,%%g,%%h,%%i,%%j,%%k
        (echo !z_csv!)>>"!z_file_csv!"
      )
    )
    call :log "Done..."
    
    :end
    call :log ""
    call :log "Script completed..."
    REM echo+
    REM pause
    exit /b
    
    :log
    (echo !date! !time:~0,8!  %~1)
    (echo !date! !time:~0,8!  %~1)>>"!z_file_log!"
    goto :eof

9 Replies

  • could you elobrate your requirement more please..

    are you looking to moniter the Queue jobs over the weekend?

    or jobs that are going to trigger in weekends?

    if first one..

    Queue jobs always you can find from activity moniter.. and if you would like to get the mail notification and get the details without loing to the serve

    you can scheule the bpdbjobs -summary command in cron/scheuler to send the mail with the number of queue jobs and active jobs.. etc..

  • No 'log' for queued jobs, but you should be able to list them with bpdbjobs from cmd.

    Something like :

    bpbdbjobs |findstr Queued

    (I don't have access to a Windows master to test.)

  • Activity monitor job log is located in [INSTALL_PATH]/netbackup/db/jobs/trylogs but that does not directly tell you if a job i queued,active,done or failed.

    use the netbackup command bpdbjobs for that 

    There is a usage example here for UNIX

    http://www.backupcentral.com/wiki/index.php/How_do_you_decipher_the_output_of_%22bpdbjobs_-report_-all_columns%22%3F

  • Hi issmag,

    You could save this script as something like:

    C:\NBU-SCRIPTS\mon-job-counts\mon-job-counts.bat

    ...and schedule a task to run it every 5 or 10 or so minutes.

    Then after the weekend, collect the "mon-job-counts.csv" file, and open in Excel and you should be able to easily graph the numbers.

    HTH

    @echo off
    setlocal enabledelayedexpansion
    
    set z_path=%~dp0
    set z_name=%~n0
    
    set z_file_csv=!z_path!!z_name!.csv
    set z_file_log=!z_path!!z_name!.log
    set z_file_sum=!z_path!!z_name!.sum
    set z_file_tmp=!z_path!!z_name!.tmp
    
    if exist "!z_file_sum!"  del "!z_file_sum!"
    if exist "!z_file_tmp!"  del "!z_file_tmp!"
    
    call :log ""
    call :log ""
    call :log "***************************************"
    call :log "Script started..."
    set z_nbu_path=C:\Program Files\Veritas\NetBackup
    set z_cli_bpdbjobs=!z_nbu_path!\bin\admincmd\bpdbjobs.exe
    if not exist "!z_cli_bpdbjobs!" (
      call :log "Unable to locate `!z_cli_bpdbjobs!`, aborting..."
      goto :eof
    )
    
    call :log ""
    call :log "Getting current date time..."
    set z_date=!date!
    set z_time=!time:~0,8!
    if "!z_date:~3,1!"==" " (
      set z_date_dd=!z_date:~4,2!
      set z_date_mm=!z_date:~7,2!
      set z_date_yyyy=!z_date:~10,4!
    ) else (
      set z_date_dd=!z_date:~0,2!
      set z_date_mm=!z_date:~3,2!
      set z_date_yyyy=!z_date:~6,4!
    )
    set z_date_yyyy_mm_dd=!z_date_yyyy!/!z_date_mm!/!z_date_dd!
    call :log "...date in yyyy/mm/dd is `!z_date_yyyy_mm_dd!`..."
    call :log "Done..."
    
    call :log ""
    call :log "Collecting job summary..."
    "!z_cli_bpdbjobs!" -summary >"!z_file_sum!"
    set z_sts=!errorlevel!
    if not "!z_sts!"=="0" (
      call :log "...attempt to collect job summary failed, status `!z_sts!`, aborting..."
      goto :end
    )
    call :log "Done..."
    
    call :log ""
    call :log "Processing job summary..."
    for /f "tokens=1,2,3,4,5,6,7,8,9,10,11,12" %%a in ('type "!z_file_sum!"') do (
      if /i "%%a %%b"=="master server" (
        if not exist "!z_file_csv!" (
          set z_header=Server,Date Time,Queued,Requeued,Active,Success,PartSucc,Failed,Incomp,Susp,Waiting,Total
          (echo !z_header!)>>"!z_file_csv!"
        )
      ) else (
        set z_csv=%%a,!z_date_yyyy_mm_dd! !z_time!,%%b,%%c,%%d,%%e,%%f,%%g,%%h,%%i,%%j,%%k
        (echo !z_csv!)>>"!z_file_csv!"
      )
    )
    call :log "Done..."
    
    :end
    call :log ""
    call :log "Script completed..."
    REM echo+
    REM pause
    exit /b
    
    :log
    (echo !date! !time:~0,8!  %~1)
    (echo !date! !time:~0,8!  %~1)>>"!z_file_log!"
    goto :eof
  • I tested it with NetBackup v7.6.0.1 on Windows 2008 R2, but I suspect that NetBackup v7.5.0.6 may have less fields in 'bpdbjobs -summary', if so, if you post the output from:

    > bpdbjobs -summary

    > echo %date%

    > type "C:\Program Files\Veritas\NetBackup\version.txt"

    ...then I will update the script for you, for your version.

  • Thanks a lot sdo,  it's exactely what i was looking for :)

    thank you very very very much :)

  • You may want to move the solution... or change to split solution.

  • yes, but i don't knnow how to do it :)

    thank you marianne