The Highchart dashlet is creating malformed hyperlinks for the hosts in hostgroup.
Linux-Servers-->Localhost
The hyperlink URL is targeting hostgroup:host_name vs host:host_name
Hyperlink takes you to
XI 2024 | Highchart dashlet host_name link is broken
XI 2024 | Highchart dashlet host_name link is broken
You do not have the required permissions to view the files attached to this post.
-
- Posts: 257
- Joined: Wed Aug 23, 2023 11:29 am
Re: XI 2024 | Highchart dashlet host_name link is broken
Hi @snapier3,
Thank you for reporting this. It has been noted and will be addressed in future releases!
Thank you!
Thank you for reporting this. It has been noted and will be addressed in future releases!
Thank you!
Re: XI 2024 | Highchart dashlet host_name link is broken
Here's the fix:
There is a snafu in the "make_highchart.php" file of the dashlet.
Replace the OG if/else with the following snippet
This will correct the broken links with ones that work 
There is a snafu in the "make_highchart.php" file of the dashlet.
Replace the OG if/else with the following snippet
Code: Select all
#MODIFIED BY S.Napier3
#DEC 07, 2023
#FIXES HOSTNAME LINK BUG
if ($link_labels){
$base_url = '/nagiosxi/includes/components/xicore/status.php?show=';
#CHART HOSTGROUP MEMBERS OR ALL HOSTS
if (grab_request_var("hostgroupChoiceSelect","default") !== "default"){
#WE HAVE A HOSTGROUP APPEND IT TO THE URL
$base_url .= 'hosts&hostgroup='.grab_request_var("hostgroupChoiceSelect");
#HOSTGROUP LABELS
$output .=
'labels: {
formatter: function () {
return "<a href=' . $base_url . ' target=' . '_blank' . '>" + this.value + "</a>"
},
useHTML: true
}';
}
else {
#WE DO NOT HAVE A HOSTGROUP
$base_url .= 'hostdetail&host=';
#PER HOST HOST DETAIL LINK
$output .=
'labels: {
formatter: function () {
return "<a href=' . $base_url . '" + this.value + " target=' . '_blank' . '>" + this.value + "</a>"
},
useHTML: true
}';
}
#BACK TO YOUR REGULAR PROGRAM

Re: XI 2024 | Highchart dashlet host_name link is broken
Hey @snapier3
Thanks for sharing the fix you found. If people are uncomfortable with modifying the code and are bothered by this issue, you can keep an eye out on the changelog for a fix in the future for this issue. https://www.nagios.com/changelog/
Thanks for sharing the fix you found. If people are uncomfortable with modifying the code and are bothered by this issue, you can keep an eye out on the changelog for a fix in the future for this issue. https://www.nagios.com/changelog/