How to modify the column width of the output of the "bperror -U -backstat" command to prevent truncation of the output.
Note: The following pertains to Unix systems only. See note below for Windows.
The output of the command bperror -U -backstat by default has fixed column widths. When the command is run the output may be truncated for clients, policies, schedules, etc., that have names containing more characters than the default column width. The default column widths are as follows:
STATUS is 3 columns
CLIENT is 13 columns
CLASS is 16 columns
SCHED is 10 columns
SERVER is 11 columns
TIME COMPLETED is 19 columns
How to change the default column width:
The default widths are adjusted by creating a configuration file on the master server named SmeMsgs.
On UNIX, this file is located in /usr/openv/msg/C/netbackup
The file contains two lines (see example below). The first line defines the column widths to use for the output, and the second line defines the string to be used for the column headings. The second line needs to be adjusted accordingly to line up the columns once the widths are defined on the first line. It may take several runs of the bperror command in order to get all fields and headings to line up as desired.
Additionally, the locale setting environment variable LANG must be set to "C for the customization to function correctly. The locale variables may be set temporarily for only the shell or script running the bperror command, leaving the default settings on the server unaffected.
NOTE: This is an unsupported procedure, may not be work as described in all releases of NetBackup.
In the example below, the SmeMsgs file contains the definitions for the following column widths:
STATUS: 3 columns
POLICY: 20 columns
SCHED: 10 columns
SERVER: 15 columns
TIME COMPLETED: open
SmeMsgs file contents:
SmeErr0180N " %3d %-15.15s %-20.20s %-10.10s %-15.15s %-*.*s"
SmeErr0190N "STATUS CLIENT POLICY SCHED SERVER TIME COMPLETED\n"
Please note that the STATUS field is right justified, and all others are left justified. Please also note that the column width for the last column "TIME COMPLETED" is given as "%-*.*s". This is taken as a wild card and fills the remainder of line. If a numeric value is used here, an error may be generated.
Once the SmeMsgs file is created, and the locale variables are set, the bperror command may be run. If the output does not appear as desired, edit the SmeMsgs file and rerun the bperror command until the desired result is obtained.
There is no Windows equivalent to the SmeMsgs solution but this 'bperror -U -backstat' report can be approximated by using 'bpdbjobs -report' and adjusting BPDBJOBS_COLDEFS definitions.
See TECH46268 for instructions.