10.4 Performing Additional Tasks

10.4.1 Tips for Configuring Reports

Before you decide on the final configuration of a report, experiment with some different configurations. Run the report with different parameter settings and study the results. Does it include all the data you want? Is there extraneous data? Are the charts readable? Is the result appropriate for the audience?

When you are preparing a report, keep in mind the following:

  • Limit the scope of the report. Rather than creating one report for all the Exchange Servers in your enterprise, create separate reports by location or department. If you want to report on physical memory usage, select only that data stream, rather than using all data returned by the NT_MemUtil Knowledge Script. By limiting the scope, you reduce the time it takes to generate a report, reduce the report size, and make the report easy to understand.

  • Use an appropriate time range. To prepare an ad hoc report, a specific time range is probably appropriate. To prepare a report to run on a regular basis, use a sliding time range. Be sure the time range coincides with the times during which data was collected.

  • Be sure you can see all data streams in the chart. If an area or bar chart obscures some of the data streams, use a ribbon or line chart instead. If the rotation of the chart does not facilitate easily reading the data, use a different rotation. If there are too many data streams illustrated in a chart, use a different style for the report (by computer as opposed to all data streams on one page), or further limit the scope of the report.

    Use the Chart Console to see the relative values of data streams before you configure the charts in your reports. Once you understand those relationships, you can better determine how to present data in a report. For example, if there is a great deal of disparity in value between data streams, a ribbon or line chart would be a better choice than an area or bar chart for letting you see all the data. For more information, see the Report Script Help.

10.4.2 Configuring Where the Report Agent Generates Reports

The default output path of the report agent is configured during installation to:

<InstallDir>:\NetIQ\Common\Report

Use the AMAdmin_SetReportPaths Knowledge Script to configure the report agent computer to use a different output path. For more information, see the Help.

The report agent output path is used as a base path for generating reports. To limit access to reports, you can configure each report to generate into a sub-folder under the report agent base path and configure permissions on each sub-folder.

10.4.3 Reporting on Data Collected by a Copy of a Knowledge Script

Application-specific reports are hard-coded to generate reports based on data collected by a particular Knowledge Script. For example, the NT_Report_CPULoad Report Script only includes data collected by the NT_CpuLoaded Knowledge Script.

If you use the NT_Report_CPULoad Report Script to display data collected by a copy of the NT_CPULoaded Knowledge Script, for example, NT_MYCPULoaded, the Report Script raises an event to indicate “No data for report.”

To resolve this problem, you will need to:

  • Create a copy of the Report Script.

  • Edit the Report Script to include data collected by the new Knowledge Script instead of the original, out-of-the-box Knowledge Script.

To copy and check out a Report Script:

  1. In the Control Center console, right-click the report you want and click Copy KS.

  2. In the Copy Knowledge Script window, create a new name for the report.

  3. Click OK.

  4. Right-click the copy of the Knowledge Script and click Check Out KS.

  5. In the Check Out Knowledge Script window, select a folder location to save the Report Script.

  6. Click Save. The Developer Console displays the editable script. You are now ready to edit the Report Script.

To edit the Report Script to use a different data source and check the script into the repository:

  1. In the Developer Console, click View > Properties.

  2. In the Properties window, click Parameters.

  3. In the Parameters tab, click PRM_KSList from the list of parameters and click Modify.

  4. In the Modify Parameter window, edit the Default Value field to specify the name of the Knowledge Script that the report will use to collect data.

  5. Click Save.

  6. Click OK to close the Script Properties window.

  7. Save your changes to local disk by clicking File > Save.

  8. To check your changes into the QDB, click Tools > Check In Knowledge Script.

10.4.4 Configuring Folder Permissions

In addition to limiting report access to authenticated users, you can restrict report access by creating sub-folders in the Report folder, setting permissions for those folders based on the intended audience, and then generating reports to the appropriate folders.

For example, create a report sub-folder for account managers and a sub-folder for IT personnel, and set permissions on those folders that restrict access based on group membership.

When a user from one group connects to AMReports via the URL, only the reports available to that account are visible. See your Windows documentation for information about managing accounts and setting folder permissions.

Generating a Report to a Sub-folder

After you have configured report sub-folders with permissions, configure the output folder location for each report to specify the sub-folder you want.

To write reports to a specific folder:

  1. Start a Report Script job.

  2. Click the Values tab of the Properties window.

  3. In the Select output folder parameter, click Browse [...].

  4. Select Specific name of folder.

  5. In the Folder field, enter the path to the output folder.

    The Report Script name (for example, AvgValueByMin) is the default folder name for the report, and is added to the base output path of the report agent. If you want the report available only to IT personnel, include the IT folder in the name. For example, IT\AvgValueByMin.

    IT\AvgValueByMin is appended to the base output path of the report agent, and the report is generated in that folder.

