Custom Reporting

Version 2
    Share:|

    Links to Other Chapters:  ADDM Support Guide

     

    Please edit this Support Guide and add content.
    These pages will only be valuable if everyone contributes.

       

    BMC Documentation

    The BMC Documentation on Custom Reporting can be found in the ADDM Configuration Guide Here.

     

    Types of Reports

    There are two types of report definitions which have a different XML format:

     

    Type of Report Definition

    Location of XML Config File

    Link Definitions

    /usr/tideway/data/installed/reports/00additional_links.xml

    Report Definitions

    /usr/tideway/data/installed/reports/00reports.xml

     

    Link Definitions

    Link type Reports are accessible from the top of Pages in a menu option called Reports.

    report menu1.png
    Report Definitions

     

    There are Other Reports that appear embedded within the main body of Pages.  These types of reports appear in the body of four pages:

     

    Page

    How to get to the page

    Reports

    Click on the Reports tab

    Infrastructure

    Click on the Infrastructure Tab.

    Applications

    Click on the Applications tab.

    Discovery

    Click on the Discovery Tab – and then Click on Discovery Reports.

    Custom Reports - Hint and Tips

     

    General Hints

    • Custom Reports should be placed in files in the directory:  /usr/tideway/data/custom/reports
    • You must restart the tideway service whenever you make a change to your custom reports.
    • Syntax errors are reported in the file:  /usr/tideway/log/tw_appserver.log
    • For the <where> element in the XML files, make sure you read the BMC Manual and understand the role of the attribute keyword (see
      below).  Otherwise you will get a syntax error in the log file if you misplace the WHERE verb.

          
    <where keyword="False">

    WHERE name ='Retired'

    TRAVERSE Category:ElementCategory:ElementInCategory:Host

    </where>

     

    Hints for Link Definitions

    • The <kind> element must have the same value as the first section of the name attribute as shown below.  Otherwise the Link will not be displayed and you don't get a syntax error in the log file.  For some reports, yo may want to start with one Node kind and traverse to another Node kind; you can't use Link Definitions or these types of reports; you must use Report Definitions.

      
    <refine-report name="Host.Refine.Report.LifeCycleStatus">

    <title>Retired Hosts</title>

    <description>Show all Retired Hosts</description>

    <kind>Host
    </kind>

     

    Hints for Report Type Definitions

    • For Report Type definitions, you must have the report definition located before the channel definition; otherwise you get an error in the channel definition saying that the report does not exists.  I guess this is because the XML file is parsed only once from top to bottom.
    • Don't forget to add your channel to the page on which you want it to appear.  Otherwise your Channel and report will remain
      hidden.  See the bottom of file /usr/tideway/data/installed/reports/00reports.xml for an example.
    • Custom Page definitions replace the Built-in page definitions.  They are not additive.  For example, the custom
      XML page element shown below will replace the installed page definition and only show one channel.  This is unfortunate – because it makes migration harder.  If BMC ever add a new channel, you will have to remember to copy BMC's new channel into your custom page element.

      
    <page name="Reports">

            <channel>Reports.Channel.CustomReports</channel>
    </page>

     

    • I tried to create a brand new page called CustomReports – but the page never appeared and I could not access
      the page using the link;  http://10.106.210.146/ui/CustomReports.  I am not sure if it is possible to create your own brand new report pages.  I think you have to add to the built-in pages.

     

    Sample Custom Report File

    Step 1 - Create Custom Report File

    Create a custom report file called: /usr/tideway/data/custom/reports/05_ANZ_Reports.xml

    Step 2 - Edit the File

     

    The Contents of the file should look like this:

     

    <?xml version="1.0"?><reports version="2.0">  
    <!--  
    ############################################################################   

    ANZ Custom Reports     
    Change log:         
    2014-11-12 - Initial version with report:  Host.Refine.Report.RetiredHosts                    

    Doug Connell - IT Consultant - NZ Monitoring Team.  
    ############################################################################  
    !-->    
    <!--
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    -->  
    <report name="ANZCustomReports.Report.DuplicateHosts1">      
    <title>Duplicate Hosts with New Endpoint Identity</title>      
    <description>Duplicate Hosts with New Endpoint
    Identity</description>      
    <kind>Host</kind>      
    <where>          
    (NODECOUNT(TRAVERSE Previous:EndpointIdentity:Next:Host) > 0)          
    AND name = #Previous:EndpointIdentity:Next:Host.name      
    </where>      
    <order-by>          
    name      
    </order-by>      
    <show>          
    name,          
    os_type      
    </show>  
    </report>    
    <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    -->    SEARCH
    Host SHOW name PROCESS WITH countUnique(0)  
    <report name="ANZCustomReports.Report.DuplicateHosts2">      
    <title>Duplicate Hosts (Unique Host Names)</title>      
    <description>Duplicate Hosts (Unique Host Names)</description>      
    <kind>Host</kind>      
    <order-by>          
    name      
    </order-by>      
    <show>          
    name PROCESS WITH countUnique(0)      
    </show>  
    </report>    
    <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    -->  
    <report name="ANZCustomReports.Report.NoAccess">      
    <title>No Accesses</title>      
    <description>Discovery Access with NoAccess Grouped by OS
    Type</description>      
    <kind>DiscoveryAccess</kind>      
    <where>          
    _last_marker AND state = 'Finished' AND end_state = 'NoAccess'      
    </where>      
    <show>          
    #DiscoveryAccess:DiscoveryAccessResult:DiscoveryResult:DeviceInfo.os_type
    AS 'OS Type',          
    end_state          
    PROCESS WITH countUnique(0)      
    </show>  
    </report>    
    <!--
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    -->  
    <report name="ANZCustomReports.Report.GoodAccess">      
    <title>Good Accesses</title>      
    <description>Discovery Access with GoodAccess Grouped by OS
    Type</description>      
    <kind>DiscoveryAccess</kind>      
    <where>          
    _last_marker AND state = 'Finished' AND end_state = 'GoodAccess'      
    </where>      
    <show>          
    #DiscoveryAccess:DiscoveryAccessResult:DiscoveryResult:DeviceInfo.os_type
    AS 'OS Type',          
    end_state          
    PROCESS WITH countUnique(0)      
    </show>  
    </report>       <!--
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    -->  
    <report
    name="ANZCustomReports.Report.UnsupportedDevices">      
    <title>Unsupported Devices</title>      
    <description>Discovery Access with UnsupportedDevice Grouped by OS
    Type</description>      
    <kind>DiscoveryAccess</kind>      
    <where>          
    _last_marker AND state = 'Finished' AND end_state = 'UnsupportedDevice'      
    </where>      
    <show>          
    #DiscoveryAccess:DiscoveryAccessResult:DiscoveryResult:DeviceInfo.os_type
    AS 'OS Type',          
    end_state          
    PROCESS WITH countUnique(0)      
    </show>  
    </report>    
    <!--
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    -->  
    <report name="ANZCustomReports.Report.ScriptFailures">      
    <title>Script Failures</title>
    <description>

    Script Failures by Failure Reason and Discovery
    Item</description>


    <kind>DiscoveryAccess</kind>


    <where>


    _last_marker


    AND state = 'Finished'


    TRAVERSE DiscoveryAccess:DiscoveryAccessResult:DiscoveryResult:

                            WHERE failure_reason


    </where>


    <show>


    failure_reason,


    kind(#) as "Discovered Item"


    PROCESS WITH countUnique(0)


    </show>


    </report>


    <!-- ################ ANZ REPORT CHANNEL ############## -->


    <report-channel name="Reports.Channel.ANZCustomReports">


    <title>ANZ Custom Reports</title>


    <description>ANZ Custom Reports</description>


    <report>ANZCustomReports.Report.DuplicateHosts1</report>


    <report>ANZCustomReports.Report.DuplicateHosts2</report>


    <report>ANZCustomReports.Report.NoAccess</report>


    <report>ANZCustomReports.Report.GoodAccess</report>


    <report>ANZCustomReports.Report.UnsupportedDevices</report>


    <report>ANZCustomReports.Report.ScriptFailures</report>


    </report-channel>


    <page name="Reports">


    <channel>Reports.Channel.ANZCustomReports</channel>


    <channel>Reports.Channel.OperationalIntegrity</channel>


    <channel>Reports.Channel.FoundationDeployment</channel>


    <channel>Reports.Channel.ChangeControl</channel>


    <channel>DataCentreStand.Channel.DataCentreStandardizationSoftware</channel>


    <channel>Reports.Channel.Software</channel>


    <channel>DataCentreStand.Channel.DataCentreStandardizationReports</channel>


    <channel>DataCentreStand.Channel.DataCentreStandardizationCharts</channel>


    <channel>Resiliency.Channel.HostResiliencyServices</channel>


    <channel>Resiliency.Channel.HostResiliencyPatches</channel>


    <channel>Resiliency.Channel.HostResiliencyKernel</channel>


    </page>

    </report>

     

    Step 3 – Restart Tideway

     

    sudo service tideway stop

    sudo service tideway start

     

    Step 4 – Test the Reports

    Log back in to ADDM and test the reports.

    • Click on the Reports tab.

    • You should see the following reports.

    custom report1.png

    Problems Encountered

     

    Problem - Restart Required

    You must stop and restart the tideway service, in order to see the new custom report.

    Problem - Syntax of Where Clause

    Please notice the keyword attribute in the <where> attribute.  If you set keyword="False" then the KEYWORD verb is not included in the query and you must explicitly add the verb as shown below.

     

     

    WHERE NODECOUNT(TRAVERSE
    ElementInCategory:ElementCategory:Category:LifecycleStatus WHERE name = 'Retired')

     

    Links to Other Chapters:  ADDM Support Guide