Fusion - custom links and url's
Fusion - custom links and url's
Hi Nagios Team,
Am using Nagios Fusion 4.1.7
I had a few queries :
a) How can I add custom links or Dashboard links to the Fusion homepage , something like below, hope you get the idea. b) Custom URL dashlet does not seem to work with URL's with basic auth like http://user:passwd@10.0.0.1:8080/mypage.html
I see a blank page.
Kindly assist.
Regards,
Vish.
Am using Nagios Fusion 4.1.7
I had a few queries :
a) How can I add custom links or Dashboard links to the Fusion homepage , something like below, hope you get the idea. b) Custom URL dashlet does not seem to work with URL's with basic auth like http://user:passwd@10.0.0.1:8080/mypage.html
I see a blank page.
Kindly assist.
Regards,
Vish.
You do not have the required permissions to view the files attached to this post.
Re: Fusion - custom links and url's
NOTE: Please note that while sometimes we may have time to do stuff like this to help you out to get what you want it should not be expected as the standard level of support, not all of us in the support department know how to develop or have the time to do it.
Please download the attached component that I wrote for you to do what you want.
Then go to Admin > Manage Components:
- Click the Browse button and select the downloaded zip file
- Click the Upload & Install button
Now if you go to the Home menu item you will see 3 new links:
Under Server Status you will see:
Under Alerts you will see:
Under Visualizations you will see:
To change them, please edit this file and adjust them:
For example, you could change the top link from this:
To this:
Let us know if you have any questions.
Thank you!
Please download the attached component that I wrote for you to do what you want.
Then go to Admin > Manage Components:
- Click the Browse button and select the downloaded zip file
- Click the Upload & Install button
Now if you go to the Home menu item you will see 3 new links:
Under Server Status you will see:
Code: Select all
Custom Home Link 1
Code: Select all
Custom Alerts Link 1
Code: Select all
Custom Visualization Link 1
Code: Select all
/usr/local/nagiosfusion/html/includes/components/fusioncustomlinks/fusioncustomlinks.inc.php
Code: Select all
$menu->add_link(menu_link(_('Custom Home Link 1'), 'includes/components/fusioncustomlinks/tactical_overview.php'), 'home-server-status');
Code: Select all
$menu->add_link(menu_link(_('My Custom Link'), 'https://username:password@your.domain.com/website/'), 'home-server-status');
Thank you!
You do not have the required permissions to view the files attached to this post.
Re: Fusion - custom links and url's
You could also add a new section to store the custom links:
I wasn't able to reproduce the problem with the basic auth - are there any special characters in the credentials maybe? Try using the browsers dev tools to monitor the network traffic to see what the issue may be.
Code: Select all
<?php
register_fusioncustomlinks();
function register_fusioncustomlinks() {
$component_args = array(
COMPONENT_TYPE => COMPONENT,
COMPONENT_NAME => 'fusioncustomlinks',
COMPONENT_TITLE => _('Fusion Custom Links Component'),
COMPONENT_VERSION => '1.0.0',
COMPONENT_DATE => '03/26/2019',
COMPONENT_AUTHOR => 'Nagios Enterprises, LLC',
COMPONENT_DESCRIPTION => _('Provides Custom Menu Entries'),
COMPONENT_REQUIRES_VERSION => 4100,
COMPONENT_FUNCTION => 'fusioncustomlinks_successful_registration',
);
register_component($component_args);
}
function fusioncustomlinks_successful_registration() {
register_fusioncustomlinks_callbacks();
}
function register_fusioncustomlinks_menu($cb, &$menu) {
$menu->add_section('home', _('stuff'), 'home-stuff');
$menu->add_link(menu_link(_('Nagios'), 'http://www.nagios.com'), 'home-stuff');
}
// register callbacks for fusion functionality
function register_fusioncustomlinks_callbacks() {
register_callback(CALLBACK_MENU_INITIALIZED, 'register_fusioncustomlinks_menu');
}
?>
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Fusion - custom links and url's
Thanks, Custom links works !!! I will try it out.
Yes, there are some special chars.
Below is a url which does not work with Custom URL Dashlet :
http://api_key:eyJrIjoiR0ZXZmt1UFc0OEpI ... sk&orgId=1
Also,
The fusion node I use can't talk to the internet.
So, Where can I download all the components listed under "Manage Components" ?
For eg:
Home Page Modification component is 4.0.1 dated 10/04/2017
From where can I download the latest versions ?
Regards,
Vish.
Yes, there are some special chars.
Below is a url which does not work with Custom URL Dashlet :
http://api_key:eyJrIjoiR0ZXZmt1UFc0OEpI ... sk&orgId=1
Also,
The fusion node I use can't talk to the internet.
So, Where can I download all the components listed under "Manage Components" ?
For eg:
Home Page Modification component is 4.0.1 dated 10/04/2017
From where can I download the latest versions ?
Regards,
Vish.
Re: Fusion - custom links and url's
Run the URLs through a URL encoder such as this and use the encoded URLs instead:
https://meyerweb.com/eric/tools/dencoder/
Or you could change the code to this:
https://meyerweb.com/eric/tools/dencoder/
Or you could change the code to this:
Code: Select all
$menu->add_link(menu_link(_('My Custom Link'), rawurlencode('https://username:password@your.domain.com/website/')), 'home-server-status');
Re: Fusion - custom links and url's
I added the rawurlencode, but I get the below error :ssax wrote:Run the URLs through a URL encoder such as this and use the encoded URLs instead:Code: Select all
$menu->add_link(menu_link(_('My Custom Link'), rawurlencode('https://username:password@your.domain.com/website/')), 'home-server-status');
It seems to be due to "/nagiosfusion/" to the URL.The requested URL /nagiosfusion/http://username:password@your.domain.com/website/ was not found on this server.
I also see the below in chrome inspect :
Kindly advise.Subresource requests whose URLs contain embedded credentials (e.g. `https://user:pass@host/`) are blocked. See https://www.chromestatus.com/feature/5669008342777856 for more details.
Regards,
Vish.
Re: Fusion - custom links and url's
Please PM me your file with the changes so that I can review it.
Re: Fusion - custom links and url's
Hi Sean,
I'll circle back with that info at a later point. Can live with it for now.
Meanwhile had another requirement,
I want to create a one-click enable/disable Maintenance page for a bunch of HOSTGROUPS/HOSTS
I know this can be achieved using curl call on the below :
http://nagiosxi-lab/nagiosxi/includes/c ... _HOSTGROUP
My question was , how can I deploy a custom 'host_maintenance.php' in the fusion folder "/usr/local/nagiosfusion/html/" for this functionality ?
The idea is to use Fusion as a single point of control.
Is this something that can be done ? Or if you have any other best practice , Kindly Advice ?
Regards,
Vish.
I'll circle back with that info at a later point. Can live with it for now.
Meanwhile had another requirement,
I want to create a one-click enable/disable Maintenance page for a bunch of HOSTGROUPS/HOSTS
I know this can be achieved using curl call on the below :
http://nagiosxi-lab/nagiosxi/includes/c ... _HOSTGROUP
My question was , how can I deploy a custom 'host_maintenance.php' in the fusion folder "/usr/local/nagiosfusion/html/" for this functionality ?
The idea is to use Fusion as a single point of control.
Is this something that can be done ? Or if you have any other best practice , Kindly Advice ?
Regards,
Vish.
Re: Fusion - custom links and url's
You would likely need to write your own component for this, please see here:
https://assets.nagios.com/downloads/nag ... onents.php
https://assets.nagios.com/downloads/nag ... onents.php
Re: Fusion - custom links and url's
Thanks Sean.
I will check .
Meanwhile, I have attached a word doc with screenshots and related queries. Kindly advise, if these are possible or the only option is to go with own component.
Regards,
Vish.
I will check .
Meanwhile, I have attached a word doc with screenshots and related queries. Kindly advise, if these are possible or the only option is to go with own component.
Regards,
Vish.
You do not have the required permissions to view the files attached to this post.