How to use the "vxlogview" command to view Veritas NetBackup Unified logging entries

Article: 100017099
Last Published: 2019-06-14
Ratings: 6 3
Product(s): NetBackup & Alta Data Protection

Description

The following are some examples of how to use the vxlogview command to view unified logging.

The vxlogview command will query the log files stored in /usr/openv/logs for information based on any options passed to the command.  For servers with high logging levels and lots of activity the vxlogview command can take a long time to complete.  This delay will be more noticeable the further back the query has to search.  These searches will also contain many log entries and it is best practice to redirect the output to a file and then search that file for information once the vxlogview command completes.

 

To view unified log entries for a specific job ID

The "-X <context_token>" option can be used to display unified log entries based on Job ID.  This will show all unified log entries related to a specific job ID.  This command will not show logs for all jobs in a multi-streamed job.

For example, to display messages for a Job ID 12345 use the command:

#vxlogview -p 51216 -X "jobid=12345"

For multi-streamed jobs a query can be used to search for multiple job Id's:

# vxlogview --where "((ctx = 'jobid=1561')|| (ctx = 'jobid=1562')) && (stdate >= '10/25/2005 02:00:00PM')"

 

To view unified log entries for a specific start or end date

The "-b <start_time>" and "-e <end_time>" options can be used to display messages between a given date range.  These can also be used separately to see anything before or after a specific time.  The format of the <start_time> and <end_time> are" MM/DD/YY HH:MM:SS AM|PM".  The date, time and AM or PM identifier must be present in the command.

For example, if a job started at 1:30pm and failed around 2:32pm the following command can be used to see all messages that occurred between these times.

# vxlogview -p 51216 -b "07/21/05 1:30:00 PM" -e "7/21/05 2:32:00 PM"

 

To view unified log entries within the last time interval

The "-t<hours:minutes:seconds>" can be used to view all unified Log entries that have occurred within the last time interval. This can be used to display the logs from the last X hours, or minutes or even seconds.  

For example, to display the unified logs from the last hour and 30 minutes run the following:

# vxlogview -p 51216 -t 01:30:00

 

To view unified log entries based on severity:

The following options exist to display unified log entries based on severity. These must be used with the "-L" option to display application type messages.  Without the "-L" option the following entries will be ignored.  

-W Display any errors flagged as: [Warning]
-E  Display any errors flagged as: [Error]
-C Display any errors flagged as: [Critical]
-M Display any errors flagged as: [Emergency]

For example, to display all Error messages for the last 24 hours run:

# vxlogview -p 51216 -L -E -t 24:00:00

A query can be run to search for multiple severity levels using the command:

# vxlogview --where "((sev =ERR) || (sev = CRIT) || (sev = EMERG)) && (stdate >= '10/18/200500:00:00 AM')"

 

Using the -o<originator> option to display specific process logs

The originator ID is a number that matches a specific NetBackup process.  Each NetBackup 6.0 daemon that uses unified logging has been assigned an originator ID.  The specific originator ID can be found in the file /usr/openv/netbackup/nblog.conf on the master server.  Following is a listing of some of the new originator IDs in NetBackup 6.0:

111 - Enterprise Media Manager( nbemm )
116 - NetBackup PolicyManager ( nbpem )
117 - NetBackup Job Manager ( nbjm )
118 - NetBackup Resource Broker( nbrb )
153 - NetBackup GenericJob Daemon ( nbgenjob )

For example, to view all NetBackup Policy Manager( nbpem ) log entries within the last 30 minutes run:

# vxlogview -p 51216 -o 116 -t 00:30:00

 

Using the -d <display> option to format the output

The "-d <display>" can be used for format the output of vxlogview .  This can be appended to any vxlogview command to change the waythe log entries are displayed.  Please note that not all log messages contain a value for each display option and some options will appear regardless of the display options used.

 

Option Description Example
D Display the date of the message 07/21/05
T Display the time of the message 12:34:56
m Display the message type [Debug]
i Display the short name of the Product NB
P Display the Product ID 51216
o Display the short name of the Originator nbpem
O Display the Originator ID 116
p Display the Process ID (PID) PID:297
t Display the Thread ID (PID) 4
c Display the context token [parent_job=-1,clientname=nbumaster,type=4]
s Display the log entry severity [Info]
u Display the Unique Message ID V-116-14
x Display the actual log message text << status 0 (the requested operation was successfully completed)
w Display who logged the message [?]
all Display all fields  
 
 
For example, to display the time, process id, originator,severity, unique message ID, and the message textrun:
 
# vxlogview -p 51216 -t 00:15:00 -d T,p,o,s,u,x
 
15:02:51.349 nbjmPID:27187 V-117-43  received BPBRM EXIT STATUS message: Msg: type = 30BRMExitStatusMsg:status_=0
15:02:51.429 nbpemPID:27192 [Info] V-116-14 CLIENT <hostname> POLICY test-dssu  SCHEDFULL  EXIT STATUS 0 (the requested operation was successfully completed)
 
 

To view Job submission details for a period of time

The "--who <value>" option can be used to view Job Submission details for any jobs submitted on the server.   This will search the unified logs for any entry submitted by '?' which will capture job birth, death and submission details for all jobs.  This will not show all the job details, it will just capture the birth, death and job submission details.  This can be helpful in determining what order jobs started in and contains information like last backup time, priority and other options that determine which jobs are due to run.

For example, to show all Job submission details over the last 24 hours

# vxlogview --who'?' -t 24:00:00

Note: This option was deprecated and will not work in later versions of NetBackup.

 

To view unified log entries for all Products

The "-a" option can be used to view logs for all product IDs.  NetBackup (51216) is only one Product ID logged using unified logging that can be specified with the "-p" option.  Additional product IDs such as Veritas Infrastructure Common Services (50936) can also be viewed using vxlogcfg .  In order to see unified log entries for all Products installed on the system the -a option must be used.
 
For example, to view all Product ID log entries within the last hour run:
# vxlogview -a -t 01:00:00 -d all

Was this content helpful?