Exporting the Inventory Data to CSV Format

You can customize the inventory data you want to export from the ZfS Inventory database in to a comma-separated value (.CSV) file.

You select the inventory components that should be exported, such as the Operating System Name and Version. You can further filter the inventoried servers whose attributes will be exported. For example, you can export only those inventoried servers with a particular processor speed. The Data Export tool will export all inventoried servers satisfying these query conditions into a .CSV file.

If you want to reuse the same data export settings for export, you can save the data export configurations.

The following sections will help you use the Data Export tool:


Invoking the Data Export Tool

To invoke the Data Export tool:

  1. In ConsoleOne, select a container.

  2. Invoke the Data Export tool.


Exporting the Inventory Data to a CSV File

To export the inventory data to a .CSV file:

  1. Open the Data Export tool. See Invoking the Data Export Tool .

  2. Select Create a New Database Query.

    This option lets you add a new query that defines the inventory components such as hardware, software, network, and others that you want to export. You can also specify the criteria to limit the inventoried servers to be included in the query. Based on the inventory components and criteria you specify, the inventory data from the database is exported to a .CSV file.

    Click Next.

  3. Specify the filter conditions for the inventoried servers.

    1. Click Edit Query. For more information to how to define a query, see Forming the Query and Setting the Filter Conditions .

    2. If you have formed a query with only software attributes (such as Vendor, Name, Version, and Product Identification), the Enable Filter check box will be available for selection.

      If you want the results that will be stored in .CSV file to be filtered on the basis of the above query, select the Enable Filter check box.

    3. Click Next.

  4. Select the database fields from the list of Database Fields > click Add.

    If you select a group component, all subcomponents of the group are added. For example, if you select the Software component group, the subcomponents of Software such as vendor name, product name, and version are added.

    Click Next.

  5. View the data export settings.

    1. Click Save Configuration to save the configurations settings to an .EXP file > specify the filename for the .EXP file > click Save.

      The configuration file (.EXP) contains the settings such as the inventory components you selected, and also the query formed for filtering the inventoried server data export. You create an .EXP file so that you can reload the configuration settings and generate the .CSV files any time you need to.

    2. Click Next.

  6. Select Perform the Query from This Computer to run the data export processing from the workstation computer. This option will access the Inventory database on the specified database server and export the data in to a .CSV file.

    If you want to apply default encoding of the machine to the .CSV file, select Default Encoding. The Default Encoding check box is selected by default. To apply Unicode encoding to the .CSV file, select Unicode Encoding.

  7. Specify the .CSV filename > click Finish.

    This generates the .CSV file in the specified directory. Open the .CSV file in Microsoft Excel or any other CSV-supported viewer to view the exported data.

  8. To run the data export tool from an Inventory server, select the Perform the Query option on a Remote Inventory server. See Running the Data Export Program from the Inventory Server .

  9. Save the configuration settings, if necessary.

  10. Click Finish.

    If the configuration settings have not been saved, you will be prompted to save the changes.


Forming the Query and Setting the Filter Conditions