10.4.5 Maintaining the Size of the Report Folder

The size of the Report folder depends upon number of reports you generate and how long you keep reports.

The size of a report increases as you include more:

  • Data points

  • Charts

A report can range from a few kilobytes to several megabytes.

You can monitor and maintain the size of the Report folder by deleting expired reports. For more information, see the following topics:

10.4.6 Collecting Information about the Report Folder Disk

The size of the Report folder can be monitored indirectly by monitoring the space on the disk where the Report folder is located.

Use the NT_LogicalDiskSpace Knowledge Script to monitor the disk and collect data about the percentage of space that is in use and the amount of space (in MB) that is available.

10.4.7 Reporting on the Used and Available Disk Space for Reports

After you have data about the available disk where the Report folder is located, you can then generate periodic reports about the available and used space on that disk.

For example, if your Report folder is on C:\Program Files\NetIQ Corporation\AppManager\Web\Report, the following data streams are collected:

  • Ldsk: C:AVAIL MB

  • Ldsk: C:USED %

You can then use a report such as ReportAM_AvgValueByDay to generate periodic reports about the values of those two data streams.

10.4.8 Deleting Expired Reports

The Output Settings for a report enables you to configure an expiration date. With an expiration date specified, you can run the AMAdmin_DeleteExpiredReports Knowledge Script to periodically scan the Report folder and delete expired reports. For more information about the AMAdmin_DeleteExpiredReports Knowledge Script, see the Help.

10.4.9 Exporting Report Content

By modifying a Report Script, you can add the option to export the contents of a report to an XML file or to a TXT file in which the report data are represented in a comma-separated format.

Two modifications to the report script are necessary. You must:

  • Add four new parameters to the XML section of the script.

  • Add code to the script.

NOTE:These modifications are possible only for Report Scripts that use NETIQREPORT.dll, referenced in the script as NETIQREPORT.ReportObject.

When you export the contents of a report, the XML or TXT file is output with the same name and to the same directory as the report.

This example uses the ReportAM_AvgValueByHr script. The modified script is renamed ReportAM_AvgValueByHrEXPORT.

This section discusses the following topics:

10.4.10 Adding the New Parameters

The four new parameters include a group folder, Export settings, and the following three parameters:

  • Select output type, which has the following options:

    • Report (create standard report)

    • Export (export content, do not create standard report)

    • Both (create standard report and export content)

  • Select export format, which has the following options:

    • XML (exports to an XML file)

    • CSV (exports to TXT file)

  • Export file column delimiter, leave blank for TAB, which lets you enter the column delimiter you want to use for data. This parameter is valid only if you select CSV as the value for the previous parameter.

The following procedure assumes a familiarity with copying Knowledge Scripts, checking them in and out of the QDB, and editing different portions of a script. For more information about copying scripts and checking them in and out of the QDB, see the Operator Console User Guide for AppManager, available on the AppManager Documentation page.

To add the new group of parameters in the appropriate place:

  1. Make a copy of ReportAM_AvgValueByHr, rename it ReportAM_AvgValueByHrEXPORT, and check it out of the QDB.

  2. Use Notepad to open ReportAM_AvgValueByHrEXPORT.qml.

  3. Scroll through the XML portion at the beginning of the script until you see the following parameter definition:

    <Param name="ReportSetting">
        <Desc>Report settings</Desc>
        <Type>String</Type>
        <Size>128</Size>
        <ReqInput>0</ReqInput>
        <Folder>2</Folder>
        <NoQuote>0</NoQuote>
      </Param>
    
  4. Enter the following parameter descriptions into the script so they immediately precede <Param name="ReportSetting">.

    - folder for export settings
      <Param name="Export">
        <Desc>Export settings</Desc>
        <Type>String</Type>
        <Size>10</Size>
        <ReqInput>0</ReqInput>
        <Folder>1</Folder>
        <NoQuote>0</NoQuote>
      </Param>
     - to specify export, report, or both
      <Param name="PRM_OUTPUT">
        <Desc>Select output type</Desc>
        <Delim>,</Delim>
        <Type>String</Type>
        <Size>10</Size>
        <Value>Report</Value>
        <ReqInput>0</ReqInput>
        <I_Type>I_COMBOBOX("Report","Export","Both")</I_Type>
        <Folder>0</Folder>
        <NoQuote>0</NoQuote>
      </Param>
       - export type, i.e. XML or CSV
      <Param name="PRM_EXPTYPE">
        <Desc>Select export format</Desc>
        <Delim>,</Delim>
        <Type>String</Type>
        <Size>10</Size>
        <ReqInput>0</ReqInput>
        <I_Type>I_COMBOBOX("XML","CSV")</I_Type>
        <Parent>Export</Parent>
        <Folder>0</Folder>
        <NoQuote>0</NoQuote>
      </Param>
       - if CSV, column delimiter
      <Param name="PRM_EXPDELIM">
        <Desc>Export file column delimiter, leave blank for TAB</Desc>
        <Type>String</Type>
        <Size>1</Size>
        <ReqInput>0</ReqInput>
        <Parent>Export</Parent>
        <Folder>0</Folder>
        <NoQuote>0</NoQuote>
      </Param>
    
  5. Save the script, and keep it open in Notepad so you can make the necessary additions to the code.

