Cadet 2nd Class Cadet 2nd Class
Cadet 2nd Class
1548 views

Custom Report Parameters for a server Hostname

I'm looking to add a hostname of the ESM server into the subject of a report. I have 5+ ESM servers running the same report and I need to know where it came from. There are custom variables that I can use for dates and names, but I don't see anything for Hostname. Has anyone got this to work in the past?

Current Report Subject: $ReportName

     ex: "My Custom Report"

Desired Report Subject: $hostname $ReportName

     ex: "ESMSystem.domain.com My Custom Report"

From the help docs here are more on the report parameters that are available:

Category

Reference

Description

Report

$ReportName

Prints the name of the report, as specified in the Name field on the Attributes tab of the Report Editor.

$AccessDisclaimer

Prints a disclaimer statement regarding the user permissions with which the report was run. The disclaimer statement is a read-only string which is generated when report data has been filtered due to limited access privileges of the user

Reports are generated only with data for which the current user has access privileges. Depending on user permissions for the user running a given report, access to some types of events or data may be curtailed. In such cases, the report is generated with all the information for which the user has access privileges. Events and data requiring higher-level access privileges are not included in the report. The access disclaimer statement is a standard explanation of the limitations of such a report.

$CurrentPageNumber

Prints the current page number of the report.

$TotalPageNumber

Prints the total number of pages in the report.

Time

$CurrentDateTime

Prints the current date and time. (Same as $Now)

Example output: 12-06-2011-15:32:19.

Tip: Formats for dates and times depend on your Console preference settings. To change the way dates and times are displayed throughout the Console, choose Edit > Preferences, then click the Date & Time button. For more information, see Changing User Preferences.

$CurrentDate

Prints the current date per your format preferences.

Example output: 12-06-2011.

$CurrentMonth

Prints the current month.

Example output: 12-2011.

$CurrentWeek

Prints the current week.

Example output: 49-2011 (for December of 2011).

$Now

Prints the current date and time. (Same as $CurrentDateTime)

Example output: 12-06-2011-15:33:00.

$Today

Prints today's date.

Example output: 12-06-2011-00:00:00.

$CurrentDateTime-<Number>d

Prints the current date and time minus the number of days you specify.

For example, if you ran the report on 12-06-2011 at 15:33:00 and specified the current date and time minus 1 day ($CurrentDateTime-1d), this reference would output 12-05-2011-15:33:00.

If, on the same day, you specified the current date and time minus 3 days ($CurrentDateTime-3d), this reference would output 12-03-2011-15:33:00

Parameters

$Report_Format

Prints the name of the report format that is configured as the default. Output formats are:

*  

pdf - Adobe PDF file.

*  

xls - Microsoft Excel file for tables and charts. (See Table: Report Parameter Values in the Creating Reports topic for additional notes on the Report Format attribute, specifically on the XLS format.)

*  

rtf - Rich-text format document

*  

csv - Tabular data as a list of comma-separated values.

*  

html - Web page displayed by the default web browser

If the default output format for the report is set to html, then $Report_Format reference simply will print the word html.

See Setting Report Parameters: Default and Custom in the Creating Reports topic for information on how to set the default output formats for reports when creating reports.

See also Report Parameters in for information about setting parameters at report runtime.

$Page_Size

Prints the page size of the report.

Example output: Letter [8.5x11 in]

$Run_as_User

Prints the user name specified, if any, for the Run as User parameter in the report.

$Email_to

Prints the e-mail address specified, if any, for the Email to parameter in the report.

$Email_Format

Prints the e-mail format specified, if any, for the Email Format parameter in the report. For example, Send URL or Attach Report.

$Filter_by

Prints the filters used by the referenced query for this report.

$Archive_Report_Folder

Prints the folder location where the archived report is stored.

$Archive_Report_Name

Prints the name of the archived report.

$Archive_Report_Expiration_Time

Prints the expiration time for an archived report.

$<ComponentID>.Row_Limit

Prints the row limit for the specified component.

Tip: <ComponentID> refers to the data components or building blocks of a report. To view the components of a given report, right-click the report in the Navigator panel, choose Edit Report, and click the Data tab for the report.

For example, if the report contains a component called Table, you can display related information by using the Velocity reference $Table.Row_Limit, $Table.Time_Zone, and so forth.

Similarly, if the report, contains components called Chart1, Chart2, and Chart3; you can display related information on each of the charts by using references such as Chart1.Time_Zone, Chart2.Start_Time, and so forth.

$<ComponentID>.Time_Zone

Prints the time zone for the specified component.

For example, Table.Time_Zone would output the time zone used for the data in a component called Table in your report.

Example output: America/Los_Angeles

$<ComponentID>.Start_Time

Prints the start time for the specified component.

For example, Table.Start_Time would output the start time used for the data in a component called Table in your report. (Start Time is a report parameter that can be configured on a per-component basis.)

Example output: 12/05/2011 17:46:50.406-0800

$<ComponentID>.End_Time

Prints the end time for the specified component.

For example, Table.End_Time would output the end time used for the data in a component called Table in your report. (End Time is a report parameter which can be configured on a per-component basis.)

Example output: 12/05/2011 18:00:21.140-0800

$<ComponentID>.<Parameter_name>

Prints the value of the specified component parameter.

$Custom.<Parameter_name>

Prints the value a custom component parameter.

Known variables that work:

#if ($Custom.StartTime == $Custom.EndTime) $Custom.StartTime #elseif (($Custom.StartTime.length()>0) && ($Custom.EndTime.length()>0)) $Custom.StartTime to $Custom.EndTime #else $Now #end

Page $CurrentPageNumber of $TotalPageNumber

I was thinking maybe there was a way to pull the hostname from the "System Information" dashbaord and use that, however I don't know if this value would be able to be accessed via "$componentid.parameter_name" varraible.

Thanks,
Grant

Labels (1)
0 Likes
5 Replies
Cadet 3rd Class Cadet 3rd Class
Cadet 3rd Class

Hi Grant,

Did you find a solution ?

Thanks

Tomasz

0 Likes
Vice Admiral
Vice Admiral

custom can be anything.

If you add "@deviceHostName=hostname" in the query for your report (minus the quotes) you can then add the 'Custom Parameter' to the report under parameters (give it a name) then in the 'Text Attributes' section of the report (template tab) you can reference the custom parameter in the Text field. i.e. $Table.deviceHostName.

 

0 Likes
Vice Admiral
Vice Admiral

@AS_User Thanks for this comment...

We recently upgraded from 6.5 to 6.11 and the $table/$chart prefix is a change from the previous method where you could just use "$custom.custom_parameter_name"... It's a pretty annoying change considering the previous method works in any imported content but not newly constructed content.

Boo... but thanks again @AS_User I was getting annoying trying to find the right variable syntax.

0 Likes
Lieutenant Commander
Lieutenant Commander

Hi All,

Is there any update how to insert the report generator ESM hostname/address via variables into the report?

Thanks in advance!

0 Likes
Vice Admiral
Vice Admiral

2 methods come to mind.

1) Add the ESM Hostname/Address as a static variable to the report query and reference it in the template via one of the methods above.

2) Change the email from account that your ESM uses(you'll need to run ESM setup for this)... This is what I do to identify which ESM a report/alert comes from.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.