Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


How to get the URL of any interface graph in cacti

 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
lcano
Cacti User


Joined: 09 Oct 2008
Posts: 121
Location: Spain

PostPosted: Thu May 27, 2010 5:27 am    Post subject: How to get the URL of any interface graph in cacti Reply with quote

I sometimes need to know the specific URL of any graph interface for several reasons. May be nobody else had this needed before, or probably nobody thought about it. In my case, I had some different network maps (home made network maps, not weather maps), where I had to link the traffic for each interface.

Even, this script allows you to use that URLs for external use, not associated with cacti.

I'm not sure if somebody else can be interested, but once I had it, I think it's a good idea to share with all of you. Who knows if in the future is useful.

An example:

I have one device named: menp1x1.wnet
This device has several FastEthernet interfaces.

Let's say I need to know the URL associated to the graph which shows the traffic of interface FastEthernet1/9/1 in that device. This script allows you to get it automaticaly only with the hostname and the if_name.

Format: ./get_cacti_graph.sh <hostname> <if_name>

$ ./get_cacti_graph.sh menp1x1.wnet Fa1/0/1

Host Name=menp1x1.wnet|Host ID=4|IFace Index=10001|Graph ID=64

URL = http://127.0.0.1/cacti/graph.php?local_graph_id=64


The script is a really simple query to the mysql database to get the needed info.

The script is running in Linux 2.6.



get_cacti_graph.sh
 Description:

Download
 Filename:  get_cacti_graph.sh
 Filesize:  1.54 KB
 Downloaded:  32 Time(s)

Back to top
Sirup
Cacti Moderator


Joined: 02 Mar 2010
Posts: 348

PostPosted: Thu May 27, 2010 6:40 am    Post subject: Reply with quote

Move from "Help: Linux/Unix Specific" to "Scripts and Templates".
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group