Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Fri Jul 19, 2019 4:16 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: URLs for Cacti Hosts
PostPosted: Sat Apr 29, 2006 9:34 am 
Offline

Joined: Thu Apr 20, 2006 4:09 pm
Posts: 9
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.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 29, 2006 10:53 am 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22376
Location: Muenster, Germany
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
Code:
mysql -u cactiuser -p cacti
instead of
Code:
mysql -u cactiuser -p
(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

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 29, 2006 4:42 pm 
Offline

Joined: Thu Apr 20, 2006 4:09 pm
Posts: 9
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


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 30, 2006 4:56 am 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22376
Location: Muenster, Germany
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

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 30, 2006 7:57 am 
Offline

Joined: Thu Apr 20, 2006 4:09 pm
Posts: 9
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 253 times
Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 30, 2006 9:39 am 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22376
Location: Muenster, Germany
I did check this. But as I had already applied your first patch. there was some manual intervention required. Now this works fine. But the new feature to take the hostname as default URL does not work (or did I mis sth?)
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 30, 2006 9:58 am 
Offline

Joined: Thu Apr 20, 2006 4:09 pm
Posts: 9
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.


Attachments:
origfiles.tar [110 KiB]
Downloaded 299 times
Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 30, 2006 11:39 am 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22376
Location: Muenster, Germany
Now I realized my error. The replacement id done when editing the device, not when calling the Graphs Tree for that Device. Sorry for my mistake. I confirm your feature.
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Google Adsense [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group