XI 2024 | Highchart dashlet host_name link is broken

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
snapier3
Posts: 144
Joined: Tue Apr 23, 2019 7:12 pm

XI 2024 | Highchart dashlet host_name link is broken

Post 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
You do not have the required permissions to view the files attached to this post.
gwesterman
Posts: 257
Joined: Wed Aug 23, 2023 11:29 am

Re: XI 2024 | Highchart dashlet host_name link is broken

Post by gwesterman »

Hi @snapier3,

Thank you for reporting this. It has been noted and will be addressed in future releases!

Thank you!
snapier3
Posts: 144
Joined: Tue Apr 23, 2019 7:12 pm

Re: XI 2024 | Highchart dashlet host_name link is broken

Post 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 ;)
sgardil
Posts: 326
Joined: Wed Aug 09, 2023 9:58 am

Re: XI 2024 | Highchart dashlet host_name link is broken

Post 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/
Post Reply