Forum Discussion

twyd2009's avatar
twyd2009
Level 4
16 years ago

Scripting DTRACE

Hey All-

We're seeing some funny and sporadic issues on our environment.  In an effort to troubleshoot, I'm looking for a way to schedule DTRACE to run on a specific schedule for a specific set of components.  has anyone had any success in doing this ???

Thanks in advance!!
  • yes,

    I have coverd this a number of times.

    https://www-secure.symantec.com/connect/articles/enterprise-vault-dtrace

    @echo off
    
    setlocal
    set dtlogfile=%CD%\dtrace.log
    del %dtlogfile% /q
    
    set dtcmds=dtracecmd.ini
    
    echo set DirectoryService v >> %dtcmds%
    echo log %dtlogfile% >> %dtcmds%
    echo comment EV Support canned archive task failure script >> %dtcmds%
    rem log the dtrace output for 20 minutes
    echo pause 20 >> %dtcmds%
    
    for /F "tokens=3*" %%i in ('REG QUERY "HKLM\SOFTWARE\KVS\Enterprise Vault\Install" /v InstallPath ^| find "REG_SZ"') DO SET EVINSTALLPATH=%%i %%j
    path %path%;%EVINSTALLPATH%
    dtrace.exe < %dtcmds%
    
    if exist %dtlogfile% (
    echo log file ^(%dtlogfile%^)
    ) else (
    echo Log file ^(%dtlogfile%^) not found.
    echo +++
    more %dtcmds%
    echo +++
    path
    echo +++
    )
    
    :end
    rem tidy up
    del %dtcmds% /q
    endlocal

  • yes,

    I have coverd this a number of times.

    https://www-secure.symantec.com/connect/articles/enterprise-vault-dtrace

    @echo off
    
    setlocal
    set dtlogfile=%CD%\dtrace.log
    del %dtlogfile% /q
    
    set dtcmds=dtracecmd.ini
    
    echo set DirectoryService v >> %dtcmds%
    echo log %dtlogfile% >> %dtcmds%
    echo comment EV Support canned archive task failure script >> %dtcmds%
    rem log the dtrace output for 20 minutes
    echo pause 20 >> %dtcmds%
    
    for /F "tokens=3*" %%i in ('REG QUERY "HKLM\SOFTWARE\KVS\Enterprise Vault\Install" /v InstallPath ^| find "REG_SZ"') DO SET EVINSTALLPATH=%%i %%j
    path %path%;%EVINSTALLPATH%
    dtrace.exe < %dtcmds%
    
    if exist %dtlogfile% (
    echo log file ^(%dtlogfile%^)
    ) else (
    echo Log file ^(%dtlogfile%^) not found.
    echo +++
    more %dtcmds%
    echo +++
    path
    echo +++
    )
    
    :end
    rem tidy up
    del %dtcmds% /q
    endlocal

  • Another option is that you setup DTrace with a Trigger to only start capturing data when the specific event happens

    Type DTrace
    Once you are at the DTrace Prompt Type trigger
    This will switch you to the <DT Trigger> prompt
    in here type the error you are looking to capture proceeded with INC
    E.G inc 0X80004005 (this is a sample error code but you can use event ID or other error text)
    That will add the 0X80004005 to be the trigger
    Then type q. this will quit out of the trigger interface back to the normal dtrace prompt

    at this point set up dtrace normally for the processes you want to trace BUT instead of using log you need to enter watch

  • Thanks!!!! Wayne, does this script work with EV 8.0.2 as far as you know????
  • Also - how would I go about setting the logging levels on various subcompnents?
  • Hay twyd2009,

    yea works with every version of Enterprise Vault

    as for the logging levels you will need to set that here

    echo set DirectoryService v >> %dtcmds%
    
    just chnage the v wit whatevr you want to use say m for medium for example