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:
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.
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.
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.
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.
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.
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.)
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.
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.
@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.
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.