How to set DTrace.exe to run at a time when an administrator is otherwise unavailable.

Article: 100023076
Last Published: 2023-11-09
Ratings: 0 0
Product(s): Enterprise Vault

Description

Sometimes it is necessary to gather a Dtrace during a specific time of night when the user is unavailable to run Dtrace manually (for example, at 2:00 am).  

Solution

There are 2 methods to setup Dtrace to run independently without user interaction:

A. Utilizing the pause command.
B. Setting up Dtrace in a batch file.

To utilize the pause command:
  1. Log onto the Enterprise Vault (EV), Compliance Accelerator (CA) / Veritas Advanced Surveillance (VAS), or Discovery Accelerator (DA) server as the Vault Service Account.
  2. Open a Command Prompt.
  3. In the Command Prompt, navigate to the EV installation folder (default location is C:\Program Files (x86)\Enterprise Vault).
  4. Enter Dtrace 200000.  This will bring up the Dtrace prompt of DT>.
  5. Configure the process or processes to be logged and where the information is to be logged.  See Article 100038975 in the Related Articles section below for more information.
  6. After setting the processes and logging, utilize the pause function as follows:

At the DTrace prompt, enter the following:

DT> pause 300M

Notes:
  1. This option requires the VSA to remain logged in for the duration of the Dtrace logging period.  The screen may be locked, but the account must remain logged onto the EV/CA/VAS/DA server.
  2. The pause command above will put Dtrace on hold for 300 minutes (M refers to the increment of minutes).
  3. The pause command syntax is available by typing "? pause" at the DT prompt with the following results:
Pause [<pause period>[<period units>]]
     <period units> - h:m:s Default:m
 
Example of use:
- Customer is on phone with Technical Support at 5:00pm
- The issue, which does not produce an error that can be filtered, occurs at 10:05 pm
- Using pause 300M will have Dtrace be on hold for 5 hours (300 minutes) and begin tracing at 10:00pm.

To utilize a batch file, implement the following steps.
  1. Open a new file in Notepad on the computer on which the Dtrace is to be run.
  2. Copy the content below into the Notepad file:
echo off
rem This is an example of invoking Dtrace within a batch file.
rem Support generate the batch file, run this & then return
rem the resulting log file.
set dtlogfile=dtlog.txt
del %dtlogfile%

set dtcmds=dtracecmdfile.txt

rem Create the Dtrace command file
echo view > %dtcmds%
rem Set the individual processes per processname using the SET command and V for Verbose
echo set TaskControllerService v >> %dtcmds%
echo set JournalTask v >> %dtcmds%
rem Create the log file which will default to the install location where the Dtrace utility is located using the LOG command
echo log %dtlogfile% >> %dtcmds%
rem Specify length of time to capture using the Monitor command in Seconds
echo monitor 60 >> %dtcmds%
rem Stop logging
echo log >> %dtcmds%
echo yes >> %dtcmds%
echo yes >> %dtcmds%

rem run dtrace.
rem The default buffer is set to 50000 but since we are also monitoring you may see "trace buffer overflow" errors in the log and important information might not be captured.  To avoid this, increase the buffer by using the following command:
dtrace 100000 <%dtcmds%
 
rem tidy up
del %dtcmds% /q
 
Notes:
  1. Keep in mind the following points:.
    1. Adjust the processes based on what needs to be logged by the set command.
    2. Add additional set commands for different processes if necessary.
    3. Adjust the length of time for the Dtrace to run by adjusting the value specified for the monitor option.
    4. When scheduling this batch file to run using the Task Scheduler utility under Windows Server 2008, a directory must be set in the Start in field where the log file will get created.
      1. This field shows up on the Action | Start a Program page in the Create a Basic Task Wizard.
      2. The log file won't get created if that field is left blank; however, this field can be left blank in Windows Server 2003 and the log file will get created in the directory from which the batch file will be called.
  2. Using commands that access sub-functions (for example: Filter, Trigger, Watch, etc) have not been tested in batch file format.  If these sub-functions are able to be successfully tested, please update this technical document with additional details.

For more information about using the Dtrace took, use the links in the Related Articles section.

 

Was this content helpful?