To form the query and set the filter conditions for the data export:

  1. In ConsoleOne, open the Data Export tool. See Invoking the Data Export Tool .

  2. Select Create a New Database Query.

  3. Set the scope for exporting the data from the Inventory database.

    If the ConsoleOne snap-ins and the Data Export tool have been installed for both ZENworks for Servers 3 and ZENworks for Desktops 4, the Data Export tool allows you to change the scope of exporting the inventory data.

    By default, the Servers option will be enabled. The query locates all inventoried servers satisfying the query expression. If ZENworks for Servers and ZENworks for Desktops are installed in the same environment, the Workstations, the Servers and the Both options will be available. When you select Servers, the query locates all inventoried servers satisfying the query expression. Choose Both to include all inventoried workstations and inventoried servers satisfying the query expression.

    Also, you must reconfigure the following Database query conditions:

    Selecting the Attributes of the Inventory Components: In the Select Attribute window, click the Browse Attribute button to select component attributes. For example, to specify the version of BIOS as a component in the data export, select BIOS as the component, and select Version as the component attribute.

    The components are grouped into the following categories: General, Software, Hardware, Network, and System.

    The custom attribute will be prefixed by an asterisk (*).

    Machines that do not satisfy the query: Select the check box to retrieve machines that do not satisfy the query. By default, this check box is not selected.

    Relational operators: The Relational operators determine the relationship between the components and the value. They are grouped on the basis of data type of the attribute selected in the Select Attribute window as shown in the following table:

    Data Type of the Attribute Relational Operators

    String

    Equal To (=), Not Equal To (!=), Matches ([ ]), Does Not Match (![ ]) and Is NULL (null)

    Numeric

    Equal (=), Not Equal (!=), Less Than (<), Less Than or Equal To (< =), Greater Than (>), Greater Than or Equal To (>=), and Is NULL (null)

    Date

    On (=), After (>), On or After (>=), Before (<), On or Before (< =), and Is NULL (null)

    Enum

    Equal To (=), Not Equal To (!=), and Is NULL (null)

    Custom

    Includes all the relational operators that are grouped under the String, Numeric, and Date data types

    For more information on the usage of the relational operators, see Usage of Relational Operators .

    NOTE:  If the query does not display the result when the data type of the attribute is Custom and the relational operator is Numeric or Date, use the Equal To operator to find the values for the custom attributes that are stored in the Inventory database.

    Values for the inventory attributes: Description values are the possible values of an inventory component. For example, 6.0 is a possible value for the DOS-Version attribute. Description values are not case-sensitive.

    NOTE:  For an enumerated attribute, the value will be displayed in the format, enumerated_value [enumerated_ID]. For example, Processor.Processor Family = Pentium (R) III [17].

    If you choose Matches ([ ]) or Does Not Match (![ ]) as the relational operator, you can use wildcards to substitute characters in the Value field. The following table lists the wildcards that can be used according to the SQL documentation:

    Example Specifies to Include

    ?

    Any one character

    _ (underscore)

    Any one character

    %

    Any string of zero or more characters

    []

    Any one character in the specified range or set

    [^]

    Any one character not in the specified range or set

    NOTE:  To define a query using special characters such as ? or [, specify the query in the following formats: [?] or [[].

    The list of description values displayed for an Inventory component is taken from the Inventory database corresponding to the component.

    Query connectors and controls: The connectors and controls available for building filter conditions include the following:

    AND: The expressions before and after the AND must be true.

    OR: Either the expression before the OR or the expression after the OR must be true.

    Insert Row: Lets you build the filter condition for this current row.

    Delete Row: Deletes the row.

    New Group: Lets you form a new filter condition group and specify the criteria for it. This group will be combined with the previous group by using the relational operator specified between the groups.

    End: Ends the filter condition.

  4. Click OK.


Loading an Existing Configuration File

You can load an existing configuration file (.EXP). An .EXP file contains the settings such as the inventory components you selected, and also the query formed for filtering the inventoried server data export.

After you load the .EXP file, you can modify the settings for data export and then export the data to a .CSV file.

To load existing configuration settings for data export:

  1. Ensure that you have generated the data configuration files.

    Complete the procedure outlined in Exporting the Inventory Data to a CSV File . This procedure generates the .CSV file and the data configuration files.

  2. In ConsoleOne, open the Data Export tool. SeeInvoking the Data Export Tool .

  3. Select Open a Saved Database Query > click Next.

    The default directory for .EXP files is CONSOLEONE\ConsoleOne_version\REPORTING\EXPORT. Click Browse to open an existing .EXP file.

    If the .EXP and .CFG files are invalid or are an older version, the data export will not proceed. The data export displays the number of servers and servers that satisfy the query and filter conditions for export.

  4. Click a saved database query from the list.

    If you want to modify the existing query, click Edit. Otherwise, to proceed with the existing query, click Next.

  5. View the data export settings. Click Next.

  6. Select the Perform the Query from this Computer option to run the data export processing from the inventoried server. This option will access the Inventory database on the specified database server and export the data in a .CSV file.

  7. Specify the .CSV filename > click Finish.

    This generates the .CSV file in the specified directory. Open the .CSV file in Microsoft Excel or any other CSV-supported viewer to view the exported data.

  8. To run the data export tool from an Inventory server, click the Perform the Query on a Remote Server option. See Running the Data Export Program from the Inventory Server .

  9. Click Finish.


Running the Data Export Program from the Inventory Server

Running the Data Export program from an Inventory server is recommended if you are exporting data from a large database or if you have specified complex queries with more than 20 database fields selected for exporting.

To run the data export program from the Inventory server:

  1. Ensure that you have generated the data configurations files.

    Follow Step1 to Step 5 outlined in Exporting the Inventory Data to a CSV File and ensure that you save the settings in the .EXP file.

    When you save a .EXP file, a corresponding data configuration file is created in the same directory with the same filename as the .EXP file and with the .CFG file extension.

  2. Click Perform the Query on a Remote Server to run the data export program from any Inventory server that has Server Inventory components installed > click Finish.

  3. Copy the .EXP file and .CFG file to the Inventory server.

    These two files should exist in the same directory on the Inventory server.

    From the Inventory server console, run DBEXPORT.NCF on NetWare® servers or DBEXPORT.BAT on Windows* NT*/2000 servers, enter DBEXPORT configuration_filename.EXP csv_filename.CSV.

    where configuration_filename.EXP is an existing file that contains the data export settings. The data exported from the database will be stored in the CSV_filename.CSV.

    The corresponding .CFG file for the .EXP file should be in the same folder as the .EXP file. The .CFG file contains the list of the database attributes to be exported.

    If the .EXP and .CFG files are invalid or are an older version, the data export will not proceed. The data export displays the number of servers and servers that satisfy the query and filter conditions for export.

    Open the .CSV file in Microsoft Excel or any other CSV-supported viewer to view the exported data.