Page 1 of 1
XI 2024 | Highchart dashlet host_name link is broken
Posted: Thu Dec 07, 2023 4:31 pm
by snapier3
The Highchart dashlet is creating malformed hyperlinks for the hosts in hostgroup.
Linux-Servers-->Localhost
forum-bar-chart.PNG
The hyperlink URL is targeting hostgroup:host_name vs host:host_name
Hyperlink takes you to
hosts-link-to-hostgroups.PNG
Re: XI 2024 | Highchart dashlet host_name link is broken
Posted: Fri Dec 08, 2023 10:06 am
by gwesterman
Hi @snapier3,
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
Posted: Fri Dec 08, 2023 10:25 am
by snapier3
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
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
This will correct the broken links with ones that work

Re: XI 2024 | Highchart dashlet host_name link is broken
Posted: Thu Dec 14, 2023 10:56 am
by sgardil
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/