URLs for Cacti Hosts
Moderators: Developers, Moderators
URLs for Cacti Hosts
I have made a handy change to Cacti which allows you to specify a URL for a Device, which is clickable when you're looking at Graphs.
For instance, when you're in Graphs looking at "Tree: Internet Connection Systems-> Host: Internet Router", the text 'Internet Router' will be a link which will open to the URL you specified for that Device.
Download the .tgz file here, save it to your cacti directory, un-tar-gzip it, and read the readme.txt file. (The .tgz file just contains the patch .diff file and a readme.txt file). Make sure you read the readme.txt file, as you have to add a field to the host table in the cacti database for the host's url.
For instance, when you're in Graphs looking at "Tree: Internet Connection Systems-> Host: Internet Router", the text 'Internet Router' will be a link which will open to the URL you specified for that Device.
Download the .tgz file here, save it to your cacti directory, un-tar-gzip it, and read the readme.txt file. (The .tgz file just contains the patch .diff file and a readme.txt file). Make sure you read the readme.txt file, as you have to add a field to the host table in the cacti database for the host's url.
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
I love the idea and tried your patch.
When patching using the given instructions, the pgm pathc asks me for the "real" file to be patched (nothing, that worries me, but may disturb others). And the instruction for changing the db should read instead of (or use cacti is required).
And I should mention, that the URL to be entered into the Devices Section must look like http://..., else it would simply be appended to cacti's own URL.
Did you already think about using cacti's variables for that? E.g. sth like http://|host_hostname|. This might as well be a nice default?
As I'm thinking about such an Add-On since ages, I'd also like some feature like appending the Data Template Name/Graph Template Name/Host Template Name etc. in building the requested URL, so to say http://|host_hostname|/|host_hosttemplate| or http://|host_hostname|/|host_graphtemplate|. http://|host_graphtemplate| would be nice as an additional link to reference e.g. some nice texts describing this very Graph Template and so on.
Of course, all this ideas lack some fundamental design.
Would like to hear your ideas!
Reinhard
When patching using the given instructions, the pgm pathc asks me for the "real" file to be patched (nothing, that worries me, but may disturb others). And the instruction for changing the db should read
Code: Select all
mysql -u cactiuser -p cacti
Code: Select all
mysql -u cactiuser -p
And I should mention, that the URL to be entered into the Devices Section must look like http://..., else it would simply be appended to cacti's own URL.
Did you already think about using cacti's variables for that? E.g. sth like http://|host_hostname|. This might as well be a nice default?
As I'm thinking about such an Add-On since ages, I'd also like some feature like appending the Data Template Name/Graph Template Name/Host Template Name etc. in building the requested URL, so to say http://|host_hostname|/|host_hosttemplate| or http://|host_hostname|/|host_graphtemplate|. http://|host_graphtemplate| would be nice as an additional link to reference e.g. some nice texts describing this very Graph Template and so on.
Of course, all this ideas lack some fundamental design.
Would like to hear your ideas!
Reinhard
Thanks for taking the time to look at it.
I fixed the instructions in the readme file for the MySQL commands.
I also fixed the instructions and the patch for the patch command so users won't get prompted for a filename.
I also modified the description for the URL field on the web page so it specifically states the URL has to begin with http:// or ftp://, etc.
I also changed it so that by default, http://<hostname> will be set as the URL if it is left blank, and created a checkbox just below that to disable URLs completely.
Thanks for the suggestions, I put them all in. Please take another look and tell me what you think!
Ted
I fixed the instructions in the readme file for the MySQL commands.
I also fixed the instructions and the patch for the patch command so users won't get prompted for a filename.
I also modified the description for the URL field on the web page so it specifically states the URL has to begin with http:// or ftp://, etc.
I also changed it so that by default, http://<hostname> will be set as the URL if it is left blank, and created a checkbox just below that to disable URLs completely.
Thanks for the suggestions, I put them all in. Please take another look and tell me what you think!
Ted
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
I forwarded your Add-On to the devs to get their response. They suggest to create a plugin for this. So I will add this to the list of To-Do's but will wait for cacti 0.9.0 to become available as some more hooks are needed for this. Let me have a look at your last changes
Reinhard
PS: It would be nice to publish the tgz as an attachment to your post to keep all resources within this forum
Reinhard
PS: It would be nice to publish the tgz as an attachment to your post to keep all resources within this forum
OK, great. Here is the latest .tar file (this forum wouldn't allow .tgz files for some reason).
- Attachments
-
- cacti_with_urls_0.8.6h.tar
- (10 KiB) Downloaded 299 times
I think you may have missed it. I tried out the new patch on a clean install and everything seemed to work.
Try restoring the original versions of these files and running the patch again:
host.php
lib/api_device.php
lib/html_tree.php
include/config_form.php
I'll upload a tar of just these files, taken straight from the cacti download file.
Try restoring the original versions of these files and running the patch again:
host.php
lib/api_device.php
lib/html_tree.php
include/config_form.php
I'll upload a tar of just these files, taken straight from the cacti download file.
- Attachments
-
- origfiles.tar
- (110 KiB) Downloaded 335 times
Who is online
Users browsing this forum: No registered users and 0 guests