サポートと今すぐチャット
サポートとのチャット

NetVault 11.4.5 - CLI Reference Guide

Introduction Getting started Using the command-line utilities Using the nvreport utility

Formatting the reports

The nvreport utility provides several options to format the layout and content of a report. The following sections outline the use of these options.

When a report is run and viewed from the CLI, the output includes several columns. The column header, referred to as “Field Name”, may not be the same as the “real name” of the column set up in the template file that is used to run the report. You must use the real name with the formatting options covered in this section.

You can use one of the following methods to find the real names:

To obtain a list of valid field names for a canned report class, type the following command:

The output includes four columns: Real name, Field name, Data type, and Description.

This command displays all fields that are available with the specified canned report. It includes even those fields that are not displayed when you run the report. You can include these additional fields using the format option. For more information, see Adding or removing columns.

To determine the default fields for a template file, follow these steps:

2
Run the nvreport -help fields [Class Name] command.

Open the template file in a text editor. In this file, the %FORMAT line provides the Real Name for the fields. You can find the template files in <NetVault Backup home>\reports\templates on Windows and <NetVault Backup home>/reports/templates on Linux.

The %FORMAT line of a template file only includes Real Names for the fields displayed when a report is run.

Sample template file:

Using the format option

By default, a report is displayed in a pre-defined layout when run in the terminal window. You can use the ‑format option to specify the number of characters that are displayed in a column, insert a line break, or add or remove columns. The formatting options are described in the following sections:

When you use the -format option, you must use the real name of the fields. Each name must be prefixed with a “%” symbol. If the real name includes the “%” symbol, use the escape sequence “%%” when specifying the name. Moreover, you must specify all required fields in the syntax. If you omit any field in the syntax, it is not displayed in the output.

To specify the maximum numbers of characters for a column, append two colons and a number to the Real Name:

Example:

To include a line break between each entry in the report output, append “%\n” to the end of the list of fields named with the -format option:

Example:

Some template files offer several additional fields that can be included in the output using the -format option. To add a column, obtain the full list of the available fields for a template file using the nvreport -help field <class name> command. Review the information offered in the Description column for each field, and include the applicable fields. Verify that you use the real name of the field.

The following example uses the “drives” canned report. It includes all the default fields and additionally displays the number of Write Errors for the drive.

Example:

Using the sort option

The -sort option can be used to sort the entries on a selected field. A sort expression is specified in the following format:

[field name]: Field on which the report is sorted.
[+/-]: Use + to sort the output in ascending order of the specified field, or - to sort the output in descending order.

A report can be sorted by any field a class offers. Even a Real Name for the field that is not displayed in the output can be used for sorting the output.

When you use the -sort option, you must use the real name of the fields. Each name must be prefixed with a “%” symbol. If the real name includes the “%” symbol, use the escape sequence “%%” when specifying the name.

Example:

You can specify multiple fields with the “-sort” option. The resulting report prioritizes the sort based on the order of the field names in the syntax. When using multiple sort fields, enclose all fields in quotation marks (“ ”).

Example:

Using the include option

The -include option can be used to filter the data for a report. A filter expression is specified in the following format:

[field name]: Real Name of the field.
[operator]: The operator can be any of the following:
[constant]: The value to which the [field name] value is compared. For example, to include only entries that apply to the job assigned the Job ID of “42”, you would include “42” as the [constant].

To join multiple filter expressions, use “AND” and “OR”. In addition, use parenthesis to indicate the priority of the arguments.

Examples:

Table 90. Constant types

Timepassed

Use to compare fields that contain time interval values. For example, the amount of time it took to run a backup job. The value can be specified in the following formats:

Boolean

Use to compare fields that contain boolean values. Examples of boolean values:

Date

Use to compare fields that contain date values.

Example:

nvreport -class “job history” -include “%STARTDATE >= [Date]”

The value can be specified in the following formats:

For example, “now-1YE” would be one year ago.

Daysinweek

Use to compare fields that contain a day of the week.

The value can be specified in the following format:

Daysinmonth

Use to compare fields that contain a specific date in the month. For multiple values use a comma separator and enclose all values in quotation marks.

hdwmycount

Use to compare fields that contain the count (total number) of Hours, Days, Weeks, Months and Years.

The value can be specified in the following format:

[#H] [#D] [#W] [#M] [#Y]

For example, “12H 2W 10M 18Y” indicates 12 hours, two weeks, 10 months, and 18 years.

Each time variable can be added or omitted as required.

Integer (large value)

Use to compare fields that contain large integer values (for example, 764874497498723497)

Number

Use to compare fields that store a numeric value.

Example:

nvreport -class “job history” -include %INSTANCEID = 2

pluginscreen

N/A

selectiontree

N/A

String

Use to compare fields that contain a string value.

Example:

nvreport -class “job history” -include “%EXITSTATUS !=Failed”

Strings of text with spaces must be enclosed in quotation marks.

Systime

Use to compare fields that contain system time.

The value can be specified in the following format:

For example, “now-30mi” would be 30 hours ago.

Time

Use to compare fields that contain any time value.

Example

nvreport -class "job history" -include "%STARTTIME >= [Time]"

The value can be specified in the following format:

For example, “now-12ho” would be 12 hours ago.

Unique

N/A

weeksinmonth

Use to compare fields that store a specific week in the month.

The value can be specified in the following format:

[Week Number]: Required week numbers

“L” refers to the last week in the month. For example, 134L would include the first, third, fourth, and last week in the month.

関連ドキュメント

The document was helpful.

評価を選択

I easily found the information I needed.

評価を選択