Chatta subito con l'assistenza
Chat con il supporto

NetVault 13.2 - CLI Reference Guide

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

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 93. 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]"

Example:

nvreport -class "Job History" -format "%Title::25 %starttime::13 %startdate::15 %endtime::13 %enddate::10 %exitstatus::30" -include "%STARTDATE >= 'YYYYMMDD' AND %STARTDATE <= 'YYYYMMDD'”

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.

Using the title option

When a report is run and viewed from the command line, it is given the default title Report “CLI Report” in the output. The -title option can be used to change the report title. The -title option is specified in the following format:

If a title is to contain any spaces, the entire value must be enclosed in quotation marks. While the “-title” option can be used to label a CLI-output report, it is better suited to label a report that is output to file, and viewed outside of the CLI.

Related Documents

The document was helpful.

Seleziona valutazione

I easily found the information I needed.

Seleziona valutazione