How to use the vxlogview command

Article: 100017292
Last Published: 2015-01-19
Ratings: 0 0
Product(s): NetBackup & Alta Data Protection

Description

Unified log files are written to the /usr/openv/logs directory and contain logging information for the various NetBackup originators.  Running with high debug and/or diagnostic levels will cause these log files to quickly grow in size.  The vxlogview command can be used to search log files for specific job, originator, or other information.  There are no tuning options for vxlogview to make it run faster.  However, to save time and prevent the vxlogview command from searching unnecessary log files the following techniques can be used.


Use the -i option to search files specific to the originator

The -i option and -o option can be used to search only the files that are contained by a specific originator id.   The -i option  will capture any originator that logs to the same file.  In the case of the Enterprise Media Manager (EMM) this captures originator id's 111 (nbemm), 143 (mds), 144 (da), 156 (TAO) and 137 (libraries) and more.
# vxlogview -i 111 -t 24:00:00
This will search any files within /usr/openv/logs that contain the originator id 111.  By default, vxlogview will scan every file in the /usr/openv/logs directory for log entries. The -i option narrows this down to only files that contain the originator id specified which saves time when searching logs.  In the above example, log entries will be displayed for oid's 111, 143, 144, 156 and 137 as they are read from the oid 111 log file.  If a -o 111 is used instead of -i 111, then only oid 111 entries will be displayed.
 

Search using a date range

Using a start date with vxlogview will reduce the number of logs that need to be searched.  The logs are separated by date and if no date or time options are used then the default is to search all existing log files.  For systems running with more than the default of three days worth of logs this could add hours to the time it will take for vxlogview to run.  There are several options that can be used to determine what date or time range is searched.
 
The -t <time> option can be used to display entries that were logged during the last number of hours, minutes or seconds. For example, a -t 12:35:19 will capture all log entries created 12 hours, 35 minutes and 19 seconds ago.   This can be useful when searching for recent failures
The -n <days>option can be used to display entries that were logged during the last number of days.  This option will only capture log entries created after midnight.  A -n 2 will capture any log entries created after midnight from two days ago plus any of the current days logs.
The -b <start_date> or -e <end_date> options can be used to display entries that were logged before or after a given time.  
A start date -b "6/9/06 4:15:34 PM" and end date -e "6/10/06 2:15:12 AM" will display all log entries between the dates specified.  This can be useful for capturing all messages that occurred while a specific backup or restore was running.


Search by product ID when appropriate

NetBackup is not the only product that uses unified logging.  The VERITAS Private Branch Exchange (PBX) and other products can generate unified log files.  Each product has it's own default location for storing log files.  By default, vxlogview will search through each products log files searching for results.
 
# vxlogview -p 51216 -t 24:00:00
 
The -p <product> option can be used to narrow the search to a specific product such as NetBackup (51216).  This will cause vxlogview to search only the log files under /usr/openv/logs and not log files for other products.  
 

Search by originator ID when appropriate

The log files in /usr/openv/logs are separated by originator ID.  In NetBackup there are many originators that can generate log files.
 
# vxlogview -p 51216 -o 111 -t 24:00:00
 
The -o <originator> option can be used to search for a specific originator ID, such as nbpem , emm , nbrb , etc.  This will cause vxlogview to search only the log files for the given originator for messages.  This will mean one set of log files are searched instead of all the originators.  If this option is not specified then vxlogview will search the logs of every originator which could add hours to the time it will take for vxlogview to run.
 
When searching for log messages for a specific process be sure to specify the originator ID using the -o switch.
 

Set a DebugLevel that is appropriate for the environment

The -N <level> -D options can be used to verify what logging levels specific messages were generated for.  This can also be used to determine how much logging is generated at each specific debug level.
 
The following command can be used to separate the log entries into specific files.  
# vxlogview -N <level> -D -n 1 -d all > vx<level>.log
 
A debug level of five and six creates the most log entries and the largest log files.  Logging is cumulative so enabling a debug level of 6 will also generate log entries that would exist for levels 1 through 5 as well.  Use a debug level of five or six only when directed byVeritas Technical Support.

It is recommended to combine these options when appropriate.  Specifying the -i option to search only the files for a specific originator id and/or the -o option to search for a specific originator id along with a date range can significantly decrease the time needed for the vxlogview command to run.
 

 

Was this content helpful?