10.4.11 Adding the Additional Block of Code

In order to implement the values for the parameters you have added to the script, you have to add code to wrap the call in the script that generates the report, and within that section you have to repeat the call that generates the script.

The call to generate the script can contain any of the following:

  • .MakeDrillDownReportV1

  • .MakeDrillDownReportV2

  • .MakeDrillDownReportV3

  • .MakeChart

  • .MakeTable

  • .MakeChartAndTable

To insert the additional code:

  1. Scroll through the XML portion of the script to the Sub Main ( ) routine, and continue until you see the following block of code:

    With ReportObj
    .CHILDSUBTITLE2 = subTitle2
    Select Case PRM_DISPLAYTYPE 
    Case "By computer"
    .ChildColumnFormat(1,300) ="%.2f"
    Case "By data stream"
    .ColumnFormat(1,3) ="%.2f"
    .ChildColumnFormat(1,300) ="%.2f"
    Case "By computer and data stream"
    .ColumnFormat(1,3) ="%.2f"
    .ChildColumnFormat(1) ="%.2f"
    Case "All data streams on one page"
    .ColumnFormat(1,300) ="%.2f"
    Case "By Knowledge Script"
    .ColumnFormat(1,3) ="%.2f"
    .ChildColumnFormat(1,300) ="%.2f"
    End Select 
    If (PRM_DISPLAYTYPE <> "All data streams on one page") Then
    .Filter = StatsFilterObj
    bHasData = .MakeDrillDownReportV1
    (DataSourceObj.RecordSet, IncludeType)
    Else
    StatsFilterObj.Recordset = DataSourceObj.Recordset
    bHasData = .MakeChartAndTable
    (StatsFilterObj.Recordset, IncludeType)
    End If
    End With
    
  2. Insert the new code just after End Select (the new code and the repeated call to generate the report are in bold type):

    With ReportObj
    .CHILDSUBTITLE2 = subTitle2
    Select Case PRM_DISPLAYTYPE 
    Case "By computer"
    .ChildColumnFormat(1,300) ="%.2f"
    Case "By data stream"
    .ColumnFormat(1,3) ="%.2f"
    .ChildColumnFormat(1,300) ="%.2f"
    Case "By computer and data stream"
    .ColumnFormat(1,3) ="%.2f"
    .ChildColumnFormat(1) ="%.2f"
    Case "All data streams on one page"
    .ColumnFormat(1,300) ="%.2f"
    Case "By Knowledge Script"
    .ColumnFormat(1,3) ="%.2f"
    .ChildColumnFormat(1,300) ="%.2f"
    End Select 
    ‘beginning of new code
    If (PRM_Output = "Export") Then
    bHasData = .Export(ADORecObj, PRM_EXPTYPE, PRM_EXPDELIM)
    Elseif (PRM_OUTPUT = "Report") Then
    ‘beginning of call to make report
    If (PRM_DISPLAYTYPE <> "All data streams on one page") Then
    .Filter = StatsFilterObj
    bHasData = .MakeDrillDownReportV1
    (DataSourceObj.RecordSet, IncludeType)
    Else
    StatsFilterObj.Recordset = DataSourceObj.Recordset
    bHasData = .MakeChartAndTable
    (StatsFilterObj.Recordset, IncludeType)
    End If
    Else
    bHasData = .Export(ADORecObj, PRM_EXPTYPE, PRM_EXPDELIM)
    Set ADORecObj = ADOCmdObj.Execute
    'repeat of call to generate report
    If (PRM_DISPLAYTYPE <> "All data streams on one page") Then
    .Filter = StatsFilterObj
    bHasData = .MakeDrillDownReportV1
    (DataSourceObj.RecordSet, IncludeType)
    Else
    StatsFilterObj.Recordset = DataSourceObj.Recordset
    bHasData = .MakeChartAndTable
    (StatsFilterObj.Recordset, IncludeType)
    End If
    End If
    End With
    
  3. Save the script and check it in to the QDB.